/**
 * Carrington intake form.
 *
 * Reads the site's existing design tokens (--ink, --gold, --color-divider…)
 * with literal fallbacks so the form still renders correctly if it is dropped
 * onto a page where the Bricks variables are not present.
 */

.clg-intake {
	--clg-ink: var(--ink, #080808);
	--clg-gold: var(--gold, #B58F3A);
	--clg-gold-deep: var(--gold-deep, #8A6D2E);
	--clg-mgray: var(--mgray, #737373);
	--clg-dgray: var(--dgray, #3A3A3A);
	--clg-divider: var(--color-divider, #E5E5E5);
	--clg-offwhite: var(--offwhite, #F7F7F5);
	--clg-body: var(--font-body, "Archivo", system-ui, sans-serif);
	--clg-display: var(--font-display, "Playfair Display", Georgia, serif);

	font-family: var(--clg-body);
	color: var(--clg-ink);
	max-width: 760px;
	margin: 0 auto;
}

/* ---- Head ---- */

.clg-intake__title {
	font-family: var(--clg-display);
	font-weight: 500;
	font-size: 36px;
	line-height: 1.08;
	margin: 0 0 12px;
}

.clg-intake__subtitle {
	font-size: 15px;
	line-height: 1.55;
	color: var(--clg-dgray);
	margin: 0 0 32px;
}

/* ---- Progress ---- */

.clg-intake__progress {
	margin: 0 0 36px;
}

.clg-intake__progress-track {
	height: 3px;
	background: var(--clg-divider);
	border-radius: 2px;
	overflow: hidden;
	margin-bottom: 10px;
}

.clg-intake__progress-fill {
	height: 100%;
	width: 0%;
	background: var(--clg-gold);
	border-radius: 2px;
	transition: width 0.35s cubic-bezier(.2, .62, .22, 1);
}

.clg-intake__progress-label {
	margin: 0;
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--clg-mgray);
}

/* ---- Steps ---- */

.clg-intake__step {
	border: 0;
	padding: 0;
	margin: 0;
	display: none;
}

.clg-intake__step.is-active {
	display: block;
}

@media (prefers-reduced-motion: no-preference) {
	.clg-intake__step.is-active {
		animation: clg-step-in 0.4s cubic-bezier(.2, .62, .22, 1);
	}
}

@keyframes clg-step-in {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.clg-intake__legend {
	font-family: var(--clg-display);
	font-weight: 500;
	font-size: 26px;
	line-height: 1.2;
	margin: 0 0 22px;
	padding: 0;
	display: block;
}

.clg-intake__note {
	font-size: 15px;
	line-height: 1.55;
	color: var(--clg-dgray);
	margin: 0;
}

/* ---- Fields ---- */

.clg-intake__field {
	margin-bottom: 24px;
}

/* First name / last name side by side on the contact step. */
.clg-intake__row {
	display: flex;
	gap: 16px;
}

.clg-intake__row .clg-intake__field {
	flex: 1;
	min-width: 0;
}

@media (max-width: 480px) {
	.clg-intake__row {
		flex-direction: column;
		gap: 0;
	}
}

.clg-intake__label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 8px;
}

.clg-intake__req {
	color: var(--clg-gold-deep);
}

.clg-intake__input {
	width: 100%;
	font-family: inherit;
	font-size: 14px;
	color: var(--clg-ink);
	background: #fff;
	border: 1px solid var(--clg-divider);
	border-radius: 0;
	padding: 10px 12px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* A field alone on its own step gets a slightly bigger control — this is the
   question the visitor is looking at, nothing else competing. Still smaller
   on desktop than a full-width mobile screen calls for; see the phone-only
   override further down. */
.clg-intake__input--step {
	font-size: 15px;
	padding: 13px 15px;
}

.clg-intake__input:hover {
	border-color: color-mix(in srgb, var(--clg-ink) 45%, transparent);
}

.clg-intake__input:focus {
	outline: none;
	border-color: var(--clg-ink);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--clg-gold) 22%, transparent);
}

textarea.clg-intake__input {
	resize: vertical;
	min-height: 110px;
}

/* ---- Radio choices ---- */

.clg-intake__choices {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.clg-intake__choice {
	position: relative;
	cursor: pointer;
}

.clg-intake__choice input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.clg-intake__choice span {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 13px 20px;
	border: 1px solid var(--clg-divider);
	font-size: 14px;
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.clg-intake__choice-icon {
	font-size: 15px;
	color: var(--clg-gold-deep);
	transition: color 0.15s ease;
}

.clg-intake__choice:hover span {
	background: var(--clg-offwhite);
	border-color: color-mix(in srgb, var(--clg-ink) 35%, transparent);
}

.clg-intake__choice input:checked + span {
	border-color: var(--clg-ink);
	background: var(--clg-ink);
	color: #fff;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--clg-gold) 30%, transparent);
}

.clg-intake__choice input:checked + span .clg-intake__choice-icon {
	color: var(--clg-gold);
}

.clg-intake__choice:active span {
	transform: scale(0.97);
}

.clg-intake__choice input:focus-visible + span {
	outline: 2px solid var(--clg-gold);
	outline-offset: 2px;
}

/* Detail steps show one question at a time — larger tap targets read as more
   deliberate and are easier to hit on mobile, which matters most here. */
.clg-intake__field:has(.clg-intake__legend) .clg-intake__choice span {
	padding: 15px 22px;
	font-size: 15px;
}

@media (prefers-reduced-motion: reduce) {
	.clg-intake__choice:active span {
		transform: none;
	}
}

/* ---- Disclaimer + consent ---- */

.clg-intake__disclaimer {
	font-size: 13px;
	line-height: 1.7;
	color: var(--clg-mgray);
	background: var(--clg-offwhite);
	border-left: 2px solid var(--clg-gold);
	padding: 14px 16px;
	margin: 28px 0 20px;
}

.clg-intake__consent {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	font-size: 13px;
	line-height: 1.6;
	color: var(--clg-dgray);
	cursor: pointer;
}

.clg-intake__consent a {
	color: var(--clg-ink);
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.clg-intake__consent a:hover {
	color: var(--clg-gold-deep);
}

.clg-intake__consent input {
	margin-top: 3px;
	flex: none;
	width: 16px;
	height: 16px;
	accent-color: var(--clg-ink);
}

/* ---- Honeypot: off-screen, never display:none (bots skip hidden fields) ---- */

.clg-intake__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---- Errors ---- */

.clg-intake__error {
	margin: 20px 0 0;
	padding: 12px 14px;
	border-left: 2px solid #B3261E;
	background: #FDF4F3;
	color: #7A1C15;
	font-size: 14px;
}

@media (prefers-reduced-motion: no-preference) {
	.clg-intake__error:not([hidden]) {
		animation: clg-step-in 0.3s ease;
	}
}

.clg-intake__field.has-error .clg-intake__input {
	border-color: #B3261E;
}

/* ---- Actions ---- */

.clg-intake__actions {
	display: flex;
	gap: 12px;
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid var(--clg-divider);
}

.clg-intake__btn {
	font-family: var(--clg-body);
	font-weight: 800;
	font-size: 15px;
	padding: 15px 26px;
	border: 1px solid var(--clg-ink);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

/* display:inline-flex above has the same specificity as the browser's default
   [hidden] { display: none; }, and an author rule wins that tie — so without
   this, every hidden button (Back on step 1, Continue on the last step,
   Submit on every step except the last) stayed visible the whole time. */
.clg-intake__btn[hidden] {
	display: none;
}

.clg-intake__spinner {
	display: none;
	width: 14px;
	height: 14px;
	margin-right: 9px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: clg-spin 0.7s linear infinite;
}

@keyframes clg-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.clg-intake__spinner {
		animation-duration: 1.4s;
	}
}

/* While a submission is in flight: dim the step, block interaction with it,
   and show the spinner — the visitor can't edit answers or go back until the
   request finishes, so there's no way to end up submitting twice. */
.clg-intake--submitting .clg-intake__step.is-active {
	opacity: 0.5;
	pointer-events: none;
}

.clg-intake--submitting .clg-intake__spinner {
	display: inline-block;
}

.clg-intake--submitting .clg-intake__btn--back {
	opacity: 0.4;
	pointer-events: none;
}

.clg-intake__btn--primary {
	background: var(--clg-ink);
	color: #fff;
	flex: 1 1 auto;
}

.clg-intake__btn--primary:hover {
	background: var(--charcoal, #222);
	border-color: var(--charcoal, #222);
	transform: translateY(-2px);
}

/* Deliberately small and quiet — this is "go back", not a decision the
   visitor should weigh against Continue/submit. */
.clg-intake__btn--back {
	flex: none;
	width: 44px;
	height: 44px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
	font-weight: 400;
	color: var(--clg-mgray);
	background: transparent;
	border-color: var(--clg-divider);
}

.clg-intake__btn--back:hover {
	color: var(--clg-ink);
	border-color: var(--clg-ink);
	background: var(--clg-offwhite);
	transform: none;
}

.clg-intake__btn:focus-visible {
	outline: 2px solid var(--clg-gold);
	outline-offset: 2px;
}

.clg-intake__btn[disabled] {
	opacity: 0.55;
	cursor: not-allowed;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.clg-intake__btn:hover {
		transform: none;
	}
}

/* ---- Success ---- */

.clg-intake__success-icon {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--clg-ink);
	color: var(--clg-gold);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	margin-bottom: 20px;
}

@media (prefers-reduced-motion: no-preference) {
	.clg-intake__success-icon {
		animation: clg-success-pop 0.5s cubic-bezier(.2, .8, .3, 1.2);
	}
}

@keyframes clg-success-pop {
	from {
		opacity: 0;
		transform: scale(0.6);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.clg-intake__success h2 {
	font-family: var(--clg-display);
	font-weight: 500;
	font-size: 30px;
	line-height: 1.1;
	margin: 0 0 14px;
}

.clg-intake__success p {
	font-size: 15px;
	line-height: 1.6;
	color: var(--clg-dgray);
	margin: 0;
}

/* ---- Focus mode: header/footer fade away once the visitor starts answering,
   so attention narrows to the form. Restored the moment they're back on the
   first question. Uses the same fade-then-collapse pattern as the mobile menu
   elsewhere on the site — display can't transition, so JS adds/removes this
   class first, then flips display after the transition finishes. ---- */

#brx-header,
#brx-footer {
	transition: opacity 0.3s ease, transform 0.3s ease;
}

#brx-header.clg-intake-hide {
	opacity: 0;
	transform: translateY(-12px);
	pointer-events: none;
}

#brx-footer.clg-intake-hide {
	opacity: 0;
	transform: translateY(12px);
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	#brx-header,
	#brx-footer {
		transition: opacity 0.01s linear;
	}
	#brx-header.clg-intake-hide,
	#brx-footer.clg-intake-hide {
		transform: none;
	}
}

/* ---- Mobile: matches the site's 920px collapse ---- */

@media (max-width: 920px) {
	.clg-intake__title { font-size: 28px; }
	.clg-intake__legend { font-size: 21px; }
	.clg-intake__actions { flex-wrap: wrap; }
	.clg-intake__btn--primary { flex: 1 1 auto; }
}

/* Phones only (not tablets): every choice takes its own full-width row
   instead of wrapping several per line — easier to scan and tap. Text/date
   inputs stay compact — 16px is a hard floor, not a style choice: iOS Safari
   zooms the whole page in on focus for any input under 16px, which is worse
   than a slightly larger box, but padding is trimmed down to keep them small. */
@media (max-width: 600px) {
	.clg-intake__choices {
		flex-direction: column;
		align-items: stretch;
	}

	.clg-intake__choice span {
		width: 100%;
		box-sizing: border-box;
	}

	.clg-intake__input {
		font-size: 16px;
		padding: 2px 12px;
	}

	.clg-intake__input--step {
		font-size: 16px;
		padding: 11px 13px;
	}

	/* The contact step packs 4-5 fields onto one screen (unlike the single-
	   question steps), so it needs tighter vertical rhythm to stay compact. */
	.clg-intake__field {
		margin-bottom: 12px;
	}

	textarea.clg-intake__input {
		min-height: 70px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.clg-intake * { transition: none !important; animation: none !important; }
}
