/* ── Design Tokens ── */
:root {
  --forest: #2C4A3E;
  --forest-dark: #1a2f27;
  --cream: #F5F0E8;
  --gold: #C8A96E;
  --gold-hover: #b8944f;
  --ink: #1A1A1A;
  --muted: #6B7280;
  --white: #ffffff;

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;

  --radius: 4px;
  --transition: 0.38s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: var(--font-sans);
  background: var(--forest-dark);
  color: var(--ink);
  overflow: hidden;
  height: 100svh;
  height: 100vh; /* fallback */
}

/* ── Header ── */
#quiz-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(26, 47, 39, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

#brand-logo {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--cream);
  letter-spacing: 0.02em;
}

#brand-logo span {
  color: var(--gold);
}

#progress-text {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(245, 240, 232, 0.5);
  letter-spacing: 0.06em;
}

/* ── Quiz Track ── */
#quiz-wrap {
  overflow: hidden;
  width: 100%;
  height: 100svh;
  height: 100vh;
  padding-top: 56px;
}

#track {
  display: flex;
  height: 100%;
  will-change: transform;
  transition: transform var(--transition);
}

/* ── Screens ── */
.screen {
  flex-shrink: 0;
  width: 100vw;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Cover Screen ── */
.screen-cover {
  background: var(--forest);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-inner {
  max-width: 640px;
  width: 100%;
  padding: 48px 32px;
  text-align: center;
}

.cover-eyebrow {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(200, 169, 110, 0.35);
  padding: 4px 12px;
  border-radius: var(--radius);
  margin-bottom: 28px;
}

.cover-headline {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 600;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 20px;
}

.cover-sub {
  font-size: 1.0625rem;
  color: rgba(245, 240, 232, 0.65);
  line-height: 1.6;
  margin-bottom: 40px;
}

/* ── Question Screen ── */
.screen-question {
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
}

.question-inner {
  max-width: 720px;
  width: 100%;
  padding: 40px 32px 48px;
}

.question-text {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 600;
  color: var(--forest);
  line-height: 1.25;
  margin-bottom: 32px;
}

.answer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 560px) {
  .answer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.answer-card {
  display: block;
  width: 100%;
  padding: 18px 20px;
  background: var(--white);
  border: 1.5px solid rgba(44, 74, 62, 0.12);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.12s ease;
  line-height: 1.45;
}

.answer-card:hover {
  border-color: var(--forest);
  background: rgba(44, 74, 62, 0.04);
  transform: translateY(-1px);
}

.answer-card.selected {
  border-color: var(--forest);
  background: var(--forest);
  color: var(--white);
}

/* ── Lead Gate Screen ── */
.screen-lead {
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lead-inner {
  max-width: 520px;
  width: 100%;
  padding: 48px 32px;
}

.lead-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.lead-headline {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  color: var(--forest);
  line-height: 1.2;
  margin-bottom: 12px;
}

.lead-sub {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 32px;
}

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--forest);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.form-input {
  padding: 12px 14px;
  border: 1.5px solid rgba(44, 74, 62, 0.2);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.18s ease;
  outline: none;
  -webkit-appearance: none;
}

.form-input:focus {
  border-color: var(--forest);
}

.form-input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.form-optional {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  margin-left: 4px;
}

.lead-consent {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.lead-error {
  font-size: 0.8rem;
  color: #c0392b;
  display: none;
}

.lead-error.visible {
  display: block;
}

/* ── Result Screen ── */
.screen-result {
  background: var(--forest-dark);
  display: flex;
  flex-direction: column;
}

.result-photo {
  width: 100%;
  height: 240px;
  background-color: var(--forest);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .result-photo {
    height: 320px;
  }
}

.result-body {
  flex: 1;
  padding: 40px 32px 48px;
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
}

.result-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.result-name {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 600;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 10px;
}

.result-tagline {
  font-size: 1.0625rem;
  color: rgba(245, 240, 232, 0.7);
  line-height: 1.5;
  font-style: italic;
  margin-bottom: 20px;
}

.result-description {
  font-size: 0.9375rem;
  color: rgba(245, 240, 232, 0.8);
  line-height: 1.7;
  margin-bottom: 12px;
}

.result-price {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.05em;
  margin-bottom: 32px;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.result-restart {
  font-size: 0.8rem;
  color: rgba(245, 240, 232, 0.4);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-sans);
  transition: color 0.18s ease;
}

.result-restart:hover {
  color: rgba(245, 240, 232, 0.7);
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 36px;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--gold-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-forest {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 36px;
  background: var(--forest);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.18s ease;
  text-decoration: none;
}

.btn-forest:hover {
  background: var(--forest-dark);
}

/* ── Back button ── */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(44, 74, 62, 0.45);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-sans);
  transition: color 0.18s ease;
  margin-bottom: 28px;
}

.btn-back:hover {
  color: var(--forest);
}

/* ── Loading spinner (for API submit) ── */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(26, 26, 26, 0.3);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ── Mobile ── */
@media (max-width: 480px) {
  #quiz-header {
    padding: 0 16px;
  }

  .cover-inner {
    padding: 32px 20px 40px;
  }

  .question-inner {
    padding: 28px 20px 40px;
  }

  .lead-inner {
    padding: 32px 20px 40px;
  }

  .result-body {
    padding: 28px 20px 40px;
  }

  .btn-primary,
  .btn-forest {
    width: 100%;
    justify-content: center;
    padding: 16px 24px;
  }
}
