/**
 * A&A Home Cleaning — public booking form.
 * Scoped under .aahc-form. Palette mirrors the site theme; headings use
 * var(--wp--preset--font-family--heading) / body text inherits the page's
 * font so both track whatever the theme's global styles currently set —
 * never hardcode a font name here, it drifts out of sync silently.
 */

.aahc-form {
	--f-ink: #1F2A20;
	--f-ink-soft: #5C6657;
	--f-cream: #F7F3EC;
	--f-cream-2: #EFE7DA;
	--f-line: #DED7C7;
	--f-green: #1F2A20;
	--f-gold: #B8935A;
	--f-danger: #9E3A32;
	--f-white: #FFFDF9;

	/* Rendered with .alignfull so the theme's constrained layout gives it the
	   full width; we then cap and centre the content for the desktop layout. */
	width: auto;
	max-width: 1140px;
	margin: 3rem auto;
	padding-inline: 1.25rem;
	color: var(--f-ink);
	font-size: 16px;
	line-height: 1.55;
}

.aahc-form *,
.aahc-form *::before,
.aahc-form *::after { box-sizing: border-box; }

.aahc-form-grid {
	display: grid;
	grid-template-columns: 1fr 360px;
	grid-template-areas: "main sidebar";
	align-items: start;
	gap: 20px 36px;
}

.aahc-form-main { grid-area: main; min-width: 0; }

/* ---- sections ---- */
.aahc-f-section {
	background: var(--f-white);
	border: 1px solid var(--f-line);
	border-radius: 12px;
	padding: 20px 22px;
	margin-bottom: 16px;
}
.aahc-f-section h3 {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.15rem;
	margin: 0 0 14px;
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--f-green);
}
.aahc-f-step {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--f-green);
	color: var(--f-cream);
	font-size: 0.8rem;
	font-family: inherit;
	flex: none;
}

.aahc-f-label {
	display: block;
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: var(--f-ink-soft);
	margin: 14px 0 6px;
}
.aahc-f-section > .aahc-f-label:first-of-type,
.aahc-f-section h3 + .aahc-f-label { margin-top: 0; }

.aahc-f-input {
	width: 100%;
	/* Fixed height (not just matching padding) — a native <input type="date">
	   and a <select> (Preferred date vs. Preferred time) box themselves to
	   slightly different intrinsic heights even with identical padding/font,
	   which is what made that row look uneven. */
	height: 44px;
	font: inherit;
	font-size: 0.95rem;
	padding: 0 12px;
	border: 1px solid var(--f-line);
	border-radius: 8px;
	background: var(--f-cream);
	color: var(--f-ink);
	line-height: 42px;
}
.aahc-f-input:focus {
	outline: none;
	border-color: var(--f-green);
	box-shadow: 0 0 0 3px rgba(31, 42, 32, .12);
	background: var(--f-white);
}
.aahc-f-input.aahc-f-invalid {
	border-color: var(--f-danger);
	box-shadow: 0 0 0 3px rgba(158, 58, 50, .12);
}

.aahc-f-row {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
}
.aahc-f-row:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, 1fr); }

/* ---- choice cards ---- */
.aahc-f-cards {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.aahc-f-card {
	position: relative;
	border: 1px solid var(--f-line);
	border-radius: 8px;
	padding: 9px 14px;
	cursor: pointer;
	font-size: 0.9rem;
	background: var(--f-cream);
	transition: border-color .12s, background .12s;
}
.aahc-f-card input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.aahc-f-card:hover { border-color: var(--f-gold); }
.aahc-f-card:has(input:checked) {
	border-color: var(--f-green);
	background: var(--f-green);
	color: var(--f-cream);
	font-weight: 600;
}
.aahc-f-card:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(31, 42, 32, .18); }

/* ---- checkboxes (add-ons) ---- */
.aahc-f-checks {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px 14px;
}
.aahc-f-check {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 12px;
	border: 1px solid var(--f-line);
	border-radius: 8px;
	cursor: pointer;
	background: var(--f-cream);
	font-size: 0.92rem;
}
.aahc-f-check:hover { border-color: var(--f-gold); }
.aahc-f-check:has(input:checked) { border-color: var(--f-green); background: var(--f-white); }
.aahc-f-check input { width: 16px; height: 16px; accent-color: var(--f-green); flex: none; }
.aahc-f-check span { flex: 1; }
.aahc-f-check em { font-style: normal; color: var(--f-ink-soft); font-size: 0.85rem; }

