/* =========================
   VARIABLES
========================= */
:root {
  --paper: #f7f1e5;
  --paper-deep: #eee4d2;
  --surface: #fffdf8;
  --ink: #18221e;
  --ink-soft: #55615b;
  --line: #d8cfbf;
  --orange: #e9562b;
  --orange-dark: #bd3616;
  --green: #176b4a;
  --green-soft: #e3f1e9;
  --white: #ffffff;
  --shadow: 0 22px 60px rgba(42, 36, 26, 0.13);
  --shadow-small: 0 8px 24px rgba(42, 36, 26, 0.10);
  --radius: 22px;
  --radius-small: 13px;
  --content-width: 680px;
  --ease: 180ms ease;
}

/* =========================
   RESET
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body,
h1,
h2,
h3,
p,
ul {
  margin: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
}

[hidden] {
  display: none !important;
}

/* =========================
   BASE
========================= */
body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(rgba(24, 34, 30, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 34, 30, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

button,
a {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(233, 86, 43, 0.35);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 9px;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

/* =========================
   LAYOUT
========================= */
.site-shell {
  width: min(100%, 1100px);
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.compact-header {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(24, 34, 30, 0.11);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 9px 9px 9px 3px;
  color: var(--white);
  background: var(--orange);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 0.91rem;
}

.header-note {
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.conversion-stage {
  width: 100%;
  display: grid;
  align-items: center;
  padding-block: clamp(22px, 5vh, 52px);
}

.app-screen {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
}

.app-screen.is-entering {
  animation: screen-in 260ms ease both;
}

/* =========================
   QUIZ BANNER
========================= */

.quiz-banner {
  width: 100%;
  max-width: 420px;
  /* controls the banner size */
  margin: 0 auto 16px;
}

.quiz-banner-link {
  display: block;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
}

.quiz-banner-image {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}


/* =========================
   ENTRY
========================= */
.entry-card,
.quiz-card,
.analyzing-card,
.result-card {
  border: 1px solid rgba(24, 34, 30, 0.13);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.entry-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(26px, 6vw, 54px) clamp(20px, 6vw, 56px);
}

.entry-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  right: 0;
  width: 104px;
  height: 13px;
  background: var(--orange);
}

.entry-card::after {
  content: "01 → 04";
  position: absolute;
  z-index: -1;
  top: 25px;
  right: 21px;
  color: rgba(24, 34, 30, 0.18);
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--orange-dark);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1 {
  max-width: 15ch;
  font-size: clamp(2rem, 7.8vw, 3.55rem);
  line-height: 0.99;
  letter-spacing: -0.055em;
}

.lead {
  max-width: 52ch;
  margin-top: 17px;
  color: var(--ink-soft);
  font-size: clamp(1rem, 3.6vw, 1.12rem);
}

.button {
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: var(--radius-small);
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease), background-color var(--ease);
}

.button-primary {
  border: 2px solid var(--ink);
  color: var(--white);
  background: var(--orange);
  box-shadow: 5px 5px 0 var(--ink);
  font-weight: 900;
  letter-spacing: 0.01em;
}

.button-primary:hover {
  background: #f16239;
  transform: translate(-1px, -1px);
  box-shadow: 7px 7px 0 var(--ink);
}

.button-primary:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--ink);
}

.button-large {
  width: 100%;
  margin-top: 26px;
  padding: 14px 20px;
  font-size: 1rem;
  text-transform: uppercase;
}

.reassurance {
  margin-top: 20px;
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 0.79rem;
  font-weight: 650;
}

.reassurance-check {
  color: var(--green);
  font-weight: 950;
}

/* =========================
   QUIZ
========================= */
.quiz-card {
  padding: clamp(22px, 5vw, 40px);
}

.progress-block {
  margin-bottom: 28px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border: 1px solid rgba(24, 34, 30, 0.14);
  border-radius: 999px;
  background: var(--paper-deep);
}

.progress-fill {
  display: block;
  width: 25%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 260ms ease;
}

.question-panel {
  animation: question-in 240ms ease both;
}

.question-number {
  margin-bottom: 7px;
  color: var(--orange-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.question-panel h2 {
  font-size: clamp(1.55rem, 5.4vw, 2.25rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.question-hint {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.answer-list {
  display: grid;
  gap: 10px;
  margin-top: 23px;
}

.answer-button {
  position: relative;
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px 1fr 18px;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--white);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--ease), background-color var(--ease), transform var(--ease), box-shadow var(--ease);
}

.answer-button:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow-small);
}

.answer-button:active {
  transform: scale(0.99);
}

.answer-button.is-selected {
  border-color: var(--green);
  color: #0e5439;
  background: var(--green-soft);
  box-shadow: 0 0 0 2px rgba(23, 107, 74, 0.08);
}

.answer-button:disabled {
  cursor: wait;
}

.answer-index {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  background: var(--paper);
  font-size: 0.78rem;
  font-weight: 900;
}

.answer-button.is-selected .answer-index {
  border-color: var(--green);
  color: var(--white);
  background: var(--green);
}

.answer-label {
  font-size: 0.93rem;
  font-weight: 760;
  line-height: 1.25;
}

.answer-arrow {
  color: #8c948f;
  font-weight: 900;
}

.answer-button.is-selected .answer-arrow {
  color: var(--green);
}

.text-button {
  min-height: 44px;
  padding: 8px 4px;
  color: var(--ink-soft);
  background: transparent;
  text-decoration: underline;
  text-decoration-color: rgba(85, 97, 91, 0.35);
  text-underline-offset: 4px;
  cursor: pointer;
}

.text-button:hover {
  color: var(--ink);
}

.quiz-back {
  margin-top: 18px;
  font-size: 0.82rem;
}

/* =========================
   ANALYZING
========================= */
.analyzing-card {
  padding: clamp(34px, 9vw, 62px) 22px;
  text-align: center;
}

.matching-spinner {
  width: 58px;
  height: 58px;
  margin: 0 auto 21px;
  padding: 7px;
  border: 2px solid var(--ink);
  border-radius: 18px 18px 18px 6px;
  transform: rotate(-3deg);
}

.matching-spinner span {
  display: block;
  width: 100%;
  height: 100%;
  border: 5px solid var(--paper-deep);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 650ms linear infinite;
}

.analyzing-card h2 {
  font-size: clamp(1.75rem, 6vw, 2.45rem);
  letter-spacing: -0.04em;
}

.analysis-list {
  max-width: 310px;
  margin: 25px auto 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
  color: var(--ink-soft);
  text-align: left;
  font-size: 0.9rem;
  font-weight: 650;
}

.analysis-list span {
  margin-right: 7px;
  color: var(--green);
  font-weight: 950;
}

/* =========================
   RESULT
========================= */
.result-card {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 6vw, 44px);
  border-top: 7px solid var(--green);
}

.match-stamp {
  width: fit-content;
  margin-bottom: 22px;
  padding: 7px 10px;
  border: 1px solid #a7cbb8;
  border-radius: 7px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.result-kicker {
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.result-content h2 {
  max-width: 16ch;
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.result-description {
  max-width: 52ch;
  margin-top: 13px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.why-title {
  margin-top: 22px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.benefit-list {
  margin-top: 11px;
  padding: 0;
  display: grid;
  gap: 9px;
  list-style: none;
  font-size: 0.88rem;
}

.benefit-list li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 6px;
}

.benefit-list span {
  color: var(--green);
  font-weight: 950;
}

#offer-cta {
  margin-top: 24px;
}

#retake-quiz {
  width: 100%;
  margin-top: 12px;
  font-size: 0.84rem;
}

.result-note {
  margin-top: 7px;
  color: #737d77;
  font-size: 0.72rem;
  text-align: center;
}

/* =========================
   MODALS
========================= */
.modal {
  position: fixed;
  z-index: 900;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 17, 0.72);
  backdrop-filter: blur(3px);
  animation: fade-in 160ms ease both;
}

.modal-panel {
  position: relative;
  width: min(100%, 580px);
  max-height: min(78vh, 620px);
  max-height: min(78svh, 620px);
  overflow-y: auto;
  padding: clamp(24px, 6vw, 40px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  animation: modal-in 200ms ease both;
}

.modal-panel h2 {
  padding-right: 42px;
  font-size: clamp(1.65rem, 6vw, 2.25rem);
  letter-spacing: -0.04em;
}

.modal-panel p:not(.eyebrow) {
  margin-top: 15px;
  color: var(--ink-soft);
  font-size: 0.93rem;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--paper);
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  border-color: var(--ink);
}

/* =========================
   FOOTER
========================= */
.compact-footer {
  padding-block: 17px max(17px, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  border-top: 1px solid rgba(24, 34, 30, 0.11);
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.compact-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 13px;
}

.compact-footer button {
  min-height: 34px;
  padding: 4px 0;
  color: inherit;
  background: transparent;
  text-decoration: underline;
  text-decoration-color: rgba(85, 97, 91, 0.38);
  text-underline-offset: 3px;
  cursor: pointer;
}

.compact-footer button:hover {
  color: var(--ink);
}

/* =========================
   ANIMATIONS
========================= */
@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes question-in {
  from {
    opacity: 0;
    transform: translateX(9px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================
   MOBILE
========================= */
@media (max-width: 430px) {
  .site-shell {
    padding-inline: 12px;
  }

  .compact-header {
    min-height: 58px;
  }

  .brand-mark {
    width: 29px;
    height: 29px;
  }

  .header-note {
    max-width: 112px;
    text-align: right;
    font-size: 0.62rem;
  }

  .conversion-stage {
    padding-block: 16px;
  }

  .entry-card,
  .quiz-card,
  .analyzing-card,
  .result-card {
    border-radius: 17px;
  }

  .entry-card {
    padding-top: 31px;
  }

  .entry-card::after {
    display: none;
  }

  .question-panel h2 {
    max-width: 18ch;
  }

  .answer-list {
    gap: 8px;
  }

  .answer-button {
    min-height: 56px;
  }

  .compact-footer {
    justify-content: center;
    text-align: center;
  }

  .compact-footer nav {
    justify-content: center;
  }

  .modal {
    align-items: end;
    padding: 8px;
  }

  .modal-panel {
    width: 100%;
    max-height: 86svh;
    padding: 26px 20px calc(24px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 10px 10px;
  }
}

/* =========================
   TABLET + DESKTOP
========================= */
@media (min-width: 700px) {
  .site-shell {
    padding-inline: 30px;
  }

  .reassurance {
    grid-template-columns: repeat(3, auto);
    justify-content: space-between;
    gap: 14px;
  }

  .answer-button {
    padding-inline: 16px;
  }
}

@media (min-width: 1024px) {
  .site-shell {
    padding-inline: 44px;
  }

  .compact-header {
    min-height: 74px;
  }
}

/* =========================
   REDUCED MOTION
========================= */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* Scholarship results and voluntary update channels use the original tokens. */
.brand-name, [data-brand] { overflow-wrap: anywhere; }
.reassurance { grid-template-columns: 1fr; }
.result-content h2 { max-width: 24ch; font-size: clamp(1.7rem, 6vw, 2.5rem); line-height: 1.08; }
#thanks-title { font-size: clamp(1.7rem, 6vw, 2.5rem); line-height: 1.1; letter-spacing: -.04em; }
.preference-summary { margin: 22px 0 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--paper); display: grid; gap: 12px; }
.preference-summary div, .listing-details div { min-width: 0; }
.preference-summary dt, .listing-details dt { font-size: .75rem; color: var(--ink-soft); font-weight: 750; }
.preference-summary dd, .listing-details dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.preference-summary dd { font-weight: 750; font-size: .92rem; }
.notice { padding: 13px; margin: 14px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink-soft); font-size: .84rem; overflow-wrap: anywhere; }
.scholarship-list { display: grid; gap: 16px; margin: 20px 0; }
.scholarship-card, .channel-card { border: 1px solid var(--line); border-radius: var(--radius-small); padding: clamp(16px, 4vw, 24px); min-width: 0; }
.scholarship-card { background: var(--white); }
.scholarship-card h3, .channel-card h3 { font-size: 1.2rem; line-height: 1.25; letter-spacing: -.025em; }
.scholarship-card p:not(.eyebrow), .channel-card > p:not(.eyebrow) { margin-top: 10px; color: var(--ink-soft); font-size: .9rem; }
.listing-details { display: grid; gap: 10px; margin: 16px 0; font-size: .84rem; }
.eligibility-details summary { min-height: 44px; padding-block: 10px; cursor: pointer; color: var(--green); font-size: .84rem; }
.eligibility-details summary:focus-visible { outline: 3px solid rgba(233,86,43,.35); outline-offset: 2px; }
.channel-card { margin-top: 24px; background: var(--surface); }
.form-grid { display: grid; gap: 14px; margin-top: 20px; }
.form-grid label { display: grid; gap: 6px; font-size: .87rem; font-weight: 750; }
.form-grid label span { color: var(--ink-soft); font-size: .78rem; font-weight: 400; }
.form-grid input { width: 100%; min-width: 0; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); color: var(--ink); font-size: 16px; }
input:focus-visible { outline: 3px solid rgba(233,86,43,.35); outline-offset: 2px; }
input[aria-invalid="true"] { border-color: var(--orange-dark); }
.consent-label { margin-top: 18px; display: flex; align-items: flex-start; gap: 10px; font-size: .82rem; color: var(--ink-soft); cursor: pointer; }
.consent-label input { flex: 0 0 20px; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--green); }
.form-feedback { min-height: 1.5em; margin-top: 14px; color: var(--green); font-size: .85rem; overflow-wrap: anywhere; }
.button-secondary { padding: 12px 16px; border: 1.5px solid var(--ink); color: var(--ink); background: var(--paper); font-weight: 800; }
.button-secondary:hover { background: var(--paper-deep); transform: translateY(-1px); }
.button { white-space: normal; overflow-wrap: anywhere; text-align: center; }
.button:disabled { cursor: default; opacity: .6; transform: none; box-shadow: none; }
.button-large { font-size: .9rem; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.banner-placeholder { padding: 18px; border: 1px solid var(--line); border-radius: 14px; text-align: center; color: var(--green); background: var(--green-soft); }
@media (min-width: 600px) {
  .preference-summary, .form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .full-width { grid-column: 1 / -1; }
}

/* Keep public provider embeds inside the signup card. */
.email-provider-container { margin-top: 18px; min-width: 0; overflow-wrap: anywhere; }
.email-provider-container iframe { max-width: 100%; border: 0; }

/* The email form ends the survey; the provider return URL shows only the final dialog. */
html[data-funnel-step="email"] .compact-footer,
html[data-funnel-step="telegram"] .compact-footer,
html[data-funnel-step="telegram"] .compact-header,
html[data-funnel-step="telegram"] .skip-link,
html[data-funnel-step="telegram"] .quiz-banner,
html[data-funnel-step="telegram"] .modal,
html[data-funnel-step="telegram"] .app-screen:not(#screen-telegram) { display: none !important; }
html[data-funnel-step="telegram"] #screen-telegram { display: block !important; }
html[data-funnel-step="telegram"] .site-shell { grid-template-rows: 1fr; }
.final-step-card { text-align: center; }
.final-step-card .result-description { margin: 20px auto 28px; }
.final-step-card .form-feedback:empty { display: none; }
