:root {
  color-scheme: light;
  --ink: #153832;
  --muted: #667873;
  --forest: #123f37;
  --forest-deep: #0b2f29;
  --forest-light: #e8f2ee;
  --cream: #fbf8f1;
  --paper: #ffffff;
  --gold: #b9914c;
  --coral: #c77d78;
  --line: #d9e4df;
  --shadow: 0 20px 64px rgba(22, 62, 54, 0.13);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, rgba(199, 125, 120, 0.13), transparent 28rem),
    radial-gradient(circle at 95% 15%, rgba(185, 145, 76, 0.14), transparent 25rem),
    #f4f8f6;
  font-family: ui-rounded, "Avenir Next", Avenir, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

button, input, textarea { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }

.survey-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.topbar {
  min-height: 82px;
  display: grid;
  grid-template-columns: 42px 44px 1fr;
  align-items: center;
  gap: 14px;
  padding: 18px clamp(20px, 6vw, 46px);
  border-bottom: 1px solid rgba(220, 230, 226, 0.85);
  background: rgba(255,255,255,0.88);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: var(--cream);
  background: var(--forest);
  border: 1px solid rgba(185, 145, 76, .55);
  font-family: Georgia, serif;
  font-size: 1.35rem;
  font-style: italic;
  box-shadow: 0 8px 20px rgba(23, 75, 67, 0.22);
}

.back-button {
  border: 0;
  background: transparent;
  color: var(--forest);
  font-size: 1.5rem;
  cursor: pointer;
}

.progress-wrap { min-width: 0; }
.progress-label { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.progress-track { height: 7px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: #e7efec; }
.progress-track span { display: block; width: 17%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--forest), var(--gold)); transition: width 320ms ease; }

.step {
  display: none;
  min-height: calc(100vh - 82px);
  padding: clamp(38px, 7vw, 68px) clamp(22px, 7vw, 62px) 60px;
  animation: enter 280ms ease both;
}

.step.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

.welcome { text-align: center; display: none; place-content: center; }
.welcome.active { display: grid; }
.sparkle { color: var(--gold); font-size: 2.2rem; margin-bottom: 8px; }
.eyebrow { margin: 0 0 8px; color: var(--coral); font-size: 0.8rem; font-weight: 900; letter-spacing: 0.11em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; line-height: 1.1; letter-spacing: -0.025em; }
h1 { font-size: clamp(2.5rem, 8vw, 4.5rem); }
h2 { font-size: clamp(2rem, 6vw, 3.25rem); }
h3 { margin: 0 0 4px; font-size: 1.05rem; }
.lead, .section-intro { color: var(--muted); font-size: 1.08rem; }
.lead { max-width: 540px; margin: 20px auto 24px; }
.section-intro { margin: 14px 0 28px; }

.trust-card, .truth-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 18px;
  color: var(--forest);
  background: var(--forest-light);
  text-align: left;
}
.trust-card { max-width: 530px; margin: 0 auto; padding: 16px 18px; }
.trust-card > span { font-size: 1.7rem; }
.trust-card p, .truth-banner p { margin: 0; }
.duration { color: var(--muted); font-size: 0.88rem; }

