/* =========================================================
   Step form (components/step-form.php + js/step-form.js)
   Moved out of template-meta-intake.php so the same form can run on
   any page. Everything is scoped to .vlm, so theme styles can't leak
   in and these can't leak out. The form's root carries .vlm itself.
   ========================================================= */

/* =========================================================
   Tokens (from the theme: Syne, charcoal + yellow)
   ========================================================= */
.vlm {
	--vlm-yellow: #ffb800;
	--vlm-yellow-wash: #fffaf0;
	--vlm-black: #181f20;      /* grey-black */
	--vlm-dark: #1e2425;       /* grey-dark */
	--vlm-grey: #2a373b;       /* grey */
	--vlm-lightest: #f9f9f9;   /* grey-lightest */
	--vlm-light: #efefef;      /* grey-light */
	--vlm-line: #e4e4e4;
	--vlm-medium: #d8d8d8;     /* grey-medium */
	--vlm-text: #181f20;
	--vlm-text-muted: #6b6560; /* gray-text */
	--vlm-text-alt: #555555;
	--vlm-on-dark: rgba(255, 255, 255, 0.72);
	--vlm-on-dark-dim: rgba(255, 255, 255, 0.5);
	--vlm-error: #d11a1a;

	--vlm-font: "Syne", system-ui, -apple-system, "Segoe UI", sans-serif;
	--vlm-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	--vlm-radius-btn: 4px;
	--vlm-radius-input: 8px;
	--vlm-radius-tile: 10px;
	--vlm-radius-card: 14px;

	--vlm-gutter: 16px;
	--vlm-section: 48px;
	--vlm-wrap: 1312px;
}
@media (min-width: 768px) { .vlm { --vlm-gutter: 32px; --vlm-section: 72px; } }
@media (min-width: 1100px) { .vlm { --vlm-gutter: 64px; --vlm-section: 96px; } }

/* ---------- Base (scoped to .vlm) ---------- */
.vlm *, .vlm *::before, .vlm *::after { box-sizing: border-box; }
:where(.vlm) p { margin: 0; color: inherit; font-size: inherit; line-height: inherit; }
:where(.vlm) :is(h1, h2, h3) { margin: 0; font-family: var(--vlm-font); font-weight: 600; }
:where(.vlm) img { max-width: 100%; height: auto; display: block; }
:where(.vlm) a { color: inherit; }
:where(.vlm) button { font-family: inherit; }
.vlm :focus-visible { outline: 3px solid rgba(255, 184, 0, 0.6); outline-offset: 2px; }

/* ---------- Helpers ---------- */
.vlm-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.vlm-hp { position: absolute; left: -9999px; }

.vlm-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.vlm-icon-yellow { stroke: var(--vlm-yellow); }

/* =========================================================
   Step form
   ========================================================= */
.vlm-card-form {
	width: 100%; max-width: 480px; min-height: 600px;
	display: flex; flex-direction: column; gap: 14px;
	padding: 20px 24px;
	background: #fff; color: var(--vlm-text);
	border-top: 3px solid var(--vlm-yellow);
	border-radius: var(--vlm-radius-card);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
	overflow: hidden;
	scroll-margin-top: 16px;
}
.vlm-form-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.vlm-form-top-left { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.vlm-step-label { font-size: 11px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--vlm-text-muted); }
.vlm-secure { display: flex; align-items: center; gap: 6px; flex-shrink: 0; font-size: 11px; font-weight: 600; line-height: 1.25; color: var(--vlm-text-muted); }
.vlm-secure .vlm-icon { width: 14px; height: 14px; }
.vlm-back-btn {
	display: flex; align-items: center; justify-content: center;
	width: 32px; height: 32px; padding: 0;
	border: 1.5px solid var(--vlm-line); border-radius: 9999px; background: #fff; color: var(--vlm-text);
	cursor: pointer; transition: border-color 0.2s;
}
.vlm-back-btn:hover { border-color: var(--vlm-yellow); }
.vlm-back-btn .vlm-icon { width: 16px; height: 16px; }
.vlm-back-btn[hidden] { display: none; }

.vlm-progress { height: 4px; background: var(--vlm-light); border-radius: 9999px; overflow: hidden; flex-shrink: 0; }
.vlm-progress-bar { width: 25%; height: 100%; background: var(--vlm-yellow); border-radius: 9999px; transition: width 0.55s var(--vlm-ease); }

