/* ============================================================
   Discernment Accelerator — funnel pages (apply, quiz, thank-you,
   schedule, training video). Loads after story.css and before each
   page's own stylesheet (apply.css, quiz.css, narrow.css, vsl.css).
   Maps the old token names those sheets use onto the new look, and
   re-themes the shared form pieces.
   ============================================================ */

:root {
  /* Old token names, new values */
  --space-1: 0.25rem; --space-7: 1.75rem; --space-14: 3.5rem; --space-18: 4.5rem; --space-20: 5rem; --space-24: 6rem; --space-32: 8rem;
  --text-xs: 0.8125rem;
  --text-lg: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.1rem);
  --text-2xl: var(--text-h1);
  --radius-sm: 6px; --radius-md: 12px; --radius-xl: 28px;
  --shadow-sm: var(--shadow-soft); --shadow-md: var(--shadow-lift);
  --color-primary: var(--terracotta-deep);
  --color-primary-hover: #7A3620;
  --color-surface-offset: var(--color-tint);
  --color-text-muted: var(--color-muted);
  --color-text-faint: var(--color-muted);
}
@media (prefers-color-scheme: dark) {
  :root { --color-primary: #EBA27D; --color-primary-hover: #F2B898; }
}

/* Old button names */
.btn--lg { padding: 1.05rem 1.9rem; font-size: 1.06rem; }
.btn--block { width: 100%; }
.btn--outline { --btn-bg: transparent; --btn-fg: currentColor; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.container--copy { width: min(100% - 2 * var(--gutter), 46rem); }
.funnel main > section { position: relative; }

/* Solid header (pages that start on a light background) */
.solid-head .site-header { margin-bottom: 0; }

/* ---------- Dark hero band ---------- */
.funnel-hero {
  position: relative; overflow: hidden; isolation: isolate; text-align: center;
  background: radial-gradient(120% 90% at 80% 0%, #5A3A24 0%, var(--espresso) 45%, var(--night) 100%);
  padding: calc(4.75rem + clamp(2.5rem, 1.5rem + 4vw, 4.5rem)) 0 clamp(3rem, 2rem + 4vw, 5rem) !important;
}
.funnel-hero::before {
  content: ""; position: absolute; z-index: -1; width: 46vw; height: 46vw; right: -10vw; top: -16vw; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(226, 181, 78, 0.32), transparent); filter: blur(30px);
}
.funnel-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--weave); }
.funnel-hero h1 { font-size: var(--text-h1) !important; margin: 0 auto var(--space-5) !important; max-width: 24ch; }
.funnel-hero h1 em { color: var(--gold-bright); }
.funnel-hero p { color: #EADBC6 !important; margin-inline: auto; max-width: 58ch; }
.funnel-hero .eyebrow { color: var(--gold-bright); }
.funnel-hero .confirmation-icon { background: var(--gold-bright); color: var(--night); box-shadow: 0 0 0 10px rgba(226, 181, 78, 0.18); }

/* Left-aligned dark hero (apply, register) */
.funnel-hero--left { text-align: left; }
.funnel-hero--left h1, .funnel-hero--left p { margin-left: 0 !important; }

/* ---------- Forms ---------- */
.form-card {
  position: relative; overflow: hidden;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: clamp(1.5rem, 1rem + 3vw, 3rem); box-shadow: var(--shadow-lift);
}
.form-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--weave); }
.form-field { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-5); }
.form-field label { font-size: var(--text-sm); font-weight: 700; }
.form-field input:not([type="range"]), .form-field select, .form-field textarea {
  padding: 0.9rem 1rem; border: 1.5px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-bg); color: var(--color-text); font: inherit; font-size: 1rem; width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--gold); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 22%, transparent);
}
.form-field--radio-group { gap: var(--space-3); border: 0; }
.form-field legend, .apply-step legend, .apply-step .form-field > label { font-family: var(--font-display); font-variation-settings: var(--fvs-display); font-weight: 500; color: var(--color-heading); }
.radio-option {
  display: flex; align-items: flex-start; gap: var(--space-3); padding: 0.95rem 1.1rem;
  border: 1.5px solid var(--color-border); border-radius: var(--radius-md); cursor: pointer;
  background: var(--color-bg); font-size: 1rem; line-height: 1.5;
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s var(--ease-out);
}
.radio-option:hover { border-color: var(--gold); transform: translateX(3px); }
.radio-option input { margin-top: 4px; accent-color: var(--terracotta-deep); width: 18px; height: 18px; flex-shrink: 0; }
.radio-option:has(input:checked) { border-color: var(--terracotta); background: color-mix(in srgb, var(--terracotta) 9%, var(--color-surface)); }
.form-micro { font-size: var(--text-sm); color: var(--color-muted); text-align: center; margin-top: var(--space-4); }
.field-hint { color: var(--color-muted); }

