/* =========================================================
   KetoType Quiz V2 — Sophisticated off-white / dark text
   Mobile-first · Photo on SIDE of each question (desktop)
   Breakpoints: 375 / 768 / 1024 / 1440
   ========================================================= */

:root {
  /* Palette: cream + ink + sage accent */
  --bg:           #f5efe6;   /* warm off-white */
  --bg-2:         #ede4d3;   /* slightly deeper */
  --ink:          #1c1b18;   /* near-black */
  --ink-2:        #4a4742;
  --ink-3:        #7a766e;
  --line:         #d9cfbc;
  --sage:         #5a7a5a;
  --sage-deep:    #3d5a3d;
  --gold:         #b89149;
  --card:         #ffffff;
  --card-hover:   #fbf6ec;
  --shadow-sm:    0 1px 2px rgba(28,27,24,.06), 0 2px 6px rgba(28,27,24,.04);
  --shadow-md:    0 4px 16px rgba(28,27,24,.08), 0 12px 32px rgba(28,27,24,.06);
  --shadow-lg:    0 24px 64px rgba(28,27,24,.12);
  --radius-sm:    10px;
  --radius:       16px;
  --radius-lg:    24px;
  --container:    1180px;
  --ease:         cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.container {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ==================== TYPOGRAPHY ==================== */
h1, h2, h3, h4 {
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 .4em;
}
h1 em { font-style: italic; color: var(--sage-deep); }

.kicker {
  font-size: 11px;
  letter-spacing: .22em;
  font-weight: 600;
  color: var(--sage-deep);
  text-transform: uppercase;
  margin: 0 0 18px;
}

/* ==================== BUTTONS ==================== */
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 15px;
  transition: transform .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease), color .25s var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.btn-sm { padding: 10px 16px; font-size: 13px; }
.btn-lg { padding: 18px 28px; font-size: 16px; }
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--sage-deep);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--bg-2); }

.cta-pulse {
  animation: ctaPulse 2.4s ease-in-out infinite;
}
@keyframes ctaPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(90,122,90,.45); }
  50%     { box-shadow: 0 0 0 14px rgba(90,122,90,0); }
}

.link-button {
  background: none; border: 0; cursor: pointer;
  color: var(--sage-deep); font: inherit; padding: 0;
  text-decoration: underline;
}

/* ==================== TOPBAR ==================== */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: saturate(140%) blur(8px);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--ink); color: var(--bg);
  display: grid; place-items: center;
  font-family: 'Fraunces', serif; font-weight: 700;
}
.brand-name { font-family: 'Fraunces', serif; font-weight: 700; font-size: 18px; }
.brand-dot { color: var(--sage); }
.ftc { margin: 0; font-size: 11px; color: var(--ink-3); }
.ftc a { color: var(--ink-2); text-decoration: underline; }

/* ==================== SCREENS ==================== */
.screen { display: none; padding: 40px 0 80px; }
.screen.active { display: block; }

/* ==================== HERO ==================== */
.screen-hero { padding-top: 32px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
}
.hero-title { font-size: clamp(38px, 6vw, 64px); margin-bottom: 18px; }
.hero-sub { font-size: 18px; color: var(--ink-2); max-width: 540px; }
.hero-sub strong { color: var(--ink); }
.hero-bullets { list-style: none; padding: 0; margin: 28px 0; display: grid; gap: 10px; }
.hero-bullets li {
  display: flex; align-items: center; gap: 12px;
  font-size: 15px; color: var(--ink-2);
}
.bullet-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--sage);
  flex: none;
}
.hero-meta { font-size: 12px; color: var(--ink-3); margin-top: 14px; }

.hero-photo {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/5;
  box-shadow: var(--shadow-md);
}
.hero-photo img {
  width: 100%; height: 100%; object-fit: cover;
}
.hero-photo-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(28,27,24,.18), rgba(28,27,24,0) 60%);
}

/* ==================== QUIZ ==================== */
.screen-quiz { padding-top: 32px; }

.progress-wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 32px;
}
.progress-track {
  flex: 1;
  height: 6px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--sage), var(--sage-deep));
  border-radius: 999px;
  transition: width .5s var(--ease);
}
.progress-label {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.quiz-stage { position: relative; min-height: 60vh; }

.question { display: none; }
.question.active {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  animation: fadeUp .5s var(--ease) both;
}

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

.question-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: center;
}

