/*
 * aieo/contact-form, variant `panel` (BRIEF-2026-11-01-FORMS-ON-ROOSTER-ONE.md): a Rooster One form instance (an
 * `aieo_form`: its fields, their widths and messages, its consent, button and success words are the instance's data)
 * drawn as a landing's form panel: the head (an eyebrow or a badge with its icon, the heading, the lede), the card with
 * the two-column field grid (each field full or half as the instance says; one column on a phone), the fields, the
 * choices, the single checks (a consent, a one-choice checkbox), the button, the inline field messages and the status
 * line (the success state). Two layouts, each the geometry of a landing it was carried from:
 *
 *   card  the head centred over a 600 px card in a 752 px column (the Optimizer's early-access form, the legacy
 *         landing.php's #interest), two columns from 640 px;
 *   wash  a toned wash panel (the accent at 16 % to 12 %) with the head at the left and the form's card inside (the
 *         LANSA quote, the legacy landing-lansa.php's #quote), two columns from 721 px.
 *
 * The fields, their labels and "(optional)", the error lines and box, the privacy line and the button are the field
 * recipe every form shares (assets/css/aieo-fields.css, this sheet's dependency; Offers 16-F24, the designer's form
 * specification of 18 Nov 2026): 48 px fields, the theme's primary button. `tone` (a family's accent or a semantic
 * tone) recolours the badge and the wash only, never the focus or the button. Compiled by build/blocks-css.mjs into
 * variants/panel.css, loaded only where the variant renders.
 */

@import "../../../../../engine/blocks/theme.css";

/* ── Shared ───────────────────────────────────────────────────────────────────────────────────────────── */

.aieo-form--panel {
	box-sizing: border-box;
	max-width: none;
	margin-inline: auto;
	color: var(--wp--preset--color--fg);
	font-size: 1rem;
	line-height: 1.5;
}

.aieo-form--panel :where(h2, h3, h4, p, label, legend, fieldset) {
	margin: 0;
}

.aieo-form--panel .aieo-form__set {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.aieo-form--panel .aieo-form__set > legend {
	float: none;
	width: 100%;
	padding: 0;
}

.aieo-form--panel .aieo-form__full {
	grid-column: 1 / -1;
}

.aieo-form--panel .aieo-form__hp {
	position: absolute;
	top: auto;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}


.aieo-form--panel .aieo-form__help {
	margin: 6px 0 0;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--xs);
	line-height: 1.5;
}

/* A single check's refusal (and its help) on a row of its own under the box and its words. */
.aieo-form--panel .aieo-form__check {
	flex-wrap: wrap;
}

.aieo-form--panel .aieo-form__check > label {
	flex: 1 1 0;
	min-width: 0;
}

.aieo-form--panel .aieo-form__check > :is(.aieo-field-error, .aieo-form__help) {
	flex-basis: 100%;
}

.aieo-form--panel .aieo-form__status:focus {
	outline: none;
}

.aieo-form--panel .aieo-form__status:empty {
	margin: 0;
	padding: 0;
	border: 0;
}

.aieo-form--panel .aieo-form__status.is-ok {
	color: var(--wp--preset--color--success);
}

/*
 * A rating (20 Nov 2026, AIEO_Form_CPT's `rating`): five stars on one line, each a 44 px target (FE-O1) whose radio
 * covers it unseen, so the press, the keyboard (the arrows move along the stars) and the focus are the radio's own; the
 * focus ring on the star. In a narrow column (a 240 px phone's sheet) each star takes a fifth of the row, down to the
 * 24 px target, its star 64 % of it: one line always. The theme's star (its mask, drawn filled) in the muted colour,
 * the stars up to the one ticked in the accent, and while the pointer rests on one, the stars up to it: the sheet's
 * alone, no script (FE-F5). Without the theme, the star of our own, in the text's colour.
 */
.aieo-form--panel .aieo-rating {
	display: flex;
	flex-wrap: nowrap;
	min-width: 0;
	margin-top: 4px;
}