.progress-bar { width: 100%; height: 8px; border-radius: 999px; background: var(--color-tint); overflow: hidden; margin-bottom: var(--space-8); }
.progress-bar__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--camel), var(--gold), var(--terracotta)); transition: width 0.4s var(--ease-out); }

.confirmation-icon {
  width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-6); background: var(--terracotta-deep); color: #FFF8EE;
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--gold) 20%, transparent);
}

/* Video placeholders (until the Vidalytics players are added) */
.placeholder {
  position: relative; display: flex; align-items: center; justify-content: center; text-align: center;
  aspect-ratio: 16 / 9; min-height: 220px; overflow: hidden;
  border-radius: var(--radius-lg); background: radial-gradient(90% 90% at 50% 30%, #5A3A24, var(--night));
  box-shadow: var(--shadow-lift), inset 0 0 0 1px rgba(226, 181, 78, 0.35); color: #EADBC6;
}
.placeholder--video::before {
  content: ""; position: absolute; width: 76px; height: 76px; border-radius: 50%; z-index: 1;
  background: color-mix(in srgb, var(--terracotta-deep) 85%, transparent);
  box-shadow: 0 0 0 1.5px var(--gold), 0 0 0 10px color-mix(in srgb, var(--gold) 18%, transparent);
}
.placeholder--video::after {
  content: ""; position: absolute; z-index: 2; transform: translateX(3px);
  border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #FFF8EE;
}
.placeholder__label {
  position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); width: max-content; max-width: 90%;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; padding: 0.45rem 0.8rem; border-radius: 8px;
  background: rgba(36, 24, 15, 0.7); color: #EADBC6;
}

/* Spinner (quiz) */
.spinner { border-color: var(--color-border); border-top-color: var(--gold); }

/* ---------- Page-specific polish ---------- */
.apply-hero__notice {
  text-align: left; background: rgba(250, 243, 230, 0.08) !important; border-left: 3px solid var(--gold) !important;
  border-radius: var(--radius-md); padding: var(--space-4) var(--space-5);
}
.apply-form-section { padding-top: clamp(2rem, 1rem + 3vw, 3.5rem); }
.apply-step__count, .quiz-question__count { color: var(--color-gold-text) !important; font-size: var(--text-label) !important; letter-spacing: 0.12em !important; }
.apply-back, .quiz-back { color: var(--color-muted); font-weight: 600; }
.apply-back:hover, .quiz-back:hover { color: var(--color-accent); }
.range-field__value { color: var(--color-accent) !important; font-weight: 600; }
.confirmation-card h2 { font-size: var(--text-h2) !important; }

/* Quiz */
.quiz-page main { background: radial-gradient(80% 50% at 50% 0%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 70%); }
#screen-intro h1, #screen-capture h1 { font-size: var(--text-h1) !important; }
.quiz-question__text { font-weight: 500; }
.quiz-option {
  border-radius: var(--radius-md) !important; background: var(--color-surface) !important; color: var(--color-text) !important;
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s var(--ease-out) !important;
}
.quiz-option:hover { border-color: var(--gold) !important; transform: translateX(3px); }
.quiz-option.is-selected { border-color: var(--terracotta) !important; background: color-mix(in srgb, var(--terracotta) 10%, var(--color-surface)) !important; }
.quiz-capture-form { padding: clamp(1.5rem, 1rem + 2vw, 2.25rem); background: var(--color-surface); border-radius: var(--radius-lg); border: 1px solid var(--color-border); box-shadow: var(--shadow-lift); }

