/* ==========================================================================
   Ealan V3 — 08 / Start a conversation: multi-step qualifying form (V2, dark via tokens).
   Loaded after v3.css; reuses its tokens (--paper, --ink, --accent, --line, v3-btn,
   v3-chip, v3-label, v3-h2, v3-lead) and adds the contact grid + form-specific pieces.
   ========================================================================== */

/* ---------- Layout: aside + card ---------- */
.v3-contact__grid {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: clamp(28px, 5vw, 72px);
	align-items: start;
}

.v3-contact__aside {
	display: flex;
	flex-direction: column;
	gap: clamp(14px, 2vh, 22px);
	position: sticky;
	top: calc(var(--header-h) + clamp(16px, 4vh, 48px));
}

.v3-contact__response {
	color: var(--ink-3);
}

.v3-contact__aside .v3-h2 {
	font-size: clamp(2rem, min(1rem + 3.4vw, 8vh), 4.75rem);
}

.v3-contact__card {
	background: var(--paper-2);
	border: 1px solid var(--line-strong);
	padding: clamp(20px, 3vw, 36px);
}

/* ---------- Alert / progress ---------- */
.v3-form__alert {
	margin-bottom: 16px;
	padding: 12px 14px;
	border: 1px solid var(--err);
	color: var(--err);
	background: rgba(255, 122, 112, 0.08);
	font-size: 0.9rem;
}

.v3-form__progress {
	margin-bottom: clamp(16px, 2.5vh, 24px);
}

.v3-form__progress-count {
	color: var(--ink-3);
	margin-bottom: 8px;
}

.v3-form__bar {
	height: 3px;
	background: var(--line);
}

.v3-form__bar-fill {
	display: block;
	height: 100%;
	background: var(--accent-deep);
	transition: width 280ms var(--ease);
}

/* ---------- Steps ---------- */
.v3-form__steps {
	position: relative;
}

.v3-step {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: clamp(14px, 2vh, 18px);
}

.v3-step__heading {
	font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.5rem);
	line-height: 1.2;
}

.v3-step__heading:focus-visible,
.v3-step__heading:focus {
	outline: none; /* programmatic focus target: no visible ring needed, it isn't interactive */
}

@keyframes v3StepIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.v3-step--anim {
	animation: v3StepIn 320ms var(--ease);
}

.v3-step__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 4px;
}

.v3-step__nav .v3-btn--ghost {
	border-color: transparent;
	padding-inline: 8px;
}

.v3-step__nav .v3-btn--ghost:hover {
	background: transparent;
	color: var(--accent-deep);
}

.v3-step__nav .icon {
	width: 16px;
	height: 16px;
}

/* ---------- Path picker (step 1) ---------- */
.v3-path-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 12px;
}

.v3-path-card {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 18px 16px;
	border: 1px solid var(--line-strong);
	background: var(--paper);
	cursor: pointer;
	transition: border-color 200ms var(--ease), background 200ms var(--ease);
}

.v3-path-card__input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.v3-path-card__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
}

.v3-path-card__title {
	font-family: var(--font-display);
	font-weight: 700;
	color: var(--ink);
	font-size: 1rem;
}

.v3-path-card__sub {
	font-size: 0.85rem;
	color: var(--ink-3);
}

.v3-path-card__arrow .icon {
	width: 18px;
	height: 18px;
	transition: transform 200ms var(--ease);
}

.v3-path-card:hover {
	border-color: var(--ink);
}

.v3-path-card:hover .v3-path-card__arrow .icon {
	transform: translate(2px, 2px);
}

.v3-path-card:has(.v3-path-card__input:checked) {
	border-color: var(--ink);
	background: var(--ink);
}

.v3-path-card:has(.v3-path-card__input:checked) .v3-path-card__title,
.v3-path-card:has(.v3-path-card__input:checked) .v3-path-card__sub {
	color: var(--paper);
}

.v3-path-card:has(.v3-path-card__input:checked) .icon {
	color: var(--accent);
}

.v3-path-card:focus-within {
	outline: 2px solid var(--ink);
	outline-offset: 3px;
}

/* ---------- Fields ---------- */
.v3-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.v3-field__label {
	font-family: var(--font-mono);
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ink-3);
}

.v3-input,
.v3-select,
.v3-textarea {
	width: 100%;
	border: 1px solid var(--line-strong);
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 0.95rem;
	padding: 12px 14px;
	border-radius: 0;
	transition: border-color 160ms var(--ease);
}

.v3-select {
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
	background-position: calc(100% - 20px) center, calc(100% - 15px) center;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
}

.v3-textarea {
	resize: vertical;
	min-height: 84px;
}

.v3-input:focus-visible,
.v3-select:focus-visible,
.v3-textarea:focus-visible,
.v3-file:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 2px;
}

