/* Shared by the landing page (index.html) and the signup form (api/signup.ts). */

:root {
  --bg: #f5f3ec;
  --surface: #ffffff;
  --surface-2: #efece3;
  --ink: #15201b;
  --muted: #5a665f;
  --line: #e1ddd1;
  --brand: #1d5a42;
  --brand-strong: #154532;
  --brand-ink: #ffffff;
  --brand-soft: rgba(29, 90, 66, 0.09);
  --amber: #d98a1c;
  --amber-soft: rgba(217, 138, 28, 0.14);
  --danger: #b3372b;
  --bubble-in: #e9e6dc;
  --shadow: 0 1px 2px rgba(21, 32, 27, 0.05), 0 8px 24px rgba(21, 32, 27, 0.06);
  --radius: 14px;
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1311;
    --surface: #151c19;
    --surface-2: #1b2420;
    --ink: #edf2ee;
    --muted: #9ba79f;
    --line: #26312c;
    --brand: #5cc394;
    --brand-strong: #7fd4ac;
    --brand-ink: #062015;
    --brand-soft: rgba(92, 195, 148, 0.12);
    --amber: #f0b453;
    --amber-soft: rgba(240, 180, 83, 0.14);
    --danger: #f2766a;
    --bubble-in: #232d29;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0; }
a { color: var(--brand); }
img, svg { display: block; }
::selection { background: var(--brand); color: var(--brand-ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.eyebrow {
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand);
}
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1 var(--text); text-decoration: none; white-space: nowrap;
  padding: 14px 22px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-strong); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-small { padding: 10px 16px; font-size: 14px; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.link-button {
  background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer;
}
.link-button:hover { color: var(--danger); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 66px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.logo-mark { width: 32px; height: 32px; flex-shrink: 0; }
.logo-word { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.logo-sub { color: var(--muted); font-size: 13.5px; padding-left: 10px; border-left: 1px solid var(--line); }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a:not(.btn) { color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 500; }
.nav a:not(.btn):hover { color: var(--ink); }
@media (max-width: 860px) {
  .nav a:not(.btn), .logo-sub { display: none; }
}

/* ---------- Landing: hero ---------- */
.hero { padding: 72px 0 84px; }
.hero .container { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(38px, 4.9vw, 58px); margin: 14px 0 20px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.lede { font-size: clamp(17px, 1.6vw, 19.5px); color: var(--muted); max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-note { margin-top: 18px; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.hero-note svg { color: var(--brand); flex-shrink: 0; }
@media (max-width: 900px) {
  .hero { padding: 44px 0 56px; }
  .hero .container { grid-template-columns: 1fr; gap: 44px; }
}

/* Example conversation */
.phone {
  justify-self: center; width: 100%; max-width: 380px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 30px; padding: 14px;
  box-shadow: var(--shadow), 0 30px 60px -30px rgba(21, 32, 27, 0.25);
}
.phone-top {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 14px; border-bottom: 1px solid var(--line);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.phone-top strong { display: block; font-size: 14.5px; line-height: 1.2; }
.phone-top span { font-size: 12px; color: var(--muted); }
.thread { display: flex; flex-direction: column; gap: 8px; padding: 16px 6px 8px; }
.stamp { align-self: center; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.bubble { max-width: 82%; padding: 9px 13px; border-radius: 18px; font-size: 14px; line-height: 1.42; }
.bubble.in { align-self: flex-start; background: var(--bubble-in); border-bottom-left-radius: 6px; }
.bubble.out { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 6px; }
.event-chip {
  align-self: center; margin-top: 8px; display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--brand); background: var(--brand-soft);
  padding: 7px 12px; border-radius: 999px;
}
.phone-caption { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 12px; }

/* ---------- Landing: sections ---------- */
.band { padding: 88px 0; border-top: 1px solid var(--line); scroll-margin-top: 66px; }
.band.alt { background: var(--surface); }
.band-head { max-width: 680px; margin-bottom: 44px; }
.band-head h2 { font-size: clamp(30px, 3.6vw, 42px); margin-top: 10px; }
.band-head p { color: var(--muted); font-size: 17.5px; margin-top: 14px; }
@media (max-width: 700px) { .band { padding: 60px 0; } }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
}
.band.alt .feature { background: var(--bg); }
.feature-icon {
  width: 42px; height: 42px; border-radius: 11px; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; margin-bottom: 18px;
}
.feature h3 { font-size: 19px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 15px; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .features { grid-template-columns: 1fr; } }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.step { position: relative; padding: 28px 26px 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.band.alt .step { background: var(--bg); }
.step-num {
  font-family: var(--display); font-weight: 800; font-size: 15px; color: var(--brand-ink); background: var(--brand);
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 18px;
}
.step h3 { font-size: 19px; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 15px; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } }

.proof {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 32px; align-items: start;
  background: var(--brand); color: var(--brand-ink); border-radius: 22px; padding: 44px;
}
.proof .eyebrow { color: inherit; opacity: 0.8; }
.proof h2 { font-size: clamp(26px, 3vw, 36px); margin: 10px 0 14px; }
.proof p { font-size: 17px; opacity: 0.92; max-width: 44em; }
.proof-badge {
  width: 64px; height: 64px; border-radius: 16px; background: rgba(255, 255, 255, 0.14);
  display: grid; place-items: center;
}
@media (prefers-color-scheme: dark) { .proof-badge { background: rgba(0, 0, 0, 0.12); } }
@media (max-width: 700px) { .proof { grid-template-columns: 1fr; padding: 30px 24px; gap: 18px; } }

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.plan {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 26px;
}
.plan-level { display: flex; gap: 5px; margin-bottom: 18px; }
.plan-level span { width: 22px; height: 6px; border-radius: 3px; background: var(--line); }
.plan-level span.on { background: var(--brand); }
.plan h3 { font-size: 21px; margin-bottom: 10px; }
.plan > p { color: var(--muted); font-size: 15px; }
.plan ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 9px; font-size: 14.5px; }
.plan li { display: flex; gap: 9px; align-items: flex-start; }
.plan li svg { color: var(--brand); margin-top: 4px; flex-shrink: 0; }
.plan li.plus { color: var(--muted); }
.plan-setup { margin-top: auto; padding-top: 20px; font-size: 13.5px; color: var(--muted); }
.plans-note {
  margin-top: 26px; padding: 18px 22px; border-radius: 12px; background: var(--amber-soft);
  font-size: 15px; display: flex; gap: 12px; align-items: flex-start;
}
.plans-note svg { color: var(--amber); flex-shrink: 0; margin-top: 3px; }
@media (max-width: 900px) { .plans { grid-template-columns: 1fr; } }

.faq { max-width: 780px; display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.band.alt .faq details { background: var(--bg); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 22px; font-weight: 600; font-size: 16.5px;
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--display); font-size: 22px; line-height: 1; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 22px 20px; color: var(--muted); }

.cta-band { padding: 80px 0 96px; text-align: center; border-top: 1px solid var(--line); }
.cta-band h2 { font-size: clamp(30px, 3.8vw, 44px); }
.cta-band p { color: var(--muted); font-size: 17.5px; margin: 14px auto 28px; max-width: 34em; }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 13.5px; color: var(--muted); }
.site-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Signup form ---------- */
.form-hero { padding: 48px 0 28px; }
.form-hero h1 { font-size: clamp(32px, 4.4vw, 48px); margin: 10px 0 14px; }
.form-hero .lede { max-width: 40em; }
.reassure { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 20px; font-size: 14px; color: var(--muted); }
.reassure span { display: inline-flex; align-items: center; gap: 7px; }
.reassure svg { color: var(--brand); }

.progress-bar {
  position: sticky; top: 66px; z-index: 30;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.progress-bar .container { display: flex; align-items: center; gap: 16px; height: 50px; font-size: 13.5px; color: var(--muted); }
#progress-label { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.progress-track { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--brand); border-radius: 3px; transition: width 0.3s ease; }
#save-indicator { white-space: nowrap; min-width: 9em; text-align: right; }
@media (max-width: 600px) { #save-indicator { display: none; } }

.form-layout {
  display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start; padding-top: 28px; padding-bottom: 96px;
}
.rail { position: sticky; top: 136px; }
.rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rail a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
}
.rail a:hover { color: var(--ink); background: var(--surface); }
.rail a.active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }
.rail .dot {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); flex-shrink: 0;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted);
}
.rail a.active .dot { border-color: var(--brand); color: var(--brand); }
.rail .dot.done { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.rail .frac { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; }

@media (max-width: 960px) {
  .form-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 0; }
  .rail {
    top: 116px; z-index: 20; margin: 0 -20px 20px; padding: 10px 20px;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .rail ol { display: flex; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .rail ol::-webkit-scrollbar { display: none; }
  .rail a { white-space: nowrap; padding: 7px 12px; }
  .rail .frac { display: none; }
}

.form-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 32px 34px 14px; margin-bottom: 22px; scroll-margin-top: 136px; box-shadow: var(--shadow);
}
@media (max-width: 960px) { .form-card { scroll-margin-top: 180px; } }
@media (max-width: 600px) { .form-card { padding: 24px 20px 8px; border-radius: 14px; } }
.form-card-head { display: flex; align-items: baseline; gap: 14px; }
.form-card-head .num { font-family: var(--display); font-weight: 800; font-size: 15px; color: var(--brand); font-variant-numeric: tabular-nums; }
.form-card-head h2 { font-size: 25px; }
.form-card .intro { color: var(--muted); margin-top: 12px; max-width: 46em; font-size: 15.5px; }

.field { padding: 22px 0; border-top: 1px solid var(--line); }
.form-card-head + .field, .intro + .field { border-top: 0; }
.field[hidden] { display: none; }
.field-label, .field legend { display: block; font-weight: 600; font-size: 16px; line-height: 1.4; padding: 0; margin-bottom: 4px; }
.req { color: var(--danger); font-weight: 600; margin-left: 2px; }
.help { color: var(--muted); font-size: 14.5px; margin-bottom: 10px; max-width: 46em; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="url"],
.field textarea, .field select {
  width: 100%; margin-top: 6px; font: 15.5px/1.5 var(--text); color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { resize: vertical; min-height: 4.8em; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--surface);
}
.field ::placeholder { color: var(--muted); opacity: 0.75; }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--danger); }
.error { color: var(--danger); font-size: 14px; font-weight: 500; margin-top: 8px; }
.error[hidden] { display: none; }

.choices { display: grid; gap: 8px; margin-top: 6px; }
.choices.inline { display: flex; flex-wrap: wrap; }
.choice {
  position: relative; display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.choice:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .mark {
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--muted); flex-shrink: 0; margin-top: 2px;
  display: grid; place-items: center; background: var(--surface);
}
.choice input:checked ~ .mark { border-color: var(--brand); }
.choice input:checked ~ .mark::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.choice input:focus-visible ~ .mark { outline: 2px solid var(--brand); outline-offset: 2px; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice-text { display: grid; gap: 3px; font-size: 15px; line-height: 1.4; }
.choice-label { font-weight: 500; }
.choice:has(input:checked) .choice-label { font-weight: 600; }
.choice-desc { color: var(--muted); font-size: 14px; line-height: 1.5; }
.choices.rich .choice { padding: 16px 18px; }
.choices.rich .choice-label { font-family: var(--display); font-weight: 700; font-size: 17px; }

.detail { margin-top: 12px; padding-left: 14px; border-left: 2px solid var(--brand-soft); }
.detail[hidden] { display: none; }
.detail label { display: block; font-size: 14.5px; font-weight: 500; color: var(--muted); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.review-card { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.review-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 2px; }
.review-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.review-list li:first-child { border-top: 0; }
.review-list a { color: var(--ink); text-decoration: none; font-weight: 500; }
.review-list a:hover { color: var(--brand); }
.review-list .count { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.review-list .count.missing { color: var(--danger); font-weight: 600; }
.submit-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 24px 0 22px; }
.fine-print { font-size: 13.5px; color: var(--muted); max-width: 40em; }
.form-status {
  margin: 4px 0 18px; padding: 14px 16px; border-radius: 10px; font-size: 15px;
  background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); font-weight: 500;
}
.form-status[hidden] { display: none; }

.done {
  max-width: 640px; margin: 64px auto 120px; text-align: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: 22px; padding: 52px 40px; box-shadow: var(--shadow);
}
.done[hidden] { display: none; }
.done-icon {
  width: 60px; height: 60px; border-radius: 50%; background: var(--brand); color: var(--brand-ink);
  display: grid; place-items: center; margin: 0 auto 22px;
}
.done h1 { font-size: clamp(28px, 3.6vw, 38px); margin-bottom: 14px; }
.done p { color: var(--muted); font-size: 17px; }
.done p + p { margin-top: 12px; }
.done-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
@media (max-width: 600px) { .done { padding: 40px 22px; margin-top: 32px; } }

/* Logo mark (inline SVG, colored from the theme tokens) */
.logo-mark .bg { fill: var(--brand); }
.logo-mark .bubble { fill: var(--brand-ink); }
.logo-mark .tick { fill: none; stroke: var(--brand); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