/* ---- accordion (collapsed-by-default sub-section, e.g. Partial cleaning) ---- */
.aahc-f-accordion {
	border: 1px solid var(--f-line);
	border-radius: 10px;
	background: var(--f-cream);
	padding: 0 14px;
}
.aahc-f-accordion summary {
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 13px 0;
	font-size: 0.92rem;
	font-weight: 600;
	color: var(--f-ink);
	outline: none;
	border-radius: 6px;
}
.aahc-f-accordion summary::-webkit-details-marker { display: none; }
/* Clicking/toggling a <summary> focuses it — browsers draw their own default
   (often a heavy black) focus ring there with no CSS at all. Swap it for the
   same gold-tinted ring every other interactive control in this form uses
   (.aahc-f-input:focus, .aahc-f-card:has(input:focus-visible)), and only show
   it for keyboard focus so a mouse click stays visually clean. */
.aahc-f-accordion summary:focus-visible {
	box-shadow: 0 0 0 3px rgba(184, 147, 90, .35);
}
.aahc-f-accordion summary::after {
	content: '+';
	flex: none;
	font-size: 1.15rem;
	line-height: 1;
	color: var(--f-gold);
	transition: transform .15s;
}
.aahc-f-accordion[open] summary::after { transform: rotate(45deg); }
.aahc-f-accordion .aahc-f-checks { padding: 2px 0 16px; }

/* ---- sidebar ----
 * Estimate + FAQ stick and scroll together as ONE unit. Making only the
 * estimate card sticky (its own grid row) let it travel past the FAQ block
 * beneath it whenever the main column (much taller) inflated that row's
 * track height — the FAQ would then scroll up and visually disappear under
 * the pinned estimate card. Wrapping both in one sticky container removes
 * the extra travel room entirely: the sticky containing block is now sized
 * to exactly their combined height, so there's nothing for it to overlap. */
.aahc-form-sidebar {
	grid-area: sidebar;
	position: sticky;
	top: 24px;
	display: flex;
	flex-direction: column;
	gap: 20px;
	max-height: calc(100vh - 48px);
	overflow-y: auto;
}
.aahc-form-summary { flex: none; }
.aahc-f-summary-inner {
	background: var(--f-green);
	color: var(--f-cream);
	border-radius: 12px;
	padding: 22px;
}
.aahc-f-summary-inner h4 {
	font-family: var(--wp--preset--font-family--heading);
	margin: 0 0 14px;
	font-size: 1.1rem;
	color: var(--f-white);
}
.aahc-f-lines { margin: 0 0 14px; display: grid; gap: 6px; }
.aahc-f-lines div {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 0.86rem;
	color: rgba(247, 243, 236, .82);
}
.aahc-f-lines div span:last-child { white-space: nowrap; }
.aahc-f-total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding-top: 14px;
	border-top: 1px solid rgba(247, 243, 236, .2);
}
.aahc-f-total-label { font-size: 0.86rem; text-transform: uppercase; letter-spacing: .03em; }
.aahc-f-total-value {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.7rem;
	color: var(--f-white);
}
.aahc-f-total-note {
	margin: 10px 0 0;
	font-size: 0.78rem;
	color: rgba(247, 243, 236, .7);
}

/* ---- consent checkbox ---- */
.aahc-f-consent {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 4px 2px 14px;
	font-size: 0.85rem;
	color: var(--f-ink-soft);
	line-height: 1.4;
	cursor: pointer;
}
.aahc-f-consent input {
	width: 16px;
	height: 16px;
	margin-top: 2px;
	accent-color: var(--f-green);
	flex: none;
}
.aahc-f-consent input.aahc-f-invalid {
	outline: 2px solid var(--f-danger);
	outline-offset: 2px;
	border-radius: 3px;
}
.aahc-f-consent a {
	color: var(--f-green);
	text-decoration: underline;
}

