/*
 * Get in touch — layout for the adaptive form and its chrome.
 *
 * The Bricks Form element is the white card AND the flex container for its
 * fields; input/select styling itself is Bricks-native (merchant_field_styles(),
 * tools/checkout-layout.php), set on the form in tools/build-contact-page.php.
 * This file lays the fields out, hides disabled ones, and styles the parts
 * Bricks has no control for: the enquiry chips, the numbered steps and the
 * divert/note banners. All colours/sizes are design-system variables.
 *
 * Design review slide 34 (12 Oct 2026): the page was "a bit too
 * friendly/childish". Headings inside the form and the sidebar are Articulat
 * Bold, unselected chips are outlined, every banner is a plain grey box (the
 * workbooks' extra-info box), and the sidebar loses its cards: the per-enquiry
 * help sits in a pale green box with a green bar, the contact details and
 * office as plain text. The sidebar stays on screen as the form scrolls.
 */

/* ── Form card = flex field container ─────────────────────────────────────── */
#brxe-ctform {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--sp-4);
	align-items: start;
	/* Hidden until the adaptive layer has picked an enquiry, so all 19 fields
	   never flash before the irrelevant ones are hidden. */
	visibility: hidden;
}
#brxe-ctform.ct-ready { visibility: visible; }

/* Bricks renders an empty <label> above every html chrome field when Show
   labels is on; the chrome markup is wrapped in .ct-slot, so hide those. */
#brxe-ctform .form-group:has(> .ct-slot) > label { display: none; }
#brxe-ctform .form-group {
	grid-column: span 2;   /* full width by default (chrome, message, submit) */
	margin: 0;
	min-width: 0;
}
#brxe-ctform .form-group[data-half] {
	grid-column: span 1;   /* the JS marks the paired input fields */
}
#brxe-ctform .form-group[hidden] {
	display: none !important;
}

/* Button last, privacy line under it (both bumped past the order-0 fields). */
#brxe-ctform .submit-button-wrapper { order: 1; margin-top: var(--sp-2); }
#brxe-ctform .form-group:has(.ct-privacy) { order: 2; }

/* Honeypot: the whole wrapper is taken out of view. */
#brxe-ctform .form-group:has([name="form-field-cthony"]) {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* The message textarea keeps the field look but is comfortably tall. */
#brxe-ctform textarea { min-height: 128px; resize: vertical; }

/* Selects: the §9.2 field with a caret. Bricks styles inputs through the form
   element's own controls but leaves native selects bare, so match them here. */
#brxe-ctform select {
	width: 100%;
	height: var(--field-height);
	padding: 0 calc(var(--sp-input-pad-x) + 24px) 0 var(--sp-input-pad-x);
	appearance: none;
	-webkit-appearance: none;
	border: 1px solid var(--c-border-soft);
	border-radius: var(--r-sharp);
	background: var(--c-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") no-repeat right var(--sp-input-pad-x) center;
	font-size: var(--t-body-size);
	line-height: var(--t-body-lh);
	color: var(--c-ink);
	cursor: pointer;
}
#brxe-ctform select:focus-visible {
	outline: 2px solid var(--c-focus);
	outline-offset: 2px;
}

/* Chrome html-fields carry no field spacing of their own. */
#brxe-ctform .ct-slot { display: block; }

/* ── Numbered steps ───────────────────────────────────────────────────────── */
.ct-step {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 14px;
	margin-bottom: var(--sp-3);
}
.ct-num {
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--r-pill);
	background: var(--c-brand);
	color: var(--c-brand-ink);
	font-weight: 700;
	font-size: var(--t-sm-size);
	line-height: 1;
}
.ct-step-title {
	margin: 0;
	font-family: var(--font-body);
	font-weight: var(--fw-bold);
	font-size: var(--t-h4-size);
	line-height: var(--t-h4-lh);
	color: var(--c-ink);
}

/* ── Enquiry chips ────────────────────────────────────────────────────────── */
.ct-chips {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 10px;
}
.ct-chip {
	appearance: none;
	border: 0;
	cursor: pointer;
	padding: 9px 18px;
	border-radius: var(--r-pill);
	background: var(--c-surface);
	box-shadow: inset 0 0 0 1px var(--c-ink-body);
	color: var(--c-ink);
	font-family: inherit;
	font-size: var(--t-sm-size);
	font-weight: var(--fw-demibold);
	line-height: 1.2;
	transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.ct-chip:hover { box-shadow: inset 0 0 0 1px var(--c-ink); }
.ct-chip.is-active {
	background: var(--c-brand);
	box-shadow: none;
	color: var(--c-brand-ink);
}
.ct-chip:focus-visible {
	outline: 2px solid var(--c-focus);
	outline-offset: 2px;
}
/* ── Divert / note banners ────────────────────────────────────────────────── */
/* One grey box for every enquiry: the config's tones are no longer drawn. */
.ct-banner {
	display: none;                 /* shown by JS via .is-on once filled */
	border-radius: var(--r-sharp);
	padding: var(--sp-5) var(--sp-6);
	background: var(--c-surface-muted);
}
.ct-banner.is-on { display: flex; }

.ct-divert {
	flex-direction: column;
	align-items: flex-start;
	gap: var(--sp-4);
}
.ct-banner-text { display: flex; flex-direction: column; gap: 6px; }
.ct-banner-title {
	font-weight: var(--fw-bold);
	font-size: var(--t-body-size);
	line-height: var(--t-body-lh);
	color: var(--c-ink);
}
.ct-banner-body {
	font-size: var(--t-body-size);
	line-height: var(--t-body-lh);
	color: var(--c-ink);
	max-width: 620px;
}
.ct-banner-link {
	flex: 0 0 auto;
	font-weight: var(--fw-medium);
	text-decoration: underline;
	color: var(--c-ink);
}
.ct-banner-link.is-hidden { display: none; }
/* No display here: it would outrank .ct-banner's display: none and show the
   empty box on every enquiry without a note. */
.ct-note { flex-direction: column; gap: 6px; }

/* Privacy microcopy under the button. */
.ct-privacy {
	margin: 0;
	font-size: var(--t-xs-size);
	line-height: var(--t-xs-lh);
	color: var(--c-ink-muted);
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
/* Its headings in Articulat Bold, as the steps'. */
.ct-side h3 {
	font-family: var(--font-body);
	font-weight: var(--fw-bold);
}
/* The help list, filled per enquiry by the JS: plain lines, no ticks. */
#ct-help-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-4); }
.ct-help-item {
	font-size: var(--t-body-size);
	line-height: var(--t-body-lh);
	color: var(--c-ink);
}

/* ── Mobile: single column, banner stacks ─────────────────────────────────── */
@media (max-width: 600px) {
	#brxe-ctform { grid-template-columns: 1fr; }
	#brxe-ctform .form-group,
	#brxe-ctform .form-group[data-half] { grid-column: span 1; }
	.ct-step-title { font-size: var(--t-h5-size); line-height: var(--t-h5-lh); }
}
