/* Funnel: shared parts for the conversion pages
   (contact, assessment, assessment results, booked, thank-you).
   The "flow" is the run sheet clipped to the studio desk: a light panel on navy
   with a broadcast-timeline progress bar, one-tap choices and the booking feed. */

/* ---------- Page frame ---------- */
.funnel-hero { padding-block: clamp(2.5rem, 1.5rem + 3.5vw, 5rem) clamp(3.5rem, 2rem + 5vw, 7rem); }
.funnel-hero .display { font-size: clamp(2.75rem, 1.5rem + 4.6vw, 5.25rem); max-width: 12ch; }
.funnel-hero .lead { margin-top: var(--s-5); max-width: 46ch; color: var(--on-studio-2); }
.funnel-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-7); }
@media (min-width: 1024px) {
  .funnel-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2.5rem, 1rem + 4vw, 6rem); align-items: start; }
  .funnel-grid__panel { position: sticky; top: 96px; }
}

/* ---------- The flow panel ---------- */
.flow {
  background: var(--sheet); color: var(--ink); border-radius: 4px;
  padding: clamp(1.25rem, 0.9rem + 1.8vw, 2.5rem); box-shadow: var(--shadow-monitor);
  --line: var(--sheet-line);
}
.flow :focus-visible { outline-color: var(--tally-ink); }
.flow__head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.flow__head .time { color: var(--ink-2); }
.flow .lamp { color: var(--ink-2); }
.flow .lamp.is-live { color: #fff; }

/* Broadcast timeline progress: segments on a playout track */
.tl { margin-top: var(--s-4); }
.tl__track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.tl__seg { height: 6px; background: var(--sheet-line); position: relative; overflow: hidden; border-radius: 1px; }
.tl__seg::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(0); transition: transform var(--d-slow) var(--ease-out); }
.tl__seg.is-done::after { transform: scaleX(1); }
.tl__seg.is-live::after { background: var(--tally-fill); transform: scaleX(1); }
.tl__meta { display: flex; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-2); color: var(--ink-2); font-size: var(--t-label); font-weight: 650; }
.tl__meta .time { font-size: 0.6875rem; padding-top: 0.15em; }

/* Steps */
.step { border: 0; margin: 0; padding: 0; min-width: 0; }
.step[hidden] { display: none !important; }
.step__title { font-size: clamp(1.375rem, 1.15rem + 0.9vw, 1.875rem); font-weight: 780; letter-spacing: -0.025em; line-height: 1.12; padding: 0; margin: var(--s-6) 0 var(--s-2); outline: none; }
.step__sub { color: var(--ink-2); margin-bottom: var(--s-5); max-width: 48ch; }
.step__title + .choice-grid, .step__title + .step__group { margin-top: var(--s-5); }
.step__group { border: 0; padding: 0; margin: 0 0 var(--s-5); min-width: 0; }
.step__group > legend { font-weight: 700; font-size: var(--t-small); padding: 0; margin-bottom: var(--s-3); }
.step__group > legend .opt { font-weight: 500; color: var(--ink-2); }

.flow .choice { color: var(--ink); }
.flow .choice span.choice__text { flex: 1; }
.flow .choice svg { width: 16px; height: 16px; color: var(--ink-2); flex: none; }
.flow .choice--crisis { border-style: dashed; }
.choice-grid--chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.choice-grid--chips .choice { min-height: 48px; padding: 0.6rem 0.95rem; font-size: var(--t-small); }
.group-error { color: var(--tally-ink); font-size: 0.875rem; font-weight: 600; margin-top: var(--s-2); }
.group-error:empty { display: none; }
.step__group.is-invalid .choice { border-color: color-mix(in srgb, var(--tally-ink) 55%, var(--sheet-line)); }

.fields { display: grid; gap: var(--s-4); }
@media (min-width: 560px) { .fields--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.field .opt { font-weight: 500; color: var(--ink-2); }
.flow .check { margin-top: var(--s-4); }
.flow .check a, .flow .fine a { color: var(--ink); font-weight: 600; }
.fine { font-size: 0.8125rem; color: var(--ink-2); margin-top: var(--s-4); }

.flow__nav { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-3) var(--s-4); margin-top: var(--s-6); }
.flow__nav[hidden] { display: none; }
.flow__nav .btn { min-width: 12rem; }
.btn-back {
  display: inline-flex; align-items: center; gap: 0.45em; min-height: 44px; padding: 0 0.25rem;
  background: none; border: 0; color: var(--ink-2); font-weight: 650; cursor: pointer;
}
.btn-back svg { width: 16px; height: 16px; transform: scaleX(-1); }
.btn-back:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 0.22em; }

