/*
 * Forms — shared by the community application (multi-step) and contact (single
 * screen). Loads only where a form block renders.
 * All colour/type comes from theme.json tokens. Gold is used as a rule and a
 * marker only; gold-coloured text on light sits on --accent-ink (6.1:1).
 */

.ehl-form {
	max-width: 780px;
	margin-inline: auto;
	scroll-margin-top: 6rem;
}

/* ---------- Progress ----------
   Only meaningful once JS collapses the form to one step at a time; without JS
   the whole form is on the page and this is hidden. */
.ehl-form__progress,
.ehl-form__bar { display: none; }
.ehl-form.is-stepped .ehl-form__progress { display: grid; }
.ehl-form.is-stepped .ehl-form__bar { display: block; }

.ehl-form__progress {
	grid-template-columns: repeat(4, 1fr);
	gap: 0.5rem;
	list-style: none;
	margin: 0 0 0.75rem;
	padding: 0;
}
.ehl-form__progress-item { margin: 0; padding: 0; max-width: none; }
.ehl-form__progress-btn {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	width: 100%;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	text-align: left;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-muted);
	transition: color var(--ehl-transition);
}
.ehl-form__progress-btn:disabled { cursor: default; }
.ehl-form__progress-btn:not(:disabled) { cursor: pointer; }
.ehl-form__progress-btn:not(:disabled):hover { color: var(--wp--preset--color--ink); }
.ehl-form__progress-btn:not(:disabled):hover .ehl-form__progress-num { border-color: var(--wp--preset--color--ink); }
.ehl-form__progress-num {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 999px;
	border: 1px solid var(--wp--preset--color--line-strong);
	background: transparent;
	font-size: 0.75rem;
	letter-spacing: 0;
	transition: background var(--ehl-transition), border-color var(--ehl-transition), color var(--ehl-transition);
}
.ehl-form__progress-item.is-current .ehl-form__progress-btn { color: var(--wp--preset--color--ink); }
.ehl-form__progress-item.is-current .ehl-form__progress-num {
	background: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--on-ink);
}
.ehl-form__progress-item.is-done .ehl-form__progress-btn { color: var(--wp--preset--color--ink-2); }
.ehl-form__progress-item.is-done .ehl-form__progress-num {
	background: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--ink);
}
@media (max-width: 640px) {
	.ehl-form__progress-label { display: none; }
	.ehl-form__progress { grid-template-columns: repeat(4, auto); justify-content: start; }
}

.ehl-form__bar {
	height: 2px;
	width: 100%;
	background: var(--wp--preset--color--line);
	margin-bottom: var(--wp--preset--spacing--70);
	overflow: hidden;
}
.ehl-form__bar-fill {
	display: block;
	height: 100%;
	width: 25%;
	background: var(--wp--preset--color--accent);
	transition: width 240ms ease-out;
}

/* ---------- Steps ---------- */
.ehl-form__step {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
}
/* No-JS: every step is visible and separated. JS collapses to one at a time. */
.ehl-form__step + .ehl-form__step {
	margin-top: var(--wp--preset--spacing--90);
	padding-top: var(--wp--preset--spacing--70);
	border-top: 1px solid var(--wp--preset--color--line);
}
.js-ehl-steps .ehl-form__step { display: none; }
.js-ehl-steps .ehl-form__step.is-active { display: block; }
.js-ehl-steps .ehl-form__step + .ehl-form__step {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.ehl-form__step-legend {
	display: block;
	width: 100%;
	padding: 0;
	margin-bottom: 0.5rem;
}
.ehl-form__step-count {
	display: block;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-ink);
	margin-bottom: 0.6rem;
}
.ehl-form__step-title {
	display: block;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 500;
	font-size: clamp(1.75rem, 3.4vw, 2.375rem);
	line-height: 1.1;
	color: var(--wp--preset--color--ink);
}
.ehl-form__step-intro {
	color: var(--wp--preset--color--ink-muted);
	margin: 0 0 var(--wp--preset--spacing--70);
	max-width: 60ch;
}

/* ---------- Fields ---------- */
.ehl-form__field {
	margin-bottom: var(--wp--preset--spacing--70);
}
.ehl-form__group {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
}
.ehl-form__label {
	display: block;
	padding: 0;
	margin-bottom: 0.5rem;
	font-family: var(--wp--preset--font-family--body);
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.4;
	letter-spacing: 0.01em;
	color: var(--wp--preset--color--ink);
	max-width: 62ch;
}
.ehl-form__req {
	color: var(--wp--preset--color--accent-ink);
	margin-left: 0.15rem;
}
.ehl-form__help {
	margin: -0.15rem 0 0.75rem;
	font-size: 0.875rem;
	color: var(--wp--preset--color--ink-muted);
	max-width: 62ch;
}
.ehl-form__note {
	margin: 0.9rem 0 0;
	padding: 0.85rem 1.1rem;
	background: var(--wp--preset--color--soft-blush);
	border-left: 2px solid var(--wp--preset--color--accent);
	font-size: 0.9375rem;
	color: var(--wp--preset--color--ink);
	max-width: none;
}