.aieo-form--panel .aieo-rating__star {
	position: relative;
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: clamp(24px, 20%, 44px);
	height: auto;
	aspect-ratio: 1;
	border-radius: var(--wp--custom--rooster--shape--control, 6px);
	color: var(--wp--preset--color--muted, color-mix(in srgb, currentColor 40%, transparent));
	cursor: pointer;
}

.aieo-form--panel .aieo-rating__star > input {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	opacity: 0;
	appearance: none;
	cursor: pointer;
}

.aieo-form--panel .aieo-rating__star > .aieo-rating__icon {
	width: min(28px, 64%);
	height: auto;
	aspect-ratio: 1;
	pointer-events: none;
	--rooster-icon-line: var(--rooster-icon-fill);
}

.aieo-form--panel svg.aieo-rating__icon {
	fill: currentColor;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linejoin: round;
}

.aieo-form--panel .aieo-rating__star:has(> input:focus-visible) {
	box-shadow: var(--wp--custom--rooster--focus-ring, 0 0 0 2px currentColor);
}

.aieo-form--panel .aieo-rating:has(input:checked) .aieo-rating__star {
	color: var(--wp--preset--color--accent, currentColor);
}

.aieo-form--panel .aieo-rating__star:has(input:checked) ~ .aieo-rating__star {
	color: var(--wp--preset--color--muted, color-mix(in srgb, currentColor 40%, transparent));
}

@media (hover: hover) {
	.aieo-form--panel .aieo-rating:hover .aieo-rating__star {
		color: var(--wp--preset--color--accent, currentColor);
	}

	.aieo-form--panel .aieo-rating__star:hover ~ .aieo-rating__star {
		color: var(--wp--preset--color--muted, color-mix(in srgb, currentColor 40%, transparent));
	}
}

/* Refused (FB9: its first star carries the mark, the line under the stars says why): the stars in the danger colour. */
.aieo-form--panel .aieo-form__rating:has(input[aria-invalid="true"]) .aieo-rating__star {
	color: var(--wp--preset--color--danger, currentColor);
}

.aieo-form--panel .aieo-form__status.is-error {
	color: var(--wp--preset--color--danger);
}

/* ── card: the head centred over a card (the Optimizer's early-access form) ─────────────────────────── */

/* The legacy column: 800 px with 24 px sides (752 px of content), or the page less 24 px a side; the section's gutter counts towards the 24. */
.aieo-form--panel.aieo-form--card {
	--wp--custom--rooster--field--check: 18px;
	width: min(752px, calc(100% - 2 * max(0px, calc(24px - var(--wp--style--root--padding-left, 16px)))));
	padding: 0;
}

.aieo-form--card .aieo-form__head {
	margin-bottom: 48px;
	text-align: center;
}

.aieo-form--card .aieo-form__eyebrow {
	margin: 0 0 12px;
	color: var(--wp--preset--color--accent-text);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.aieo-form--card .aieo-form__badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 16px;
	padding: 6px 14px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--accent) 30%, transparent);
	border-radius: var(--wp--custom--rooster--shape--badge, 9999px);
	background: color-mix(in srgb, var(--wp--preset--color--accent) 6%, transparent);
	color: var(--wp--preset--color--accent-text);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.5;
}

.aieo-form--card .aieo-form__badge .rooster-icon {
	flex: none;
	width: 14px;
	height: 14px;
}

.aieo-form--card .aieo-form__title {
	margin: 16px 0 12px;
	color: var(--wp--preset--color--contrast-2);
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: normal;
}

@media (min-width: 768px) {
	.aieo-form--card .aieo-form__title {
		font-size: 2.5rem;
	}
}

.aieo-form--card .aieo-form__lede {
	max-width: 480px;
	margin: 0 auto;
	color: var(--wp--preset--color--fg);
	font-size: 1rem;
	line-height: 1.5;
}