/* Status + inline messages */
.flow__status { margin-top: var(--s-5); padding: var(--s-4) var(--s-5); border: 1px solid var(--tally-ink); background: #fff3f5; border-radius: var(--radius); display: grid; gap: var(--s-3); }
.flow__status[hidden] { display: none; }
.flow__status p { font-weight: 600; }
.flow__status .cta-group { gap: var(--s-2) var(--s-4); }

.crisis-panel { margin-top: var(--s-5); padding: var(--s-5); background: var(--ink); color: var(--on-studio); border-radius: var(--radius); display: grid; gap: var(--s-4); }
.crisis-panel[hidden] { display: none; }
.crisis-panel p { color: var(--on-studio-2); }
.crisis-panel strong { color: var(--on-studio); }
.crisis-panel .link-arrow { color: var(--on-studio); }

/* No-JS fallback: visible until the page script marks the flow ready */
.flow__nojs { display: grid; gap: var(--s-4); margin-top: var(--s-5); }
.flow__nojs p { color: var(--ink-2); }
.flow__body { display: none; }
.flow.is-ready .flow__body { display: block; }
.flow.is-ready .flow__nojs { display: none; }

/* Phone line */
.phone-line { display: inline-flex; align-items: center; gap: 0.6em; font-weight: 750; font-size: 1.125rem; text-decoration: none; min-height: 44px; }
.phone-line svg { width: 20px; height: 20px; color: var(--tally); }
.sheet .phone-line svg, .flow .phone-line svg, .paper .phone-line svg { color: var(--tally-ink); }
.phone-line:hover span { text-decoration: underline; text-underline-offset: 0.22em; }

/* ---------- Booking feed (GHL calendar) ---------- */
.booking { display: grid; gap: var(--s-4); }
.booking__shell {
  position: relative; background: var(--paper); border: 1px solid var(--sheet-line); border-radius: var(--radius);
  min-height: 640px; overflow: hidden;
}
.booking__shell iframe { display: block; width: 100%; min-height: 700px; border: 0; }
.booking__loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: var(--s-3); color: var(--ink-2); font-size: var(--t-small); pointer-events: none; transition: opacity var(--d-med); }
.booking__loading .time { color: var(--ink-2); }
.booking__shell.is-loaded .booking__loading { opacity: 0; }
.booking__bars { display: flex; gap: 3px; }
.booking__bars i { width: 6px; height: 22px; background: var(--sheet-line); animation: bars 1.1s steps(2, jump-none) infinite; }
.booking__bars i:nth-child(2) { animation-delay: 0.15s; } .booking__bars i:nth-child(3) { animation-delay: 0.3s; } .booking__bars i:nth-child(4) { animation-delay: 0.45s; }
@keyframes bars { 50% { background: var(--ink-2); } }
.booking__fallback { font-size: var(--t-small); color: var(--ink-2); }
.booking__fallback a { color: var(--ink); font-weight: 650; }

/* ---------- Proof beside the ask ---------- */
.proof { display: grid; gap: var(--s-6); }
.proof__meet { position: relative; max-width: 30rem; }
.proof__meet .monitor__screen { aspect-ratio: 4 / 3; }
.proof__meet img { object-position: 62% 30%; }
.proof__meet .chyron { position: absolute; left: -0.6rem; bottom: 1.6rem; }
@media (max-width: 560px) { .proof__meet .chyron { left: 0.4rem; } }
.proof__covers { font-family: var(--f-voice); font-style: normal; font-weight: 620; letter-spacing: -0.02em; font-size: var(--t-voice-sm); line-height: 1.25; max-width: 30ch; }
.proof__covers em { font-style: normal; font-weight: 800; color: var(--tally); }
.sheet .proof__covers em, .paper .proof__covers em { color: var(--tally-ink); }
.proof__quote { display: grid; gap: var(--s-4); padding-top: var(--s-5); border-top: 1px solid var(--line); }
.proof__quote blockquote p { font-family: var(--f-voice); font-style: normal; font-weight: 620; letter-spacing: -0.02em; font-size: 1.1875rem; line-height: 1.35; max-width: 44ch; }
.proof__quote .chyron__name { font-size: 0.8125rem; }
.proof__quote .chyron__title { font-size: 0.6875rem; }
.proof__lines { display: grid; border-top: 1px solid var(--line); }
.proof__lines > * { padding-block: var(--s-4); border-bottom: 1px solid var(--line); display: grid; gap: var(--s-1); }
.proof__lines .time { color: var(--on-studio-3); }
.sheet .proof__lines .time, .paper .proof__lines .time { color: var(--ink-2); }
.proof__lines p { color: var(--on-studio-2); font-size: var(--t-small); }
.sheet .proof__lines p, .paper .proof__lines p { color: var(--ink-2); }
.proof__lines a:not(.phone-line) { font-weight: 650; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .booking__bars i { animation: none; }
}

/* Legends ignore margin-top inside fieldsets: float them into the flow instead. */
fieldset.step { padding-top: var(--s-6); }
fieldset.step > legend.step__title { float: left; width: 100%; margin-top: 0; }
fieldset.step > legend.step__title + * { clear: both; }
fieldset.step > legend.step__title ~ .step__sub { clear: both; padding-top: var(--s-2); }
