/*
 * bytecreation contact — the contact form surface.
 *
 * Consumes the theme's --bc-* tokens (source: critical.css); declares none
 * of its own colors except the state pair (ok/bad), which follow the SAME
 * scheme-switch pattern as critical.css: default, then prefers-color-scheme
 * dark, then [data-mode="dark"] — so the page looks native under every
 * theme mode without touching the theme.
 *
 * The button's base look and the hover glyph-rain moved to the theme
 * (main.css, "The standard button", 2026-11-18) so every button on the
 * site shares one source. What remains here is contact-specific: the
 * .is-sending state (set by bc-contact.js on submit) cycles the trailing
 * glyph 1->0 as the loading indicator: the site's own alphabet, doubled
 * as a spinner.
 */

.bc-contact-ok,
.bc-contact-warn {
	padding: 0.8rem 1.1rem;
	margin: 0 0 1.25rem;
	border-radius: 6px;
	font-weight: 600;
	border-width: 1px;
	border-style: solid;
}

/* Light scheme: pastel green wash, clearly dark green ink. */
.bc-contact-ok {
	--cc-ok-bg: color-mix(in srgb, #3c7a3c 13%, var(--bc-surface));
	--cc-ok-line: #3c7a3c;
	--cc-ok-ink: #1d4a1d;
	background-color: var(--cc-ok-bg);
	border-color: color-mix(in srgb, var(--cc-ok-line) 45%, transparent);
	color: var(--cc-ok-ink);
}

/* Rejected/warn: the chart-alt red family, same wash treatment. */
.bc-contact-warn {
	--cc-bad-bg: color-mix(in srgb, var(--bc-chart-alt) 12%, var(--bc-surface));
	background-color: var(--cc-bad-bg);
	border-color: color-mix(in srgb, var(--bc-chart-alt) 45%, transparent);
	color: color-mix(in srgb, var(--bc-chart-alt) 70%, var(--bc-fg));
}

@media (prefers-color-scheme: dark) {
	:root:not([data-mode="light"]) .bc-contact-ok {
		--cc-ok-bg: color-mix(in srgb, #8cc48c 12%, var(--bc-surface));
		--cc-ok-line: #8cc48c;
		--cc-ok-ink: #b9e2ae;
	}
}

:root[data-mode="dark"] .bc-contact-ok {
	--cc-ok-bg: color-mix(in srgb, #8cc48c 12%, var(--bc-surface));
	--cc-ok-line: #8cc48c;
	--cc-ok-ink: #b9e2ae;
}

/* ---------- the button: site button DNA (see .search-submit) + rain ---------- */

.bc-contact-form {
	max-width: 34rem;
}

.bc-contact-form label {
	display: block;
	margin: 1.1rem 0 0.25rem;
	color: var(--bc-muted);
	font-size: 0.95em;
}

.bc-contact-form input:not([type="hidden"]),
.bc-contact-form textarea {
	width: 100%;
	max-width: 30rem;
	box-sizing: border-box;
}

/*
 * The button's look — accent fill, mono type, glyph-rain hover — is the
 * SITE STANDARD, defined once in the theme (main.css, "The standard
 * button"); this file carries only the contact form's own extras.
 */
.bc-contact-form button[type="submit"] {
	margin-top: 1.25rem; /* layout only */
}

/*
 * Loading state (progressive enhancement: .is-sending is added by
 * bc-contact.js on submit; without JS the button simply submits). The
 * indicator is a discrete content cycle through the site's alphabet —
 * 1, 0, 1, 0 — rather than a generic spinner.
 */
.bc-contact-form button[type="submit"].is-sending {
	cursor: progress;
	min-width: 8ch;
}

.bc-contact-form button[type="submit"].is-sending::after {
	content: "1";
	margin-left: 0.75ch;
	font-variant-numeric: tabular-nums;
	animation: bc-cycle 0.36s steps(1, end) infinite;
}

@keyframes bc-cycle {
	0%  { content: "1"; }
	50% { content: "0"; }
}

.bc-contact-form button[type="submit"]:disabled {
	opacity: 0.85;
}