.primary-button {
  width: 100%;
  min-height: 58px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  padding: 15px 24px;
  border: 0;
  border-radius: 18px;
  color: white;
  background: var(--forest);
  box-shadow: 0 12px 28px rgba(23, 75, 67, 0.22);
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 15px 32px rgba(23, 75, 67, 0.26); }
.primary-button:focus-visible, input:focus-visible, textarea:focus-visible, .choice:has(input:focus-visible), .pill:has(input:focus-visible), .interest-card:has(input:focus-visible) { outline: 3px solid rgba(185, 145, 76, 0.42); outline-offset: 2px; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.field-grid label, .open-field { color: var(--ink); font-weight: 800; }
.field-grid .wide { grid-column: 1 / -1; }
input[type="text"], input[type="email"], input:not([type]), textarea {
  width: 100%;
  margin-top: 7px;
  padding: 15px 16px;
  border: 1.5px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: var(--paper);
}
textarea { resize: vertical; min-height: 94px; }
.privacy-note, .prototype-note, .eligibility { color: var(--muted); font-size: 0.82rem; }
.privacy-promise { display: flex; align-items: flex-start; gap: 9px; padding: 13px 15px; border: 1px solid rgba(185, 145, 76, .28); border-radius: 14px; background: var(--cream); }
.privacy-promise span { color: var(--gold); font-size: 1.2rem; line-height: 1.1; }

fieldset { margin: 34px 0 0; padding: 0; border: 0; }
legend { margin-bottom: 13px; font-size: 1.02rem; font-weight: 900; }
legend small, .open-field small { color: var(--muted); font-weight: 500; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice, .pill, .interest-card { position: relative; cursor: pointer; }
.choice input, .pill input, .interest-card input, .mood-row input { position: absolute; opacity: 0; pointer-events: none; }
.choice span, .pill span {
  min-height: 50px;
  display: grid;
  place-items: center;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  text-align: center;
  font-weight: 700;
  transition: 150ms ease;
}
.choice input:checked + span, .pill input:checked + span { border-color: var(--forest); color: var(--forest); background: var(--forest-light); box-shadow: inset 0 0 0 1px var(--forest); }
.pill-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.pill span { min-height: 44px; display: flex; padding-inline: 16px; border-radius: 999px; }
.conditional-field { display: block; margin-top: 14px; padding: 14px; border-left: 3px solid var(--gold); border-radius: 0 14px 14px 0; background: var(--cream); font-weight: 800; animation: enter 180ms ease both; }
.conditional-field[hidden] { display: none; }
.conditional-field input { min-height: 48px; }

.mood-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.mood-row label { position: relative; cursor: pointer; }
.mood-row span { min-height: 88px; display: grid; place-items: center; gap: 3px; padding: 10px 5px; border: 1.5px solid var(--line); border-radius: 16px; background: white; color: var(--muted); font-size: 0.75rem; text-align: center; }
.mood-row b { font-size: 1.7rem; }
.mood-row input:checked + span { border-color: var(--coral); background: #fff1ed; color: var(--ink); box-shadow: inset 0 0 0 1px var(--coral); }

.truth-banner { margin: 22px 0 2px; padding: 13px 16px; background: #fff4d9; }
.truth-banner span { font-size: 1.4rem; color: var(--gold); }
.open-field { display: block; margin-top: 24px; }

.news-grid { display: grid; gap: 13px; }
.news-card { display: grid; grid-template-columns: 58px 1fr; gap: 15px; padding: 19px; border-radius: 20px; }
.news-card p { margin: 4px 0 8px; color: #536c67; }
.news-card.green { background: var(--forest-light); }
.news-card.gold { background: #fff4d9; }
.news-card.coral { background: #fff0ec; }
.news-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 17px; background: rgba(255,255,255,0.75); color: var(--forest); font-size: 1.15rem; font-weight: 900; }
.text-button { padding: 0; border: 0; color: var(--forest); background: transparent; font-weight: 900; cursor: pointer; }
.flyer-links { display: grid; gap: 8px; margin-top: 12px; }
.flyer-download { display: inline-flex; width: fit-content; min-height: 38px; align-items: center; padding: 8px 12px; border: 1px solid rgba(18, 63, 55, .22); border-radius: 11px; color: var(--forest); background: rgba(255,255,255,.72); font-size: .88rem; font-weight: 900; text-decoration: none; }
.flyer-download:hover { border-color: var(--forest); background: white; }

.interest-grid { display: grid; gap: 11px; }
.interest-card { min-height: 78px; display: grid; grid-template-columns: 46px 1fr; align-items: center; gap: 13px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 18px; background: white; transition: 160ms ease; }
.interest-card:has(input:checked) { border-color: var(--forest); background: var(--forest-light); box-shadow: inset 0 0 0 1px var(--forest); transform: translateX(3px); }
.interest-card.soft { background: #f8faf9; }
.interest-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: white; background: var(--forest); font-weight: 900; }
.interest-card strong, .interest-card small { display: block; }
.interest-card small { margin-top: 2px; color: var(--muted); font-size: 0.83rem; }

.branch-summary { display: none; margin: 22px 0 8px; padding: 16px 18px; border-radius: 18px; background: var(--forest-light); }
.branch-summary.visible { display: block; }
.branch-summary p { margin: 0 0 6px; font-weight: 900; }
.branch-summary ul { margin: 0; padding-left: 20px; color: var(--muted); }
.branch-questions { display: grid; gap: 12px; margin-top: 20px; }
.branch-question { padding: 16px; border: 1.5px solid var(--line); border-radius: 18px; background: white; }
.branch-question p { margin: 0 0 11px; font-weight: 900; }
.branch-question .choice-grid { grid-template-columns: repeat(3, 1fr); }
.branch-question .choice span { min-height: 43px; padding: 8px; font-size: .86rem; }
.consent-line { display: flex; align-items: flex-start; gap: 11px; margin-top: 26px; padding: 16px; border-radius: 15px; background: #f4f7f6; cursor: pointer; }
.consent-line input { width: 20px; height: 20px; flex: none; accent-color: var(--forest); }
.data-consent { margin-top: 16px; border: 1px solid rgba(23, 75, 67, .2); background: var(--forest-light); }
.data-consent strong { display: inline; }
.submit-status { min-height: 24px; margin: 12px 0 0; color: #9f3d35; font-weight: 800; text-align: center; }
.primary-button:disabled { cursor: wait; opacity: .7; transform: none; }

.success-screen { text-align: center; place-content: center; }
.success-screen.active { display: grid; }
.success-heart { width: 76px; height: 76px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 50%; background: var(--forest-light); color: var(--forest); font-size: 2.6rem; }
.success-screen p:not(.eyebrow) { max-width: 520px; color: var(--muted); font-size: 1.08rem; }
.signature { margin-top: 25px; font-family: Georgia, serif; font-size: 1.15rem; }

dialog { width: min(calc(100% - 30px), 520px); padding: 0; border: 0; border-radius: 24px; box-shadow: 0 30px 90px rgba(12, 45, 39, 0.35); }
dialog::backdrop { background: rgba(13, 42, 38, 0.62); backdrop-filter: blur(4px); }
.dialog-close { position: absolute; top: 10px; right: 12px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255,255,255,0.82); color: var(--forest); font-size: 1.5rem; cursor: pointer; }
.document-preview { min-height: 520px; padding: 62px 38px; color: white; background: linear-gradient(145deg, #123f38, #23695d); }
.document-preview .eyebrow { color: #ffd99a; }
.document-preview h2 { font-size: 3.2rem; }
.document-preview p { font-size: 1.05rem; }
.document-badge { display: inline-block; margin-bottom: 54px; padding: 6px 10px; border: 1px solid rgba(255,255,255,.5); border-radius: 999px; font-size: .7rem; font-weight: 900; letter-spacing: .1em; }
.document-lines { display: grid; gap: 12px; margin-top: 40px; }
.document-lines span { height: 44px; border-radius: 13px; background: rgba(255,255,255,.13); }

@media (max-width: 560px) {
  .survey-shell { box-shadow: none; }
  .topbar { grid-template-columns: 34px 40px 1fr; padding-inline: 16px; gap: 10px; }
  .back-button { padding: 0; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .wide { grid-column: auto; }
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .mood-row { grid-template-columns: 1fr 1fr; }
  .news-card { grid-template-columns: 48px 1fr; padding: 16px; }
  .news-icon { width: 46px; height: 46px; }
  .branch-question .choice-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
