/* =========================================================
   Brain Fog Clarity — Design System
   A calm, editorial wellness look: warm cream + deep teal +
   a single warm accent for action. Serif headings for warmth
   and credibility, clean sans body for mobile legibility.
   ========================================================= */

:root {
  /* Color */
  --bg: #FBF7F1;
  --bg-alt: #F3ECDF;
  --surface: #FFFFFF;
  --primary: #1F5F5B;
  --primary-dark: #143F3C;
  --primary-tint: #E4F0EE;
  --accent: #E1723F;
  --accent-dark: #C25A2B;
  --accent-tint: #FBE7DB;
  --text: #2A2A26;
  --text-muted: #6B6B62;
  --border: #E8DFD0;
  --success: #3F7D5C;
  --danger: #B5482F;

  /* Segment tag colors (used only for small accents, not full re-themes) */
  --tag-covid: #4C6B87;
  --tag-perimenopause: #8B5D7A;
  --tag-stress: #C9862F;
  --tag-age: #6B7F52;
  --tag-other: #1F5F5B;

  /* Type */
  --font-heading: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Shape */
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 2px 10px rgba(30, 26, 14, 0.06);
  --shadow-md: 0 12px 32px rgba(30, 26, 14, 0.12);

  /* Layout */
  --w-narrow: 560px;
  --w-page: 760px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  margin: 0 0 12px;
}

h1 { font-size: clamp(28px, 6vw, 42px); }
h2 { font-size: clamp(22px, 4.5vw, 28px); }
h3 { font-size: clamp(18px, 3.6vw, 20px); }

p { margin: 0 0 16px; color: var(--text); }
p.lead { font-size: 18px; color: var(--text-muted); }

a { color: var(--primary); }

.container {
  width: 100%;
  max-width: var(--w-narrow);
  margin: 0 auto;
  padding: 0 20px;
}
.container--wide { max-width: var(--w-page); }

.screen {
  display: none;
  min-height: 100dvh;
  padding: 32px 0 64px;
  animation: fadeIn .35s ease;
}
.screen.is-active { display: block; }

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

/* ---------- Top brand bar ---------- */
.brandbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 0 6px;
}
.brandbar__mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-heading); font-weight: 600; font-size: 15px;
}
.brandbar__name {
  font-family: var(--font-heading); font-weight: 600; font-size: 17px; color: var(--primary-dark);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 22px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 16.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--accent-dark); }
.btn--primary:disabled { background: #D9CFBF; color: #8A8271; cursor: not-allowed; }

.btn--ghost {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--border);
}
.btn--ghost:hover { border-color: var(--primary); }

.btn--sm { width: auto; padding: 10px 16px; font-size: 14.5px; }

.btn--sticky-wrap {
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom));
  z-index: 20;
}

/* True viewport-fixed CTA bar — shown only once the user has scrolled
   past the main offer card (see IntersectionObserver in script.js), and
   only on small screens where reaching the primary CTA takes a real scroll. */
#stickyCta {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 55%, rgba(251,247,241,0));
  z-index: 30;
}
@media (min-width: 640px) {
  #stickyCta { display: none !important; }
}
#bottomSpacer { height: 84px; }
@media (min-width: 640px) {
  #bottomSpacer { height: 0; }
}

/* ---------- Hero ---------- */
.hero { text-align: center; padding-top: 8px; }
.hero__eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-tint);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero__art {
  width: 100%;
  max-width: 320px;
  margin: 22px auto 26px;
}
.hero__stats {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin: 22px 0 6px;
  color: var(--text-muted);
  font-size: 13.5px;
}
.hero__stats b { display: block; color: var(--text); font-family: var(--font-heading); font-size: 19px; }

/* ---------- Quiz ---------- */
.progress {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 26px;
}
.progress__bar {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 999px;
  transition: width .35s ease;
}
.quiz__step-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: .02em;
  margin-bottom: 8px;
}
.quiz__question { margin-bottom: 22px; }

.option-list { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 15px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 15.5px;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.option:hover { border-color: var(--primary); }
.option.is-selected {
  border-color: var(--primary);
  background: var(--primary-tint);
  font-weight: 600;
}
.option__icon {
  width: 20px; height: 20px; flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
}
.option.is-selected .option__icon { border-color: var(--primary); background: var(--primary); }
.option__icon svg { width: 12px; height: 12px; opacity: 0; }
.option.is-selected .option__icon svg { opacity: 1; }

.quiz__nav { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; }
.quiz__back { color: var(--text-muted); font-size: 14.5px; background: none; border: none; cursor: pointer; padding: 8px 0; }

/* ---------- Loading screen ---------- */
.loading { text-align: center; padding-top: 22vh; }
.loading__spinner {
  width: 46px; height: 46px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 3.5px solid var(--border);
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading__lines { text-align: left; max-width: 300px; margin: 26px auto 0; color: var(--text-muted); font-size: 14.5px; }
.loading__lines div { margin-bottom: 10px; display: flex; gap: 10px; align-items: center; opacity: .35; }
.loading__lines div.is-done { opacity: 1; color: var(--text); }
.loading__check { width: 16px; height: 16px; flex: none; }

/* ---------- Email gate ---------- */
.emailgate { text-align: center; }
.emailgate__badge {
  display: inline-block;
  background: var(--accent-tint);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.field {
  width: 100%;
  padding: 15px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-family: var(--font-body);
  background: var(--surface);
  margin-bottom: 12px;
}
.field:focus { outline: none; border-color: var(--primary); }
.emailgate__fineprint { font-size: 12.5px; color: var(--text-muted); margin-top: 10px; }
.emailgate__lock { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--text-muted); font-size: 12.5px; margin-top: 4px; }

/* ---------- Result page ---------- */
.result__tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
  background: var(--primary-tint);
  color: var(--tag-color, var(--primary));
}
.result__tag::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--tag-color, var(--primary));
}
.result__meter {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin: 22px 0;
  box-shadow: var(--shadow-sm);
}
.result__meter-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.result__meter-track { height: 10px; background: var(--bg-alt); border-radius: 999px; overflow: hidden; }
.result__meter-fill { height: 100%; border-radius: 999px; background: var(--tag-color, var(--primary)); }

.section { padding: 44px 0; }
.section--alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.offer {
  text-align: center;
  background: var(--primary-dark);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--shadow-md);
}
.offer h2 { color: #fff; }
.offer p { color: #D9E7E4; }
.offer__price { font-family: var(--font-heading); font-size: 40px; margin: 6px 0 2px; }
.offer__price small { font-size: 16px; font-weight: 400; color: #B9CFCB; text-decoration: line-through; margin-right: 10px; }
.offer__guarantee { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; font-size: 13.5px; color: #D9E7E4; }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.checklist li:last-child { border-bottom: none; }
.checklist__icon { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--primary-tint); color: var(--primary); display: flex; align-items: center; justify-content: center; margin-top: 1px; }

.testimonial {
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  font-size: 14.5px;
  color: var(--text-muted);
  font-style: italic;
}

.faq details {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15.5px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 20px; color: var(--text-muted); font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq p { margin-top: 10px; color: var(--text-muted); font-size: 14.5px; }

.disclaimer {
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 26px 0 40px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.trustrow {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 12.5px;
}
.trustrow span { display: flex; align-items: center; gap: 6px; }

.retake { text-align: center; margin-top: 6px; }
.retake button { background: none; border: none; color: var(--text-muted); font-size: 13.5px; text-decoration: underline; cursor: pointer; }

@media (min-width: 640px) {
  .screen { padding: 56px 0 64px; }
  .checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
}