/* Narrow pages */
.prep-list { background: var(--color-surface) !important; border: 1px solid var(--color-border); box-shadow: var(--shadow-soft); padding: clamp(1.25rem, 1rem + 2vw, 2rem) !important; }
.prep-list li::before { background: var(--gold) !important; }
.prep-list h2, .training-title-block h2 { font-weight: 500; }
.video-section, .schedule-embed-section, .vsl-video-section { padding-top: clamp(2rem, 1rem + 3vw, 3.5rem); }
.embed-frame { background: var(--color-surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lift); border: 1px solid var(--color-border); }

/* VSL */
.vsl-cta-section { background: var(--color-tint) !important; }
.vsl-reg-hero__grid { text-align: left; align-items: center !important; }
.vsl-reg-list li { color: #F3E6D2; }
.vsl-reg-list li::before { background: var(--gold-bright) !important; }
.vsl-reg-form-card { position: relative !important; top: 0 !important; color: var(--color-text); background: var(--color-surface) !important; overflow: hidden; border-radius: var(--radius-lg) !important; }
.vsl-reg-form-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--weave); }
.vsl-reg-form-card h2 { color: var(--color-heading); }
.vsl-reg-form-card p { color: var(--color-muted) !important; }
._form_6 ._submit { background: var(--terracotta-deep) !important; border-radius: 999px !important; }
.vsl-reg-hero__grid p, .vsl-reg-hero__grid h1 { margin-left: 0 !important; }
/* ActiveCampaign styles its button by form ID; repeat the button's own ID to outrank it */
html body #_form_6_submit#_form_6_submit._submit,
html body ._form_6 button._submit._submit {
  background: var(--terracotta-deep) !important; color: #FFF8EE !important; border-radius: 999px !important;
  font-family: var(--font-body) !important; font-weight: 700 !important; padding: 0.95rem 1.5rem !important; width: 100% !important;
}
html body ._form_6 ._form-title { font-family: var(--font-display) !important; font-weight: 500 !important; }

/* Step change: slide only, so a step can never be stuck invisible */
.apply-step.is-active { animation: apply-step-slide 0.26s ease; }
@keyframes apply-step-slide { from { transform: translateY(6px); } to { transform: none; } }

/* ActiveCampaign form keeps its own white box, so the card stays light in dark mode too */
.vsl-reg-form-card { background: #FFFDF8 !important; color: #3D2B1F !important; border-color: rgba(61, 43, 31, 0.14) !important; }
.vsl-reg-form-card h2 { color: #3D2B1F !important; }
.vsl-reg-form-card p { color: #6B5949 !important; }
html body ._form_6 ._form-title, html body ._form_6 ._form-label, html body ._form_6 ._form-body, html body ._form_6 ._form_element ._form-label { color: #3D2B1F !important; }
html body ._form_6 input[type="text"], html body ._form_6 input[type="email"], html body ._form_6 input[type="tel"], html body ._form_6 textarea, html body ._form_6 select {
  background: #FAF3E6 !important; color: #3D2B1F !important; border: 1.5px solid rgba(61, 43, 31, 0.2) !important; border-radius: 12px !important;
}
html body ._form_6 input::placeholder { color: #8A7563 !important; }
.funnel .apply-step.is-active { animation: apply-step-slide 0.26s ease; }
html body ._form_6 ._form_element input[type="text"], html body ._form_6 ._form_element input[type="email"],
html body ._form_6 ._form_element input[type="tel"], html body ._form_6 ._form_element textarea, html body ._form_6 ._form_element select {
  background: #FAF3E6 !important; color: #3D2B1F !important; border: 1.5px solid rgba(61, 43, 31, 0.2) !important; border-radius: 12px !important; color-scheme: light;
}