/* Text inputs */
.ehl-form input[type="text"],
.ehl-form input[type="email"],
.ehl-form input[type="url"],
.ehl-form textarea {
	width: 100%;
	box-sizing: border-box;
	font-family: var(--wp--preset--font-family--body);
	font-size: 1rem;
	line-height: 1.5;
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line-strong);
	border-radius: var(--ehl-radius);
	padding: 0.75rem 0.9rem;
	transition: border-color var(--ehl-transition), box-shadow var(--ehl-transition);
}
.ehl-form textarea { resize: vertical; }
.ehl-form input[type="text"]:hover,
.ehl-form input[type="email"]:hover,
.ehl-form input[type="url"]:hover,
.ehl-form textarea:hover { border-color: var(--wp--preset--color--ink-muted); }
.ehl-form input[type="text"]:focus,
.ehl-form input[type="email"]:focus,
.ehl-form input[type="url"]:focus,
.ehl-form textarea:focus {
	border-color: var(--wp--preset--color--ink);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--accent) 35%, transparent);
	outline: none;
}
.ehl-form ::placeholder { color: var(--wp--preset--color--ink-muted); opacity: 1; }

/* Radio / checkbox options */
.ehl-form__options {
	display: grid;
	gap: 0.5rem;
}
@media (min-width: 700px) {
	.ehl-form__options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.ehl-form__options--inline { grid-template-columns: repeat(2, minmax(0, 12rem)); }

.ehl-form__option {
	display: flex;
	align-items: flex-start;
	gap: 0.7rem;
	padding: 0.7rem 0.9rem;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--ehl-radius);
	cursor: pointer;
	font-size: 0.9375rem;
	line-height: 1.4;
	color: var(--wp--preset--color--ink-2);
	transition: border-color var(--ehl-transition), background var(--ehl-transition), color var(--ehl-transition);
}
.ehl-form__option:hover { border-color: var(--wp--preset--color--ink-muted); }
.ehl-form__option input {
	flex: 0 0 auto;
	margin: 0.15rem 0 0;
	width: 1.05rem;
	height: 1.05rem;
	accent-color: var(--wp--preset--color--ink);
}
.ehl-form__option:has(input:checked) {
	border-color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--soft-blush);
	color: var(--wp--preset--color--ink);
	font-weight: 500;
}
.ehl-form__option:has(input:focus-visible) {
	outline: 2px solid var(--wp--preset--color--ink);
	outline-offset: 2px;
}

.ehl-form__other { display: block; margin-top: 0.5rem; }
.ehl-form__other input { max-width: 26rem; }

/* Error state */
.ehl-form__error {
	margin: 0.45rem 0 0;
	font-size: 0.875rem;
	font-weight: 500;
	color: #A32626;
	max-width: none;
}
.ehl-form__error:empty { display: none; }
.ehl-form__field.has-error input[type="text"],
.ehl-form__field.has-error input[type="email"],
.ehl-form__field.has-error input[type="url"],
.ehl-form__field.has-error textarea { border-color: #A32626; }
.ehl-form__field.has-error .ehl-form__options { outline: 1px solid #A32626; outline-offset: 6px; border-radius: 2px; }

.ehl-form__alert {
	margin-bottom: var(--wp--preset--spacing--60);
	padding: 0.9rem 1.1rem;
	background: var(--wp--preset--color--soft-blush);
	border-left: 3px solid #A32626;
	font-size: 0.9375rem;
	color: var(--wp--preset--color--ink);
}
.ehl-form__alert strong { margin-right: 0.35rem; }

/* ---------- Actions ----------
   Without JS only the final bar (the real submit) is shown — Continue/Back are
   step controls and would be inert. */
.ehl-form__actions { display: none; }
.ehl-form__actions:has(.ehl-form__submit),
.ehl-form.is-stepped .ehl-form__actions { display: flex; }
.ehl-form__actions {
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
	margin-top: var(--wp--preset--spacing--70);
	padding-top: var(--wp--preset--spacing--50);
	border-top: 1px solid var(--wp--preset--color--line);
}
.ehl-form__next,
.ehl-form__submit { order: 2; }
.ehl-form__back {
	order: 1;
	background: transparent;
	border: 0;
	padding: 0.9rem 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.9375rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--ink-muted);
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.ehl-form__back:hover { color: var(--wp--preset--color--ink); }
.ehl-form__next:hover,
.ehl-form__submit:hover { cursor: pointer; }

.ehl-form__foot {
	margin-top: var(--wp--preset--spacing--50);
	font-size: 0.8125rem;
	color: var(--wp--preset--color--ink-muted);
}

/* Honeypot — off-screen, never focusable by a human. */
.ehl-form__trap {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- Success panel ---------- */
.ehl-form--done .ehl-form__panel {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-top: 3px solid var(--wp--preset--color--accent);
	border-radius: var(--ehl-radius-lg);
	padding: var(--wp--preset--spacing--80);
}
.ehl-form__eyebrow {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 600;
	font-size: 0.75rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-ink);
	margin: 0 0 0.75rem;
}
.ehl-form__done-title {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 500;
	font-size: clamp(1.875rem, 4vw, 2.75rem);
	line-height: 1.05;
	margin: 0 0 1rem;
	color: var(--wp--preset--color--ink);
}
.ehl-form__actions-done { margin-top: var(--wp--preset--spacing--50); }

/* Screen-reader-only helper (theme has no global one). */
.ehl-form .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
