/* ============================================================================
   DIBO+ Funnel — styles
   Aesthetic: India-Built Fintech (see DESIGN.md). Deep navy + terracotta accent,
   warm paper, editorial Fraunces headlines over Instrument Sans, DM Mono numerals.
   Mobile-first. CSS-only motion (perf is a hard requirement — budget Android).
   ========================================================================== */

/* ---- Tokens ------------------------------------------------------------- */
:root {
  /* Surfaces — warm, never pure white */
  --paper:      #FAF6EE;
  --surface:    #FFFDF7;
  --backdrop:   #EFE6D4;

  /* Ink — warm, never pure black */
  --ink:        #12110F;
  --ink-soft:   #4A453E;
  --ink-faint:  #6F6A63;

  /* Brand */
  --navy:       #1B2A4A;
  --navy-deep:  #12203B;
  --navy-hover: #223458;

  /* Accent — terracotta, for meaning only */
  --accent:      #CC5E2E;
  --accent-soft: #F2EAD8;   /* cream — eyebrow chip, selected-card tint */
  --accent-deep: #A8431E;   /* text-safe terracotta (contrast on paper) */

  /* Feedback — success reuses terracotta (DESIGN.md: no green) */
  --good:       #CC5E2E;
  --bad:        #B33A1B;
  --bad-soft:   #F4E2D8;
  --wa:         #1faf54;    /* WhatsApp brand green — third-party, not the palette */
  --wa-hover:   #1c9a4b;

  /* Lines */
  --line:       #E7DFCE;
  --line-soft:  #EFE9DC;

  /* Type */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body:    "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --mono:    "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Spacing rhythm */
  --s-1: 0.25rem;  --s-2: 0.5rem;   --s-3: 0.75rem;  --s-4: 1rem;
  --s-5: 1.5rem;   --s-6: 2rem;     --s-7: 2.75rem;  --s-8: 4rem;

  --radius:    14px;
  --radius-sm: 9px;
  --radius-lg: 20px;

  --shadow-card: 0 1px 2px rgba(27, 42, 74, 0.05),
                 0 6px 18px rgba(27, 42, 74, 0.07);
  --shadow-col:  0 2px 8px rgba(27, 42, 74, 0.08),
                 0 24px 60px rgba(27, 42, 74, 0.10);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);   /* ease-out-quart-ish */
}

/* ---- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--backdrop);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
button { font: inherit; cursor: pointer; }
a { color: var(--accent-deep); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.16; color: var(--ink); }
em { font-style: italic; }

/* ---- Progress bar ------------------------------------------------------- */
.progress {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  height: 4px; background: var(--line);
}
.progress__fill {
  height: 100%; width: 0;
  background: var(--accent);
  transition: width 0.5s var(--ease);
}

/* ---- Funnel column ------------------------------------------------------ */
.funnel {
  max-width: 552px;
  margin-inline: auto;
  min-height: 100vh;
  background: var(--paper);
  display: flex;
  flex-direction: column;
}
@media (min-width: 600px) {
  .funnel {
    margin-block: var(--s-7);
    min-height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-col);
    overflow: hidden;
  }
}

/* ---- Screens ------------------------------------------------------------ */
.screen { display: none; }
.screen.is-active { display: block; }
.screen[hidden] { display: none; }

.screen__body {
  padding: var(--s-6) var(--s-5) var(--s-7);
}
.screen__body--center { text-align: center; }
.screen__body--center .screen__head { text-align: center; }

.stack-lg > * + * { margin-top: var(--s-5); }

.screen.is-active .screen__body > * {
  animation: rise 0.46s var(--ease) both;
}
.screen.is-active .screen__body > *:nth-child(1) { animation-delay: 0.02s; }
.screen.is-active .screen__body > *:nth-child(2) { animation-delay: 0.07s; }
.screen.is-active .screen__body > *:nth-child(3) { animation-delay: 0.12s; }
.screen.is-active .screen__body > *:nth-child(4) { animation-delay: 0.17s; }
.screen.is-active .screen__body > *:nth-child(5) { animation-delay: 0.22s; }
.screen.is-active .screen__body > *:nth-child(n+6) { animation-delay: 0.26s; }

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