.v3-field__counter {
	align-self: flex-end;
	font-family: var(--font-mono);
	font-size: 0.7rem;
	color: var(--ink-3);
}

.v3-field__help {
	font-size: 0.78rem;
	color: var(--ink-3);
}

.v3-field__error {
	font-family: var(--font-mono);
	font-size: 0.75rem;
	color: var(--err);
}

.v3-field.has-error .v3-input,
.v3-field.has-error .v3-select,
.v3-field.has-error .v3-textarea,
.v3-field.has-error .v3-file {
	border-color: var(--err);
}

/* ---------- Chips (radio groups) ---------- */
.v3-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.v3-chip-option {
	position: relative;
	display: inline-flex;
	cursor: pointer;
}

.v3-chip-option__input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.v3-chip-option__input:checked + .v3-chip {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--paper);
}

.v3-chip-option__input:focus-visible + .v3-chip {
	outline: 2px solid var(--ink);
	outline-offset: 2px;
}

.v3-field.has-error .v3-chip {
	border-color: var(--err);
}

/* ---------- Consent ---------- */
.v3-field--consent .v3-field__checkbox {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 0.85rem;
	color: var(--ink-2);
	cursor: pointer;
}

.v3-field--consent input[type='checkbox'] {
	margin-top: 3px;
	width: 16px;
	height: 16px;
	flex: none;
	accent-color: var(--accent);
}

.v3-field--consent a {
	border-bottom: 1px solid currentColor;
}

.v3-field__required-note {
	color: var(--ink-3);
	font-size: 0.7rem;
}

/* ---------- Success ---------- */
.v3-form__success {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 18px;
	padding: clamp(20px, 3vw, 36px);
	background: var(--paper-2);
	border: 1px solid var(--line-strong);
}

.v3-form__success p {
	font-family: var(--font-display);
	font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem);
	color: var(--ink);
	font-weight: 700;
}

/* ---------- Fit: on desktop the tallest step must fit under the fixed header ---------- */
@media (min-width: 1024px) and (min-height: 680px) {
	.v3-contact.v3-screen {
		padding-top: calc(var(--header-h) + clamp(10px, 2vh, 20px));
		padding-bottom: clamp(10px, 2vh, 20px);
	}

	.v3-contact__grid {
		max-height: calc(100svh - var(--header-h) - clamp(20px, 4vh, 40px));
	}

	.v3-contact__card {
		max-height: calc(100svh - var(--header-h) - clamp(20px, 4vh, 40px));
		overflow-y: auto;
		padding: clamp(18px, 2.2vw, 28px);
	}

	.v3-step {
		gap: 10px;
	}

	.v3-field {
		gap: 4px;
	}

	.v3-textarea {
		min-height: 64px;
	}
}

/* ---------- Mobile: stack, no height constraint ---------- */
@media (max-width: 1023.98px) {
	.v3-contact__grid {
		grid-template-columns: 1fr;
	}

	.v3-contact__aside {
		position: static;
	}

	.v3-contact.v3-screen {
		min-height: 0;
	}
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.v3-step--anim {
		animation: none !important;
	}

	.v3-form__bar-fill,
	.v3-path-card,
	.v3-input,
	.v3-select,
	.v3-textarea {
		transition: none !important;
	}
}

/* ---------- Landing page (template-landing.php): one screen, 50/50 ----------
   Left: the Start a conversation content (h1, grow text, reply time, the 3D object).
   Right: the Grow my business form alone. Stacks on small screens. */
.v3-landing__title {
	font-size: clamp(2.25rem, min(1rem + 3.6vw, 8.5vh), 5.25rem);
	text-wrap: balance;
}

.v3-landing__legal {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
	padding: 16px var(--gutter) 20px;
	font-size: 0.6875rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ink-3);
}

.v3-landing__legal a,
.v3-landing__legal button {
	color: inherit;
	text-transform: inherit;
	letter-spacing: inherit;
	font: inherit;
}

.v3-landing__legal a:hover,
.v3-landing__legal button:hover {
	color: var(--ink);
}

@media (min-width: 1024px) {
	.v3-landing .v3-contact__grid {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		align-items: center;
		width: 100%;
	}

	.v3-landing .v3-contact__aside {
		position: static;
		max-width: 38rem;
	}
}

@media (min-width: 1024px) and (min-height: 620px) {
	.v3-landing.v3-screen {
		height: 100svh;
		min-height: 0;
		justify-content: center;
		padding-bottom: 48px; /* room for the legal line */
	}

	.v3-landing__legal {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 5;
		padding-block: 14px;
	}
}

/* The grow text already ends with the reply time. */
.v3-landing .v3-contact__response {
	display: none;
}

/* Small screens: the form comes right after the text (no 3D object in between). */
@media (max-width: 1023.98px) {
	.v3-landing .v3-contact__slot {
		display: none;
	}
}