/* ---- submit / messaging ---- */
.aahc-f-submit {
	width: 100%;
	font: inherit;
	font-weight: 700;
	font-size: 1rem;
	padding: 14px 20px;
	border: none;
	border-radius: 9px;
	background: var(--f-gold);
	color: #2A1E0E;
	cursor: pointer;
	margin-top: 4px;
}
.aahc-f-submit:hover { background: #a9834b; }
.aahc-f-submit[disabled] { opacity: .6; cursor: progress; }

.aahc-f-fineprint { font-size: 0.8rem; color: var(--f-ink-soft); margin: 10px 2px 0; }

.aahc-f-error {
	background: #F6E3E0;
	color: var(--f-danger);
	border: 1px solid #E4B9B3;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 0.88rem;
	margin-bottom: 12px;
}

.aahc-f-success {
	background: var(--f-white);
	border: 1px solid var(--f-line);
	border-radius: 12px;
	padding: 34px 28px;
	text-align: center;
}
.aahc-f-success h3 {
	font-family: var(--wp--preset--font-family--heading);
	color: var(--f-green);
	margin: 0 0 8px;
	font-size: 1.4rem;
}
.aahc-f-success-msg { margin: 0; color: var(--f-ink-soft); }

/* ---- FAQ (sits under the estimate card, same right-hand column on desktop) ---- */
.aahc-f-faq {
	background: var(--f-white);
	border: 1px solid var(--f-line);
	border-radius: 12px;
	padding: 20px 22px;
}
.aahc-f-faq h4 {
	font-family: var(--wp--preset--font-family--heading);
	margin: 0 0 4px;
	font-size: 1.05rem;
	color: var(--f-green);
}
.aahc-f-faq details { border-top: 1px solid var(--f-line); padding: 11px 0; }
.aahc-f-faq details:first-of-type { border-top: none; }
.aahc-f-faq summary {
	cursor: pointer;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--f-ink);
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}
.aahc-f-faq summary::-webkit-details-marker { display: none; }
.aahc-f-faq summary::after {
	content: '+';
	flex: none;
	font-size: 1.15rem;
	line-height: 1;
	color: var(--f-gold);
	transition: transform .15s;
}
.aahc-f-faq details[open] summary::after { transform: rotate(45deg); }
.aahc-f-faq p { margin: 8px 0 0; font-size: 0.86rem; color: var(--f-ink-soft); line-height: 1.5; }

@media (max-width: 860px) {
	.aahc-form-grid {
		grid-template-columns: 1fr;
		/* FAQ stays right under the estimate card, same as desktop — not at the
		   very bottom of the page after the whole form. */
		grid-template-areas: "sidebar" "main";
	}
	.aahc-form-sidebar {
		position: static;
		max-height: none;
		overflow-y: visible;
	}
	.aahc-f-row { grid-template-columns: 1fr 1fr; }
	.aahc-f-checks { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
	.aahc-f-row { grid-template-columns: 1fr; }
}

/* ============================================================= *
 * Icons + desktop polish
 * ============================================================= */

.aahc-form .aahc-f-ico { flex: none; display: block; }

.aahc-f-section {
	padding: 24px 26px;
	border-radius: 14px;
}
.aahc-f-section h3 { font-size: 1.22rem; margin-bottom: 16px; }

/* service tiles: icon-forward cards, evenly filling the row and wrapping
   cleanly at any tile count (was a grid hardcoded to 4 columns; also never
   actually applied its flex layout since .aahc-f-card-lg was missing
   `display: flex`, which left the icon and label stacked with default inline
   flow instead of a centred column). */
.aahc-f-section .aahc-f-cards:has(.aahc-f-card-lg) {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
.aahc-f-card-lg {
	display: flex;
	flex: 1 1 150px;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 8px;
	padding: 16px 10px;
	font-size: 0.9rem;
	line-height: 1.25;
}
.aahc-f-card-lg .aahc-f-ico { color: var(--f-green); width: 28px; height: 28px; transition: color .12s; }
.aahc-f-card-lg:has(input:checked) .aahc-f-ico { color: var(--f-cream); }

/* frequency stays as inline pills */
.aahc-f-section .aahc-f-cards:not(:has(.aahc-f-card-lg)) .aahc-f-card { padding: 10px 16px; }

/* add-on checks with icon */
.aahc-f-checks { gap: 10px 14px; }
.aahc-f-check {
	padding: 12px 14px;
	gap: 10px;
	align-items: center;
}
.aahc-f-check .aahc-f-ico { color: var(--f-green); width: 22px; height: 22px; }
.aahc-f-check:has(input:checked) { border-color: var(--f-green); background: var(--f-white); box-shadow: inset 0 0 0 1px var(--f-green); }

/* summary card a touch bigger + framed */
.aahc-f-summary-inner { padding: 26px; box-shadow: 0 10px 40px -12px rgba(31, 42, 32, .35); }
.aahc-f-total-value { font-size: 2rem; }

@media (max-width: 560px) {
	.aahc-f-section { padding: 20px 18px; }
	.aahc-f-check .aahc-f-ico { width: 20px; height: 20px; }
	/* below ~2 tiles per row a 150px basis reads cramped — let each service
	   tile take the full row instead of squeezing side by side. */
	.aahc-f-card-lg { flex-basis: 100%; }
}