.vlm-steps { flex-grow: 1; padding-top: 6px; }
.vlm-step { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.vlm-step[hidden] { display: none; }
.vlm-step.vlm-enter-fwd { animation: vlm-stepIn 0.45s var(--vlm-ease) both; }
.vlm-step.vlm-enter-back { animation: vlm-stepBack 0.45s var(--vlm-ease) both; }

.vlm .vlm-q { padding: 0; font-size: 24px; font-weight: 600; line-height: 1.18; color: var(--vlm-text); outline: none; }
.vlm .vlm-q-sub { margin-top: -8px; font-size: 14px; line-height: 1.5; color: var(--vlm-text-muted); }

/* Tiles + rows */
.vlm-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.vlm-tile, .vlm-row {
	border: 1.5px solid var(--vlm-line); background: #fff; color: var(--vlm-text);
	font-weight: 600; text-align: left; cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.15s;
	animation: vlm-rise 0.45s var(--vlm-ease) both;
}
.vlm-tile {
	display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 12px;
	min-height: 92px; padding: 14px; border-radius: var(--vlm-radius-tile);
	font-size: 14px; line-height: 1.25;
}
.vlm-tile .vlm-icon { width: 26px; height: 26px; stroke-width: 1.75; transition: color 0.2s, transform 0.3s; }
.vlm-row {
	display: flex; align-items: center; gap: 12px;
	width: 100%; min-height: 52px; padding: 0 16px; border-radius: var(--vlm-radius-tile);
	font-size: 15px;
}
.vlm-rows { display: flex; flex-direction: column; gap: 8px; }
.vlm-dot { width: 18px; height: 18px; border-radius: 9999px; border: 1.5px solid #c9c9c9; flex-shrink: 0; transition: border 0.2s; }

.vlm-tile:nth-child(1), .vlm-row:nth-child(1) { animation-delay: 40ms; }
.vlm-tile:nth-child(2), .vlm-row:nth-child(2) { animation-delay: 80ms; }
.vlm-tile:nth-child(3), .vlm-row:nth-child(3) { animation-delay: 120ms; }
.vlm-tile:nth-child(4), .vlm-row:nth-child(4) { animation-delay: 160ms; }
.vlm-tile:nth-child(5), .vlm-row:nth-child(5) { animation-delay: 200ms; }
.vlm-tile:nth-child(6) { animation-delay: 240ms; }

@media (hover: hover) {
	.vlm-tile:hover, .vlm-row:hover { border-color: var(--vlm-yellow); background: var(--vlm-yellow-wash); }
	.vlm-tile:hover .vlm-icon { transform: translateY(-2px); }
}
.vlm-tile:active, .vlm-row:active { transform: scale(0.97); }
.vlm-tile.is-selected, .vlm-row.is-selected { background: var(--vlm-black); border-color: var(--vlm-black); color: #fff; }
.vlm-tile.is-selected .vlm-icon { color: var(--vlm-yellow); }
.vlm-row.is-selected .vlm-dot { border: 5px solid var(--vlm-yellow); }

/* Inputs */
.vlm-fields { display: flex; flex-direction: column; gap: 12px; }
.vlm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vlm-name-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.vlm-field label { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--vlm-text); }
.vlm-input {
	width: 100%; min-height: 50px; padding: 0 14px;
	border: 1.5px solid var(--vlm-medium); border-radius: var(--vlm-radius-input); background: #fff;
	font-family: var(--vlm-font); font-size: 16px; color: var(--vlm-text);
	transition: border-color 0.2s, box-shadow 0.2s;
	-webkit-appearance: none; appearance: none;
}
.vlm-input::placeholder { color: #9a948f; }
.vlm-input:focus { outline: none; border-color: var(--vlm-yellow); box-shadow: 0 0 0 3px rgba(255, 184, 0, 0.3); }
.vlm-area { height: 150px; padding: 14px; line-height: 1.5; resize: none; animation: vlm-rise 0.45s 60ms var(--vlm-ease) both; }
.vlm-field.has-error label { color: var(--vlm-error); }
.vlm-field.has-error .vlm-input { border-color: var(--vlm-error); }

/* CTA */
.vlm-cta {
	position: relative;
	display: flex; align-items: center; justify-content: center; gap: 10px;
	width: 100%; min-height: 54px; border: 0; border-radius: var(--vlm-radius-input);
	background: var(--vlm-yellow); color: var(--vlm-black);
	font-family: var(--vlm-font); font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none;
	cursor: pointer; transition: opacity 0.2s ease-out, transform 0.15s;
}
.vlm-cta:hover { opacity: 0.85; }
.vlm-cta:active { transform: scale(0.98); }
.vlm-cta .vlm-icon { width: 18px; height: 18px; stroke-width: 2.25; transition: transform 0.25s; }
.vlm-cta:hover .vlm-icon { transform: translateX(3px); }
.vlm-cta.is-dim { opacity: 0.55; }
.vlm-cta.is-loading { pointer-events: none; color: transparent; }
.vlm-cta.is-loading .vlm-icon { opacity: 0; }
.vlm-cta.is-loading::after {
	content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
	border: 2.5px solid rgba(24, 31, 32, 0.25); border-top-color: var(--vlm-black);
	animation: vlm-spin 0.7s linear infinite;
}
.vlm-cta-dark { background: var(--vlm-black); color: #fff; }
.vlm-cta-dark .vlm-icon { stroke: var(--vlm-yellow); }
.vlm-ghost {
	padding: 8px; border: 0; background: none; cursor: pointer;
	font-size: 13px; font-weight: 600; color: var(--vlm-text-muted);
	text-decoration: underline; text-underline-offset: 3px;
}
.vlm-stack-center { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.vlm .vlm-consent { font-size: 11px; line-height: 1.45; color: var(--vlm-text-muted); }
.vlm .vlm-form-error { font-size: 13px; line-height: 1.5; color: var(--vlm-error); }
.vlm-form-error[hidden] { display: none; }

/* Success */
.vlm-success { align-items: center; justify-content: center; text-align: center; min-height: 440px; gap: 18px; }
.vlm-check {
	width: 72px; height: 72px; border-radius: 9999px; background: var(--vlm-yellow);
	display: flex; align-items: center; justify-content: center;
	animation: vlm-pop 0.6s var(--vlm-ease) both;
}
.vlm-check svg { width: 34px; height: 34px; fill: none; stroke: var(--vlm-black); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.vlm-check-path { stroke-dasharray: 24; animation: vlm-draw 0.5s 0.35s ease-out both; }
.vlm .vlm-success .vlm-q { font-size: 26px; }
.vlm .vlm-success-sub { font-size: 15px; line-height: 1.6; color: var(--vlm-text-alt); }
.vlm-success-call { width: 100%; display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--vlm-light); }

.vlm-form-foot {
	display: flex; align-items: center; justify-content: center; gap: 8px; flex-shrink: 0;
	padding-top: 14px; border-top: 1px solid var(--vlm-light);
	font-size: 13px; color: var(--vlm-text-muted);
}
.vlm-form-foot .vlm-icon { width: 15px; height: 15px; color: var(--vlm-text); }
.vlm-form-foot a { color: var(--vlm-text); font-weight: 700; text-decoration: none; border-bottom: 1.5px solid var(--vlm-yellow); }
.vlm-form-foot[hidden] { display: none; }

/* ---------- Motion ---------- */
@keyframes vlm-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes vlm-stepIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes vlm-stepBack { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes vlm-pop { 0% { opacity: 0; transform: scale(0.4); } 60% { opacity: 1; transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes vlm-draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }

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

/* Root of each form instance: the type settings the Meta page sets on its body,
   so the form looks the same inside the main site's pages. */
.vlm-step-form { font-family: var(--vlm-font); font-size: 16px; line-height: 1.7; color: var(--vlm-text); -webkit-font-smoothing: antialiased; }

@media (prefers-reduced-motion: reduce) {
	.vlm *, .vlm *::before, .vlm *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Light grey sections on the main site: the soft shadow the old form card used.
   No width cap: the page layout's column sets the width, like the old card. */
.vlm-card-form.vlm-on-light { max-width: none; box-shadow: 0 4px 32px rgba(0, 0, 0, 0.08); }

/* Trust line under the form (main site): replaces "Prefer to talk?" where the
   page already shows a phone number beside the form. */
.vlm-form-foot--trust { flex-wrap: wrap; gap: 6px 22px; font-weight: 600; color: var(--vlm-text); }
.vlm-foot-item { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.vlm-form-foot--trust .vlm-icon { width: 15px; height: 15px; color: var(--vlm-yellow); stroke-width: 2.2; }