.aieo-form--card .aieo-form__card {
	box-sizing: border-box;
	max-width: 600px;
	margin: 0 auto;
	padding: 40px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--rooster--shape--panel, 12px);
	background: var(--wp--preset--color--bg);
}

@media (max-width: 639px) {
	.aieo-form--card .aieo-form__card {
		padding: 40px 12px;
	}
}

/* Bare: a form inside a frame of its own (the form button's window, 11.3.6): the frame is the card, so none around the
   fields (no double rule, FE-L1). */
.aieo-form--panel.aieo-form--bare {
	width: 100%;
}

.aieo-form--bare .aieo-form__card,
.aieo-form--card.aieo-form--bare .aieo-form__card {
	max-width: none;
	padding: 0;
	border: 0;
	background: none;
}

.aieo-form--card .aieo-form__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
}

@media (min-width: 640px) {
	.aieo-form--card .aieo-form__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.aieo-form--card .aieo-form__field {
	min-width: 0;
}

.aieo-form--card .aieo-form__choices {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 6px 16px;
}

.aieo-form--card :is(.aieo-form__choice, .aieo-form__check) {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.aieo-form--card .aieo-form__check {
	margin-top: 4px;
}

.aieo-form--card :is(.aieo-form__choice, .aieo-form__check) input {
	margin: 3px 0 0;
}

.aieo-form--card :is(.aieo-form__choice, .aieo-form__check > label) {
	color: var(--wp--preset--color--fg);
	font-size: 14px;
	line-height: 20px;
	cursor: pointer;
}

.aieo-form--card .aieo-form__check a {
	color: inherit;
}

.aieo-form--card .aieo-form__actions {
	margin-top: 24px;
}

.aieo-form--card .aieo-form__status {
	margin: 0 0 16px;
	padding: 14px;
	border-radius: var(--wp--custom--rooster--shape--panel, 8px);
	font-size: 14px;
	line-height: 20px;
}

.aieo-form--card .aieo-form__status.is-ok {
	background: color-mix(in srgb, var(--wp--preset--color--success) 10%, transparent);
}

.aieo-form--card .aieo-form__status.is-error {
	background: color-mix(in srgb, var(--wp--preset--color--danger) 8%, transparent);
}

@media (max-width: 639px) {
	.aieo-form--card .aieo-form__choices {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ── wash: a toned wash panel with the form's card inside (the LANSA quote) ─────────────────────────── */

/* The legacy page's column: 1132 px, or the page less 24 px a side; the section's gutter counts towards the 24. */
.aieo-form--panel.aieo-form--wash {
	--wp--custom--rooster--field--check: 13px;
	width: min(1132px, calc(100% - 2 * max(0px, calc(24px - var(--wp--style--root--padding-left, 16px)))));
	padding: 36px 32px;
	border-radius: var(--wp--custom--rooster--shape--panel, 16px);
	background: linear-gradient(135deg, color-mix(in srgb, var(--aieo-form-tone, var(--wp--preset--color--accent)) 16%, transparent) 0%, color-mix(in srgb, var(--aieo-form-tone, var(--wp--preset--color--accent)) 12%, transparent) 100%);
}

.aieo-form--wash .aieo-form__eyebrow {
	margin: 0 0 10px;
	color: var(--wp--preset--color--contrast-2);
	font-size: 11px;
	font-weight: 700;
	line-height: 1.6;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.aieo-form--wash .aieo-form__badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 10px;
	padding: 4px 12px;
	border-radius: var(--wp--custom--rooster--shape--badge, 9999px);
	background: color-mix(in srgb, var(--wp--preset--color--accent) 14%, transparent);
	color: var(--wp--preset--color--accent-text);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
}

.aieo-form--wash .aieo-form__badge .rooster-icon {
	flex: none;
	width: 14px;
	height: 14px;
}

.aieo-form--wash .aieo-form__title {
	margin: 0 0 12px;
	color: var(--wp--preset--color--contrast);
	font-size: clamp(24px, 3.2vw, 34px);
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -0.022em;
}

.aieo-form--wash .aieo-form__lede {
	max-width: 70ch;
	margin: 0 0 14px;
	font-size: 1rem;
	line-height: 1.6;
}

.aieo-form--wash .aieo-form__card {
	margin-top: 8px;
	padding: 26px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--rooster--shape--panel, 14px);
	background: color-mix(in srgb, var(--wp--preset--color--contrast) 4%, transparent);
}

.aieo-form--wash .aieo-form__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px 18px;
}

.aieo-form--wash .aieo-form__choices {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 6px 18px;
}

.aieo-form--wash :is(.aieo-form__choice, .aieo-form__check) {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

/* The words of a choice and of a single check, the row's (the legacy's label held its box: the box is set in the words' type). */
.aieo-form--wash :is(.aieo-form__choice, .aieo-form__check) {
	margin: 0;
	color: var(--wp--preset--color--fg);
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1.5;
}

.aieo-form--wash :is(.aieo-form__choice, .aieo-form__check > label) {
	cursor: pointer;
}

.aieo-form--wash :is(.aieo-form__choice, .aieo-form__check) input {
	margin: 3px 0 0;
}

.aieo-form--wash :is(.aieo-form__choice, .aieo-form__check) input::before {
	width: 0.5rem;
	height: 0.5rem;
}

.aieo-form--wash .aieo-form__check a {
	color: inherit;
}

.aieo-form--wash .aieo-form__actions {
	margin-top: 18px;
}

.aieo-form--wash .aieo-form__status {
	margin: 0 0 14px;
	padding: 12px 14px;
	border: 1px solid transparent;
	border-radius: var(--wp--custom--rooster--shape--panel, 10px);
	font-size: 13.5px;
	line-height: 1.5;
}

.aieo-form--wash .aieo-form__status.is-ok {
	border-color: color-mix(in srgb, var(--wp--preset--color--success) 45%, transparent);
	background: color-mix(in srgb, var(--wp--preset--color--success) 16%, transparent);
}

.aieo-form--wash .aieo-form__status.is-error {
	border-color: color-mix(in srgb, var(--wp--preset--color--danger) 45%, transparent);
	background: color-mix(in srgb, var(--wp--preset--color--danger) 16%, transparent);
}

@media (max-width: 720px) {
	.aieo-form--wash :is(.aieo-form__grid, .aieo-form__choices) {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ── tone: a family's accent (the theme's is-style-accent-<slug> re-maps the presets) or a semantic tone ── */

/* A semantic tone colours the head (the badge, the eyebrow) and the wash (above), nothing of the form: its focus is the
   theme's ring and its button the theme's (Offers 16-F24). */
.aieo-form--panel:is(.is-tone-success, .is-tone-warning, .is-tone-danger, .is-tone-neutral) .aieo-form__head {
	--wp--preset--color--accent: var(--aieo-form-tone);
	--wp--preset--color--accent-text: var(--aieo-form-tone-text);
}

.aieo-form--panel.is-tone-success {
	--aieo-form-tone: var(--wp--preset--color--success, light-dark(#15803d, #4ade80));
	--aieo-form-tone-text: var(--aieo-form-tone);
}

.aieo-form--panel.is-tone-warning {
	--aieo-form-tone: var(--wp--preset--color--warning, light-dark(#b45309, #fbbf24));
	--aieo-form-tone-text: var(--wp--preset--color--warning-ink, light-dark(#896610, #fbbf24));
}

.aieo-form--panel.is-tone-danger {
	--aieo-form-tone: var(--wp--preset--color--danger, light-dark(#b91c1c, #f87171));
	--aieo-form-tone-text: var(--aieo-form-tone);
}

.aieo-form--panel.is-tone-neutral {
	--aieo-form-tone: var(--wp--preset--color--muted, light-dark(#525252, #a3a3a3));
	--aieo-form-tone-text: var(--aieo-form-tone);
}