/* ---- Screen 1 — trust strip --------------------------------------------- */
.trust-strip {
  background: var(--navy-deep);
  color: #F4EFDF;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.9rem;
  padding: 0.6rem 1rem;
}
.trust-strip span { display: inline-flex; align-items: center; gap: 0.25rem; white-space: nowrap; }
.trust-strip span + span::before {
  content: ""; width: 3px; height: 3px; border-radius: 50%;
  background: var(--accent); margin-right: 0.55rem;
}

/* ---- Step tag ----------------------------------------------------------- */
.step-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---- Back navigation (Screens 2–5) ------------------------------------- */
.screen-nav {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-faint);
  background: none;
  border: 0;
  padding: 0.2rem 0;
  transition: color 0.15s var(--ease);
}
.back-btn:hover { color: var(--ink); }
.back-btn span { font-size: 1.1em; line-height: 1; }

/* ---- Hero --------------------------------------------------------------- */
.hero__hook {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-deep);
  margin-bottom: var(--s-3);
}
.hero__headline {
  font-size: clamp(2.05rem, 1.5rem + 2.7vw, 2.85rem);
  letter-spacing: -0.015em;
}
.hero__headline em {
  display: inline-block;
  color: var(--navy);
  margin-top: 0.12em;
}
.hero__sub {
  margin-top: var(--s-4);
  font-size: 1.04rem;
  color: var(--ink-soft);
}

/* ---- Stat pills --------------------------------------------------------- */
.stat-pills {
  list-style: none; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3);
}
.stat-pills li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  font-size: 0.83rem;
  color: var(--ink-soft);
  line-height: 1.3;
}
.stat-pills strong {
  display: block;
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--navy);
}

/* ---- Card --------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--s-5);
}

/* ---- Lead form ---------------------------------------------------------- */
.lead-form { display: flex; flex-direction: column; gap: var(--s-4); }
.form__title {
  font-size: 1.16rem;
  margin-bottom: var(--s-1);
}

.field { display: flex; flex-direction: column; gap: 0.34rem; }
.field label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
}
.field__hint-inline { font-weight: 400; color: var(--ink-faint); }

.field input,
.field select {
  font: inherit;
  width: 100%;
  padding: 0.72rem 0.85rem;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.field select { appearance: none; background-image:
  linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
  linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: right 1.05rem center, right 0.78rem center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.3rem;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(204, 94, 46, 0.16);
}
.field.has-error input,
.field.has-error select { border-color: var(--bad); }

.field__hint {
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-top: 0.1rem;
}
.field__error {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bad);
  min-height: 0;
}
.field__error:empty { display: none; }
.field__error--form {
  background: var(--bad-soft);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
}

/* Consent */
.consent {
  display: flex; gap: 0.65rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.4;
  cursor: pointer;
}
.consent input {
  flex: none;
  width: 1.4rem; height: 1.4rem;
  margin-top: 0.05rem;
  accent-color: var(--navy);
}

.guarantee-strip {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-faint);
}
.legal-line {
  font-size: 0.74rem;
  color: var(--ink-faint);
  line-height: 1.45;
}
.legal-line a { white-space: nowrap; }

/* ---- OTP verification --------------------------------------------------- */
.otp-block {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
}
.otp-block[hidden] { display: none; }

.otp-block__sent {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--good);
}
.otp-block__check {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.1rem;
  height: 1.1rem;
  font-size: 0.66rem;
  color: #fff;
  background: var(--good);
  border-radius: 50%;
}
.otp-block__sent strong { color: var(--ink); }

.otp-block__label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
}

.otp-inputs { display: flex; gap: var(--s-2); }
.otp-input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  height: 3rem;
  padding: 0;
  text-align: center;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.otp-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(204, 94, 46, 0.16);
}
.otp-input--filled { border-color: var(--navy); }
.otp-input--error  { border-color: var(--bad); }

