/* Clarity Flow. Neutral by default: fonts come from the theme, colours from the variables below. */
.cflow,
.cflow-start {
	--cf-accent: #111111;
	--cf-on-accent: #ffffff;
	--cf-bg: #ffffff;
	--cf-ink: #16181d;
	--cf-muted: #5f6672;
	--cf-line: #cfd3da;
	--cf-soft: #f2f3f5;
	--cf-error: #b3261e;
	--cf-radius: 6px;
}
/* Secondary text and soft fills follow the chosen text and background colours. */
@supports (color: color-mix(in srgb, red, blue)) {
	.cflow,
	.cflow-start {
		--cf-muted: color-mix(in srgb, var(--cf-ink) 68%, var(--cf-bg));
		--cf-soft: color-mix(in srgb, var(--cf-ink) 7%, var(--cf-bg));
	}
}

.cflow {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 460px;
	background: var(--cf-bg);
	color: var(--cf-ink);
	font-size: 18px;
	line-height: 1.5;
	text-align: left;
}
.cflow *,
.cflow-start * {
	box-sizing: border-box;
}

.cflow--fullscreen {
	position: fixed;
	inset: 0;
	z-index: 100000;
	min-height: 0;
	height: 100vh;
	height: 100dvh;
	overflow-y: auto;
}
html.cflow-open,
html.cflow-open body {
	overflow: hidden;
}

.cflow [hidden] {
	display: none !important;
}

/* Progress bar and close link */
.cflow__top {
	position: sticky;
	top: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 20px;
	background: var(--cf-bg);
}
.cflow__bar {
	flex: 1;
	height: 4px;
	border-radius: 2px;
	background: var(--cf-soft);
	overflow: hidden;
}
.cflow__bar i {
	display: block;
	width: 0;
	height: 100%;
	background: var(--cf-accent);
	transition: width 0.3s ease;
}
.cflow__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	color: var(--cf-muted);
	font-size: 28px;
	line-height: 1;
	text-decoration: none;
}
.cflow__close:hover {
	background: var(--cf-soft);
	color: var(--cf-ink);
}

/* One screen */
.cflow__stage {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 20px 64px;
}
.cflow__step {
	width: 100%;
	max-width: 640px;
	margin: 0;
	animation: cflow-in 0.28s ease both;
}
.cflow__step--split {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 40px;
	align-items: center;
	max-width: 880px;
}
.cflow__main {
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-width: 0;
}
@keyframes cflow-in {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}

.cflow__count {
	margin: 0;
	color: var(--cf-muted);
	font-size: 14px;
	letter-spacing: 0.02em;
}
.cflow .cflow__q {
	margin: 0;
	padding: 0;
	color: var(--cf-ink);
	font-size: clamp(26px, 4.2vw, 38px);
	line-height: 1.15;
	text-wrap: balance;
	overflow-wrap: anywhere;
}
.cflow__q:focus {
	outline: none;
}
.cflow__body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 8px;
}

/* Text inputs */
.cflow__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.cflow__label {
	margin: 0;
	color: var(--cf-ink);
	font-size: 16px;
	font-weight: 600;
}
.cflow .cflow__input {
	width: 100%;
	min-height: 56px;
	margin: 0;
	padding: 12px 16px;
	border: 1px solid var(--cf-line);
	border-radius: var(--cf-radius);
	background: var(--cf-bg);
	color: var(--cf-ink);
	font: inherit;
	font-size: 18px; /* 16px or more stops iPhones zooming in on focus */
	box-shadow: none;
}
.cflow textarea.cflow__input {
	min-height: 140px;
	line-height: 1.5;
	resize: vertical;
}
.cflow .cflow__input:focus {
	border-color: var(--cf-accent);
	outline: 2px solid var(--cf-accent);
	outline-offset: 1px;
}
.cflow .cflow__input[aria-invalid="true"] {
	border-color: var(--cf-error);
}

