/* ─── FONTS ──────────────────────────────────────────────── */
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/playfair-display.woff2') format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/playfair-display.woff2') format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: italic; font-weight: 400; font-display: swap; src: url('../fonts/playfair-display-italic.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 300; font-display: swap; src: url('../fonts/dm-sans.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/dm-sans.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/dm-sans.woff2') format('woff2'); }
@font-face { font-family: 'DM Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/dm-mono-500.woff2') format('woff2'); }

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  --peach:        #f4a57a;
  --peach-dark:   #e8845a;
  --peach-light:  #fdeade;
  --ink:          #1a1612;
  --ink-mid:      #5c4e44;
  --stone:        #a89a90;
  --cream:        #fdfaf6;
  --paper:        #fffdf9;

  --font-head: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'DM Mono', 'Courier New', Courier, monospace;
}

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--cream); }
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  font-weight: 400;
}
img { max-width: 100%; display: block; }

/* ─── PAGE ───────────────────────────────────────────────── */
.page {
  position: relative;
  min-height: 100vh;    /* fallback */
  min-height: 100svh;   /* small viewport height — stable, no URL-bar/keyboard jitter */
  width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--cream);
}

/* Ambient peach glows, matched to the main site hero */
.glow-wrap { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.glow {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, var(--peach) 0%, transparent 65%);
}
.glow-a { width: 720px; height: 720px; left: -240px; top: -280px; filter: blur(60px); opacity: 0.26; }
.glow-b { width: 560px; height: 560px; right: -200px; bottom: -260px; filter: blur(60px); opacity: 0.22; }

/* Fixed brand header */
.nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  padding: 22px clamp(24px, 5vw, 56px);
  flex: 0 0 auto;
}
.nav-logo { display: inline-flex; align-items: center; gap: 12px; }
.nav-mark { width: 30px; height: 30px; }
.nav-wordmark-img { height: 18px; }

/* Centred content. margin:auto on the inner (rather than justify-content:center)
   keeps it centred but reachable - if a step ever outgrows the viewport it scrolls
   within this area instead of clipping the top. */
.lead {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 8px clamp(24px, 5vw, 56px) 32px;
  min-height: 0;
}
.lead-inner { width: 100%; max-width: 1040px; margin: auto; }

h1 {
  font-family: var(--font-head);
  letter-spacing: -0.02em;
  font-weight: 700;
  font-size: clamp(26px, 4.6vw, 46px);
  line-height: 1.18;
  margin: 0 auto;
  max-width: 100%;
}
/* On narrow screens the forced line break is dropped so the text can reflow naturally */
@media (max-width: 640px) {
  h1 br { display: none; }
}
h1 em { font-style: italic; color: var(--peach-dark); }

/* Bullet points */
.points {
  list-style: none;
  margin: clamp(24px, 4vh, 40px) auto 0;
  display: inline-flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  max-width: 560px;
}
.points li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.4;
  color: var(--ink);
}
.points .tick {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--peach-light);
  color: var(--peach-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.points .tick svg { width: 13px; height: 13px; }

/* ─── WIZARD ─────────────────────────────────────────────── */
.wizard { width: 100%; }

.step { display: none; }
.step.is-active { display: block; animation: stepIn 0.35s ease both; }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .step.is-active { animation: none; }
}

.step-body { margin: 0 auto; width: 100%; max-width: 560px; }
.step-body--intro { margin-top: clamp(26px, 4.5vh, 44px); }

.step-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--peach-dark);
  margin-bottom: 14px;
}
.step-title {
  font-family: var(--font-head);
  letter-spacing: -0.02em;
  font-weight: 700;
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.14;
  margin-bottom: 10px;
}
.step-sub {
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-mid);
  margin: 0 auto 22px;
  max-width: 460px;
}

/* Name label on step 1 */
.form-label {
  display: block;
  text-align: center;
  font-family: var(--font-body);
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 16px;
}