.otp-block__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 1.2rem;
}
.otp-block__timer {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
}
.otp-block__resend {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-deep);
  background: none;
  border: 0;
  padding: 0;
}
.otp-block__resend[hidden] { display: none; }
.otp-block__resend:hover { text-decoration: underline; }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  position: relative;
  font-weight: 700;
  font-size: 0.98rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.92rem 1.3rem;
  transition: background-color 0.16s var(--ease), transform 0.1s var(--ease),
              box-shadow 0.16s var(--ease);
  display: inline-flex; align-items: center; justify-content: center;
  text-align: center;
}
.btn--block { width: 100%; }
.btn--lg { padding-block: 1.1rem; font-size: 1.02rem; line-height: 1.3; }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(204, 94, 46, 0.30);
}
.btn--primary:hover { background: var(--accent-deep); }
.btn--primary:disabled {
  background: var(--line);
  color: var(--ink-faint);
  box-shadow: none;
  cursor: not-allowed;
}

.btn--whatsapp { background: var(--wa); color: #fff; }
.btn--whatsapp:hover { background: var(--wa-hover); }

/* loading state */
.btn__spinner { display: none; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn__label { opacity: 0; }
.btn.is-loading .btn__spinner {
  display: block;
  position: absolute;
  width: 1.15rem; height: 1.15rem;
  border: 2.5px solid oklch(1 0 0 / 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Screen heads ------------------------------------------------------- */
.screen__head h2 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 1.95rem); }
.screen__sub {
  margin-top: var(--s-3);
  color: var(--ink-soft);
  font-size: 1rem;
}

/* ---- Screen 2 — persona cards ------------------------------------------- */
.persona-list { display: flex; flex-direction: column; gap: var(--s-3); }
.persona {
  display: flex; align-items: flex-start; gap: var(--s-4);
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s-4) var(--s-5);
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease),
              transform 0.12s var(--ease), box-shadow 0.15s var(--ease);
}
.persona:hover {
  border-color: var(--navy);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.persona.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.persona__icon {
  font-size: 1.6rem; line-height: 1;
  flex: none;
  width: 2.7rem; height: 2.7rem;
  display: grid; place-items: center;
  background: var(--paper);
  border-radius: 50%;
  border: 1px solid var(--line);
}
.persona.is-selected .persona__icon { border-color: var(--accent); }
.persona__text { display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.persona__title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
}
.persona__quote {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.04rem;
  line-height: 1.34;
  color: var(--navy);
}
.persona__pick {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

/* ---- Screen 3 — qualifier ----------------------------------------------- */
.qualifier { display: flex; flex-direction: column; gap: var(--s-5); }
.q-block { border: 0; padding: 0; }
.q-block legend {
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: var(--s-3);
  padding: 0;
}
.degree-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 100px;
  padding: 0.55rem 0.95rem;
  transition: all 0.14s var(--ease);
}
.chip:hover { border-color: var(--navy); }
.chip.is-selected {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--paper);
}

.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.yesno__btn {
  font-weight: 600;
  font-size: 0.96rem;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.78rem 1rem;
  transition: all 0.14s var(--ease);
}
.yesno__btn:hover { border-color: var(--navy); }
.yesno__btn.is-selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-deep);
}

/* ---- Screen 4 — score --------------------------------------------------- */
.score__title { font-size: clamp(1.45rem, 1.2rem + 1.3vw, 1.85rem); }

.score-ring {
  position: relative;
  width: min(74vw, 256px);
  margin-inline: auto;
}
.score-ring svg { width: 100%; height: auto; display: block; }
.score-ring__track {
  fill: none;
  stroke: var(--line);
  stroke-width: 16;
}
.score-ring__value {
  fill: none;
  stroke: var(--accent);
  stroke-width: 16;
  stroke-linecap: round;
  stroke-dasharray: 603.19;
  stroke-dashoffset: 603.19;
  transition: stroke-dashoffset 1.15s var(--ease);
}
.score-ring__center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-ring__num {
  font-family: var(--display);
  font-weight: 600;
  font-size: 3.7rem;
  line-height: 1;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.score-ring__den {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 0.2rem;
}

.score__pivot {
  font-size: 1.06rem;
  color: var(--ink-soft);
  max-width: 30rem;
  margin-inline: auto;
}
.score__pivot strong { color: var(--ink); }
.accent-num {
  color: var(--accent-deep) !important;
  font-family: var(--display);
  font-size: 1.2em;
}

.score__band { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); }
.band-chip {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--navy);
  border-radius: 100px;
  padding: 0.4rem 1rem;
}
.band-copy {
  font-size: 1.02rem;
  color: var(--ink-soft);
  max-width: 32rem;
}