/* Tap-to-choose answers */
.cflow__options {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}
.cflow__options--compact {
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.cflow__options--tight {
	grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
}
.cflow .cflow__options--tight .cflow__option {
	padding: 12px 4px;
	text-align: center;
}
.cflow .cflow__option {
	min-height: 56px;
	margin: 0;
	padding: 12px 16px;
	border: 1px solid var(--cf-line);
	border-radius: var(--cf-radius);
	background: var(--cf-bg);
	color: var(--cf-ink);
	font: inherit;
	font-size: 17px;
	font-weight: 500;
	text-align: left;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.cflow .cflow__option:hover {
	border-color: var(--cf-accent);
}
.cflow .cflow__option[aria-pressed="true"] {
	border-color: var(--cf-accent);
	background: var(--cf-accent);
	color: var(--cf-on-accent);
}

/* Tick box under an answer */
.cflow__tick {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	margin: 0;
	color: var(--cf-ink);
	font-size: 17px;
	font-weight: 400;
	cursor: pointer;
}
.cflow .cflow__tick input {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	margin: 0;
	accent-color: var(--cf-accent);
	cursor: pointer;
}

.cflow__help {
	margin: 0;
	color: var(--cf-muted);
	font-size: 15px;
}
.cflow__help a,
.cflow__done-link {
	color: var(--cf-ink);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.cflow__error {
	margin: 0;
	color: var(--cf-error);
	font-size: 15px;
	font-weight: 600;
}
.cflow__error:empty {
	display: none;
}

/* Back and Next */
.cflow__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 8px;
}
.cflow .cflow__next,
.cflow-start .cflow-start__button {
	min-height: 52px;
	margin: 0;
	padding: 12px 24px;
	border: 1px solid var(--cf-accent);
	border-radius: var(--cf-radius);
	background: var(--cf-accent);
	color: var(--cf-on-accent);
	font: inherit;
	font-size: 17px;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
}
.cflow .cflow__next {
	margin-left: auto;
}
.cflow .cflow__next:disabled {
	opacity: 0.6;
	cursor: default;
}
.cflow .cflow__back {
	min-height: 52px;
	margin: 0;
	padding: 12px 8px;
	border: 0;
	background: none;
	color: var(--cf-muted);
	font: inherit;
	font-size: 16px;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
}
.cflow .cflow__back:hover {
	color: var(--cf-ink);
}
.cflow button:focus-visible,
.cflow a:focus-visible,
.cflow-start button:focus-visible {
	outline: 2px solid var(--cf-accent);
	outline-offset: 2px;
}

/* Agent beside the contact questions */
.cflow__agent {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.cflow__agent-photo {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	border-radius: var(--cf-radius);
	object-fit: cover;
	background: var(--cf-soft);
}
.cflow__agent-photo--blank {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--cf-muted);
	font-size: 64px;
	font-weight: 600;
}
.cflow__agent-caption,
.cflow__agent-name {
	margin: 0;
}
.cflow__agent-caption {
	font-size: 16px;
}
.cflow__agent-name {
	color: var(--cf-muted);
	font-size: 14px;
}

/* Confirmation */
.cflow__done-body {
	margin: 0;
	font-size: 19px;
}

/* Honeypot: off-screen, not display:none, so bots still fill it */
.cflow__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.cflow-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

/* Address starter for the hero */
.cflow-start {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	max-width: 640px;
}
.cflow-start .cflow-start__input {
	flex: 1 1 240px;
	min-width: 0;
	min-height: 52px;
	margin: 0;
	padding: 12px 16px;
	border: 1px solid var(--cf-line);
	border-radius: var(--cf-radius);
	background: var(--cf-bg);
	color: var(--cf-ink);
	font: inherit;
	font-size: 17px;
}
.cflow .cflow__input::placeholder,
.cflow-start .cflow-start__input::placeholder {
	color: var(--cf-muted);
	opacity: 1;
}
.cflow-start .cflow-start__input:focus {
	border-color: var(--cf-accent);
	outline: 2px solid var(--cf-accent);
	outline-offset: 1px;
}
.cflow-start .cflow-start__button {
	flex: 0 0 auto;
}

/* Phones */
@media (max-width: 700px) {
	.cflow__stage {
		align-items: flex-start;
		padding: 16px 20px 48px;
	}
	.cflow__step--split {
		grid-template-columns: 1fr;
		gap: 20px;
	}
	.cflow__agent {
		flex-direction: row;
		align-items: center;
	}
	.cflow__agent-photo {
		width: 56px;
		flex: 0 0 56px;
		border-radius: 50%;
	}
	.cflow__agent-photo--blank {
		font-size: 24px;
	}
	.cflow__agent-caption {
		font-size: 15px;
	}
	.cflow-start .cflow-start__button {
		flex: 1 1 100%;
	}
}
@media (max-width: 420px) {
	.cflow__options:not(.cflow__options--compact):not(.cflow__options--tight) {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cflow__step { animation: none; }
	.cflow__bar i { transition: none; }
}