.field-row { display: flex; gap: 14px; }
.field-row + .field-row { margin-top: 14px; }
.field {
  flex: 1 1 0;
  min-width: 0;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid rgba(26, 22, 18, 0.14);
  border-radius: 12px;
  padding: 15px 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
textarea.field { width: 100%; resize: none; line-height: 1.5; }
.field::placeholder { color: var(--stone); }
.field:focus {
  outline: none;
  border-color: var(--peach-dark);
  box-shadow: 0 0 0 3px rgba(232, 132, 90, 0.16);
}

/* Grouped option buttons (revenue, team size, pains) */
.field-group + .field-group { margin-top: 22px; }
.field-group-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-mid);
  margin-bottom: 12px;
}
.field-group-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
}
.option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.option-btn {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid rgba(26, 22, 18, 0.16);
  border-radius: 999px;
  padding: 11px 20px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.option-btn:hover { border-color: var(--peach-dark); }
.option-btn.is-selected {
  background: var(--peach-dark);
  border-color: var(--peach-dark);
  color: #fff;
}
.option-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.option-btn:disabled:hover { border-color: rgba(26, 22, 18, 0.16); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ink);
  color: var(--cream);
  padding: 16px 40px;
  border: none;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease;
}
.btn:hover { background: var(--peach-dark); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn[disabled]:hover { background: var(--ink); }
.btn-ghost {
  background: transparent;
  color: var(--ink-mid);
  padding: 16px 20px;
}
.btn-ghost:hover { background: transparent; color: var(--ink); }

.step-actions {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.step-actions.center { justify-content: center; }

.step-error {
  min-height: 18px;
  margin-top: 14px;
  font-size: 13px;
  color: #c0492b;
}
/* Errors now surface as top-centred toasts, so the inline line collapses when empty. */
.step-error:empty { display: none; }

/* ─── TOASTS ─────────────────────────────────────────────── */
.toasts {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: min(92vw, 460px);
  pointer-events: none;
}
.toast {
  background: #c0392b;
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  padding: 13px 22px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(120, 30, 20, 0.28);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.25s var(--ease-out, ease), transform 0.25s var(--ease-out, ease);
}
.toast.is-visible { opacity: 1; transform: translateY(0); }

/* Progress dots */
.progress {
  margin: 26px auto 0;
  display: flex;
  gap: 8px;
  justify-content: center;
}
.progress .dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(26, 22, 18, 0.16);
  cursor: default;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.25s ease, width 0.25s ease;
}
.progress .dot.is-active { background: var(--peach-dark); width: 22px; border-radius: 999px; }
.progress .dot.is-done { background: var(--peach); }
/* Only completed steps are enabled - they can be clicked to go back. */
.progress .dot:not(:disabled) { cursor: pointer; }
.progress .dot:not(:disabled):hover { background: var(--peach-dark); }
.progress.is-hidden { display: none; }

/* Social proof - tied to the CTA as quiet reassurance (step 1 only) */
.social-proof {
  margin-top: clamp(18px, 3vh, 26px);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink-mid);
  text-align: left;
}
.sp-avatars { display: inline-flex; flex: 0 0 auto; }
.sp-avatars span {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--cream);
  margin-left: -10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: #fff;
  overflow: hidden;
}
.sp-avatars span:first-child { margin-left: 0; }
.sp-avatars img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.sp-avatars .a1 { background: #e8845a; }
.sp-avatars .a2 { background: #c9926f; }
.sp-avatars .a3 { background: #7c6f63; }
.sp-avatars .a4 { background: var(--ink); }
.social-proof strong { color: var(--ink); font-weight: 600; }

/* Thank-you screen */
.done-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: var(--peach-light);
  color: var(--peach-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}
.done-mark svg { width: 30px; height: 30px; }

/* Honeypot - hidden from real users */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 520px) {
  .field-row { flex-direction: column; }
  .points { max-width: 100%; }
}
/* Short viewports: tighten vertical rhythm so nothing clips */
@media (max-height: 720px) {
  .points { gap: 10px; }
  .progress { margin-top: 18px; }
  .step-sub { margin-bottom: 16px; }
}
