/* ─── Variables — Leafline brand palette ─── */
:root {
  --espresso:   #3C2415;
  --cream:      #F5F0E8;
  --black:      #1A1A1A;
  --gold:       #C9A84C;
  --olive:      #7A8B6A;
  --bg:         #F5F0E8;
  --card:       #FFFFFF;
  --border:     #E2DAD0;
  --radius:     12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--espresso);
  font-family: 'DM Sans', system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  line-height: 1.1;
}

/* ─── Nav ─── */
.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  flex-wrap: wrap;
  gap: 8px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--espresso);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav-tagline {
  font-size: 0.78rem;
  color: var(--olive);
  letter-spacing: 0.06em;
  font-weight: 400;
}

.nav-account {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--espresso);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.nav-account:hover { color: var(--gold); }

.nav-account--signed-in {
  max-width: clamp(120px, 22vw, 220px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--olive);
}

.nav-account--signed-in:hover { color: var(--gold); }

/* Anonymous cart badge — mirrors .nav-account typography so the badge
   reads as part of the same nav strip across every page. The count
   span is updated in place by public/js/product.js on a successful
   Add-to-Cart click — no full page reload. */
.nav-cart {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--espresso);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.nav-cart:hover { color: var(--gold); }

.nav-cart-count {
  font-feature-settings: 'tnum';
  margin-left: 2px;
}

/* ─── Hero Image ─── */
.quiz-hero-img {
  width: 100%;
  max-height: 280px;
  overflow: hidden;
}

.quiz-hero-img img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: center 60%;
  display: block;
}

/* ─── Quiz Wrapper ─── */
.quiz-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
}

.quiz-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 560px;
  width: 100%;
  animation: fadeIn 0.3s ease;
}

.quiz-screen.active { display: flex; }

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

.quiz-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--olive);
  font-weight: 500;
  margin-bottom: 16px;
}

.quiz-screen h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 36px;
  color: var(--espresso);
}

.quiz-screen h1 {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  margin-bottom: 20px;
  color: var(--espresso);
}

.quiz-sub {
  font-size: 1rem;
  color: #6B5A47;
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 420px;
}

.quiz-meta {
  margin-top: 16px;
  font-size: 0.78rem;
  color: #9A8A7A;
}

/* ─── Progress Bar ─── */
.quiz-progress {
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 28px;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ─── Options ─── */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.quiz-option {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--espresso);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s, transform 0.1s;
  width: 100%;
}

.quiz-option:hover {
  border-color: var(--gold);
  background: #FDFBF7;
  transform: translateX(4px);
}

.quiz-option:active { transform: scale(0.99); }

/* ─── Primary Button ─── */
.btn-primary {
  background: var(--espresso);
  color: var(--cream);
  border: none;
  border-radius: var(--radius);
  padding: 14px 36px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.02em;
}

.btn-primary:hover { background: #2A1A0D; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

/* ─── Secondary Button ─── */
.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--espresso);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 32px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.btn-secondary:hover { border-color: var(--espresso); background: rgba(60,36,21,0.04); }

/* ─── Subscribe Button ─── */
.btn-subscribe {
  display: inline-block;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 16px 40px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background 0.2s, transform 0.1s;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(201,168,76,0.3);
}

.btn-subscribe:hover { background: #B8933D; transform: translateY(-1px); }
.btn-subscribe:active { transform: scale(0.98); }

/* ─── Loading Ring ─── */
.quiz-loading-ring {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Result Wrapper ─── */
.result-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 72px;
  gap: 32px;
}

/* ─── Result Card ─── */
.result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 48px 40px;
  max-width: 560px;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 32px rgba(60,36,21,0.08);
  animation: fadeIn 0.4s ease;
}

.result-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--olive);
  font-weight: 500;
  margin-bottom: 16px;
}

.result-ritual-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 100px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--espresso);
  margin-bottom: 24px;
}

.ritual-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.result-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--espresso);
  margin-bottom: 16px;
}

.result-description {
  font-size: 0.92rem;
  color: #6B5A47;
  line-height: 1.75;
  margin-bottom: 32px;
}

.result-divider {
  width: 40px;
  height: 1px;
  background: var(--gold);
  margin: 0 auto 24px;
}

.result-sub {
  font-size: 0.88rem;
  color: #8A7A6A;
  line-height: 1.6;
}

/* ─── Plans Link (quiz result) ─── */
.result-plans-link {
  font-size: 0.82rem;
  margin-top: 4px;
  margin-bottom: 4px;
}

.result-plans-link a {
  color: var(--olive);
  text-decoration: none;
}

.result-plans-link a:hover { text-decoration: underline; }

/* ─── Plans Link (waitlist) ─── */
.waitlist-plans-link {
  font-size: 0.82rem;
  margin-top: 12px;
  color: #8A7A6A;
}

.waitlist-plans-link a {
  color: var(--olive);
  text-decoration: none;
}

.waitlist-plans-link a:hover { text-decoration: underline; }

/* ─── Notify Form ─── */
.notify-form {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.notify-fields {
  display: flex;
  gap: 12px;
  width: 100%;
}

.notify-fields input {
  flex: 1;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--espresso);
  outline: none;
  transition: border-color 0.2s;
}

.notify-fields input::placeholder { color: #9A8A7A; }
.notify-fields input:focus { border-color: var(--gold); }

.notify-fields .btn-primary { flex-shrink: 0; }

.notify-msg {
  font-size: 0.82rem;
  min-height: 20px;
  text-align: center;
}

.notify-msg.error { color: #8B3A3A; }
.notify-msg.success { color: var(--olive); }

/* ─── Confirmation Screen ─── */
.confirm-screen {
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 440px;
  gap: 20px;
  animation: fadeIn 0.5s ease;
}

.confirm-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(122,139,106,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-screen h2 {
  font-size: 2rem;
  color: var(--espresso);
}

.confirm-screen p {
  font-size: 0.9rem;
  color: #6B5A47;
  line-height: 1.7;
}

/* ─── Footer ─── */
.quiz-footer {
  padding: 24px 40px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.78rem;
  color: #9A8A7A;
}

.quiz-footer a { color: var(--olive); text-decoration: none; }
.quiz-footer a:hover { text-decoration: underline; }

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .quiz-nav { padding: 16px 20px; }
  .quiz-hero-img img { height: 200px; }
  .quiz-wrapper, .result-wrapper { padding: 40px 20px 56px; }
  .result-card { padding: 36px 24px 32px; }
  .notify-fields { flex-direction: column; }
  .notify-fields .btn-primary { width: 100%; }
  .nav-account { font-size: 0.74rem; }
  .nav-cta { padding: 6px 12px; font-size: 0.78rem; }
  .nav-cart { font-size: 0.74rem; }
}