.question-body { max-width: 640px; }
.q-eyebrow {
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--sage-deep); font-weight: 600; margin: 0 0 14px;
}
.q-title { font-size: clamp(28px, 4.4vw, 42px); margin-bottom: 12px; }
.q-sub { font-size: 16px; color: var(--ink-2); margin: 0 0 28px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.opt-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px;
  display: flex; align-items: center; gap: 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
  box-shadow: var(--shadow-sm);
}
.opt-card:hover {
  transform: translateY(-3px);
  border-color: var(--sage);
  background: var(--card-hover);
  box-shadow: var(--shadow-md);
}
.opt-card:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
}
.opt-emoji {
  font-size: 22px;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--bg-2);
  display: grid; place-items: center;
  flex: none;
}
.opt-text { line-height: 1.3; }

.question-photo {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/5;
  box-shadow: var(--shadow-md);
}
.question-photo img { width: 100%; height: 100%; object-fit: cover; }

/* Email form */
.email-form {
  display: grid; gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.email-input {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
}
.email-input:focus {
  outline: 2px solid var(--sage);
  outline-offset: 2px;
  border-color: var(--sage);
}
.consent-row {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--ink-2);
  line-height: 1.4;
}
.consent-row input { margin-top: 2px; accent-color: var(--sage-deep); }
.email-fine { margin: 0; font-size: 11px; color: var(--ink-3); }

/* ==================== LOADING ==================== */
.screen-loading { text-align: center; padding: 80px 0; }
.loading-wrap { max-width: 480px; margin: 0 auto; }
.loading-pulse {
  width: 64px; height: 64px;
  border-radius: 50%;
  margin: 0 auto 24px;
  background: var(--sage);
  animation: loadPulse 1.6s ease-in-out infinite;
}
@keyframes loadPulse {
  0%   { transform: scale(.7); opacity: .5; box-shadow: 0 0 0 0 rgba(90,122,90,.5); }
  60%  { transform: scale(1);   opacity: 1; }
  100% { transform: scale(.7); opacity: .5; box-shadow: 0 0 0 30px rgba(90,122,90,0); }
}
.loading-msg { font-family: 'Fraunces', serif; font-size: 22px; margin: 0 0 6px; }
.loading-sub { color: var(--ink-3); margin: 0; font-size: 14px; }

/* ==================== RESULT ==================== */
.screen-result { padding-top: 32px; }
.result-card {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.result-photo {
  aspect-ratio: 4/3;
  overflow: hidden;
}
.result-photo img { width: 100%; height: 100%; object-fit: cover; }
.result-body { padding: 32px 28px; }
.result-eyebrow {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--sage-deep); font-weight: 700; margin: 0 0 14px;
}
.result-title { font-size: clamp(28px, 4.2vw, 38px); margin-bottom: 12px; }
.result-tagline { color: var(--ink-2); font-size: 17px; margin: 0 0 24px; }
.result-divider {
  height: 1px; background: var(--line); margin: 0 0 24px;
}
.result-body-copy { color: var(--ink-2); margin: 0 0 20px; }
.result-actions {
  list-style: none; padding: 0; margin: 0 0 28px;
  display: grid; gap: 10px;
}
.result-actions li {
  padding-left: 26px; position: relative;
  color: var(--ink-2); font-size: 15px;
}
.result-actions li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--sage);
}
.result-fine { margin-top: 14px; font-size: 11px; color: var(--ink-3); }

.result-foot {
  text-align: center;
  margin-top: 28px;
  color: var(--ink-3);
  font-size: 14px;
}

/* ==================== RESULT — PRICE ANCHOR (Fix 9) ==================== */
.result-price-anchor {
  display: flex; align-items: baseline; gap: 12px;
  margin: 4px 0 18px;
  flex-wrap: wrap;
}
.result-price-anchor .price-strike {
  font-size: 18px; color: var(--ink-3); text-decoration: line-through;
}
.result-price-anchor .price-now {
  font-family: 'Fraunces', serif;
  font-size: 36px; font-weight: 700; color: var(--sage-deep);
  line-height: 1;
}
.result-price-anchor .price-save {
  font-size: 12px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: #fff; background: var(--gold);
  padding: 4px 10px; border-radius: 999px;
}