/* ---- Screen 5 — result -------------------------------------------------- */
.result__headline {
  font-size: clamp(1.5rem, 1.2rem + 1.5vw, 1.95rem);
}
.result-card__title {
  font-size: 1.1rem;
  margin-bottom: var(--s-4);
}
.check-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.check-list li {
  position: relative;
  padding-left: 1.9rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.4;
}
.check-list li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  width: 1.35rem; height: 1.35rem;
  display: grid; place-items: center;
  font-size: 0.78rem; font-weight: 700;
  color: var(--good);
  background: rgba(204, 94, 46, 0.12);
  border-radius: 50%;
}
.check-list strong { color: var(--ink); }

.story { margin: 0; }
.story blockquote {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.45;
  color: var(--ink);
  padding-left: var(--s-4);
  border-left: 3px solid var(--accent);
}
.story figcaption {
  margin-top: var(--s-3);
  padding-left: var(--s-4);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-faint);
}

.sealers {
  list-style: none; padding: 0;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.sealers li { font-size: 0.86rem; color: var(--ink-soft); }

/* ---- Confirmation ------------------------------------------------------- */
.confirm__mark {
  width: 4.4rem; height: 4.4rem;
  margin-inline: auto;
  display: grid; place-items: center;
  font-size: 2.1rem; font-weight: 700;
  color: #fff;
  background: var(--good);
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(204, 94, 46, 0.38);
  animation: pop 0.5s var(--ease) both 0.1s;
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}
.confirm__title { font-size: clamp(1.55rem, 1.3rem + 1.4vw, 2rem); }
.confirm__lead { font-size: 1.05rem; color: var(--ink-soft); max-width: 30rem; margin-inline: auto; }
.confirm__steps {
  text-align: left;
  margin-inline: auto;
  max-width: 26rem;
  padding-left: var(--s-5);
  display: flex; flex-direction: column; gap: var(--s-2);
  color: var(--ink-soft);
  font-size: 0.96rem;
}
.confirm__steps li::marker { color: var(--accent-deep); font-weight: 700; }
.confirm__note {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.06rem;
  color: var(--ink);
}

/* ---- Footer ------------------------------------------------------------- */
.funnel__footer {
  margin-top: auto;
  background: var(--navy-deep);
  color: #C4BDAD;
  padding: var(--s-5);
  font-size: 0.78rem;
  line-height: 1.55;
  display: flex; flex-direction: column; gap: 0.35rem;
}
.funnel__footer strong { color: #F4EFDF; }
.funnel__footer a { color: var(--accent); }
.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin-top: 0.3rem;
}

/* ---- Sticky booking CTA (Screen 5 only — shown/hidden by app.js) -------- */
.sticky-cta {
  position: fixed;
  inset: auto 0 0 0;                 /* pinned to the viewport bottom */
  z-index: 40;                       /* above the progress bar (z-index 30) */
  margin-inline: auto;
  max-width: 552px;                  /* match the .funnel column width */
  padding: var(--s-3) var(--s-4);
  padding-bottom: calc(var(--s-3) + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 22px rgba(18, 32, 59, 0.16);
}
.sticky-cta[hidden] { display: none; }
.sticky-cta .btn { margin: 0; }
/* While the sticky bar is up, pad Screen 5 so the bar never covers content. */
body.sticky-on .screen[data-screen="5"] .screen__body { padding-bottom: 6.5rem; }

/* ---- Placeholder tokens (team fills before launch) ---------------------- */
.ph {
  color: var(--accent-deep);
  border-bottom: 1.5px dotted currentColor;
  font-style: normal;
}
a.ph { text-decoration: none; }

/* ---- Reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    transition-duration: 0.001s !important;
  }
}