/* ==================== RESULT — TESTIMONIALS (Fix 10) ==================== */
.result-proof {
  margin-top: 48px;
}
.result-proof .proof-eyebrow {
  font-family: 'Fraunces', serif;
  font-size: 22px; font-weight: 600;
  text-align: center; color: var(--ink);
  margin: 0 0 28px;
}
.result-proof .proof-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.proof-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin: 0;
  box-shadow: var(--shadow-sm);
}
.proof-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--sage);
  color: var(--bg);
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
  font-family: 'Inter', sans-serif;
  margin-bottom: 14px;
}
.proof-card blockquote {
  margin: 0 0 12px;
  font-size: 15px; color: var(--ink-2);
  line-height: 1.55;
  font-style: italic;
}
.proof-card figcaption {
  font-size: 13px; color: var(--ink-3);
}
.proof-card figcaption strong { color: var(--ink); }

@media (min-width: 768px) {
  .result-proof .proof-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ==================== COOKIE INLINE STRIP (Fix 4) ==================== */
.cookie-inline {
  position: fixed; left: 16px; right: 16px; top: 16px;
  z-index: 50;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
  display: none;
  align-items: center; justify-content: space-between; gap: 12px;
  font-size: 13px;
}
.cookie-inline.show { display: flex; animation: fadeUp .4s var(--ease); }
.cookie-inline a { color: var(--sage-deep); text-decoration: underline; }

/* ==================== FOOTER ==================== */
.footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  margin-top: 60px;
  font-size: 12px;
  color: var(--ink-3);
}
.footer-inner {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.footer a { text-decoration: underline; }

/* ==================== COOKIE BANNER ==================== */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px;
  z-index: 50;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-lg);
  display: none;
}
.cookie-banner.show { display: block; animation: fadeUp .4s var(--ease); }
.cookie-inner {
  display: grid; gap: 14px;
  align-items: center;
}
.cookie-text { margin: 0; font-size: 13px; line-height: 1.5; }
.cookie-link { color: var(--gold); text-decoration: underline; }
.cookie-actions { display: flex; gap: 8px; }
.cookie-actions .btn-ghost {
  color: var(--bg);
  border-color: rgba(245,239,230,.3);
}
.cookie-actions .btn-ghost:hover {
  background: rgba(245,239,230,.08);
}
.cookie-actions .btn-primary {
  background: var(--sage);
  color: var(--bg);
}
.cookie-actions .btn-primary:hover {
  background: var(--sage-deep);
}

/* =========================================================
   BREAKPOINTS
   ========================================================= */

/* 768px — tablet & up: photo moves to SIDE of question */
@media (min-width: 768px) {
  .screen { padding: 56px 0 96px; }

  .question-grid {
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
  }
  .question-photo {
    aspect-ratio: 3/4;
    order: 1; /* photo on the SIDE (right on desktop) */
  }
  .question-body { order: 0; }

  .hero-grid {
    grid-template-columns: 1.1fr 1fr;
    gap: 56px;
  }
  .hero-photo { aspect-ratio: 4/5; }

  .cookie-inner { grid-template-columns: 1fr auto; }

  .result-card { grid-template-columns: 1fr 1.1fr; }
  .result-photo { aspect-ratio: auto; height: 100%; min-height: 480px; }
  .result-body { padding: 48px 44px; }
}

/* 1024px */
@media (min-width: 1024px) {
  .question-grid { grid-template-columns: 1.25fr 1fr; gap: 64px; }
  .card-grid { gap: 16px; }
  .opt-card { padding: 22px; font-size: 16px; }
  .opt-emoji { width: 44px; height: 44px; font-size: 24px; }
}

/* 1440px — large desktop polish */
@media (min-width: 1440px) {
  :root { --container: 1280px; }
  .question-grid { gap: 80px; }
  .hero-title { font-size: 72px; }
}

/* Mobile-first refinements (under 768) */
@media (max-width: 767px) {
  .hero-photo { aspect-ratio: 16/11; order: -1; }
  .card-grid { grid-template-columns: 1fr; }
  .opt-card { padding: 16px; }
  .question-photo { aspect-ratio: 16/10; }
  .topbar-inner { justify-content: center; text-align: center; }
  .ftc { font-size: 10px; }
  .result-body { padding: 24px 20px; }
  .btn-lg { width: 100%; }
}

@media (max-width: 374px) {
  .hero-title { font-size: 34px; }
  .q-title { font-size: 26px; }
}

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