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

:root {
  --bg: #F5F3F0;
  --card: #FFFFFF;
  --text: #1A1A1A;
  --text-muted: #777068;
  --border: #E5E0D8;
  --blue: #5B7D9A;
  --blue-dark: #3D5A72;
  --warm: #C4956A;

  /* Archetype palettes */
  --sweet-bg: #FBF0E8;     --sweet-accent: #C4794A;   --sweet-dark: #5C2E0E;
  --purist-bg: #1C1008;    --purist-accent: #C4956A;  --purist-dark: #F5EDE8;
  --adventurer-bg: #FBF5E4; --adventurer-accent: #A0761A; --adventurer-dark: #4A3404;
  --classicist-bg: #EEF2ED; --classicist-accent: #4A6741; --classicist-dark: #1E3019;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --transition: 0.22s ease;
}

html, body {
  min-height: 100vh;
  background: var(--bg);
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#quiz-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 16px 24px 0;
  border-bottom: 1px solid transparent;
}

.logo {
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  letter-spacing: 0.03em;
  color: var(--text);
  margin-bottom: 14px;
}

#progress-wrap {
  height: 3px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: var(--blue);
  border-radius: 99px;
  transition: width 0.4s ease;
}

#screen {
  flex: 1;
  padding: 32px 20px 48px;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

/* ── Fade transition ──────────────────────────────────────────────────────── */
.fade-in {
  animation: fadeIn 0.28s ease forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Intro Screen ─────────────────────────────────────────────────────────── */
.intro-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 24px;
}

.intro-eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 16px;
}

.intro-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(32px, 8vw, 46px);
  line-height: 1.15;
  margin-bottom: 18px;
  max-width: 440px;
}

.intro-sub {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 380px;
  margin-bottom: 40px;
}

.intro-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
}

/* ── Question Screen ──────────────────────────────────────────────────────── */
.q-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
}

.q-text {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(22px, 5.5vw, 30px);
  line-height: 1.25;
  margin-bottom: 8px;
}

.q-hint {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* ── Answer Buttons ───────────────────────────────────────────────────────── */
.answers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.answer-btn {
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
}

.answer-btn:hover, .answer-btn:focus {
  border-color: var(--blue);
  background: #F0F5F9;
  outline: none;
  transform: translateY(-1px);
}

.answer-btn.selected {
  border-color: var(--blue);
  background: #EBF2F8;
}

.answer-dot {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  transition: border-color var(--transition), background var(--transition);
}

.answer-btn:hover .answer-dot,
.answer-btn.selected .answer-dot {
  border-color: var(--blue);
  background: var(--blue);
}

/* ── Text Input ───────────────────────────────────────────────────────────── */
.text-input-wrap {
  margin-top: 8px;
}

.text-input {
  width: 100%;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}

.text-input:focus {
  border-color: var(--blue);
}

.text-input::placeholder {
  color: #BDB8B0;
}

/* ── Select Input ─────────────────────────────────────────────────────────── */
.select-input {
  width: 100%;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  color: var(--text);
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: border-color var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23777068' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}

.select-input:focus {
  border-color: var(--blue);
}

/* ── Navigation ───────────────────────────────────────────────────────────── */
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
}

.btn-back {
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition);
}

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

.btn-primary {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 99px;
  padding: 14px 32px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

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

.btn-primary.full { width: 100%; }

.btn-secondary {
  background: transparent;
  color: var(--blue);
  border: 1.5px solid var(--blue);
  border-radius: 99px;
  padding: 13px 28px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
  width: 100%;
  text-align: center;
}

.btn-secondary:hover { background: #EBF2F8; }

.btn-skip {
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px 0;
  text-align: center;
  width: 100%;
  margin-top: 8px;
  transition: color var(--transition);
}

.btn-skip:hover { color: var(--text); }

/* ── Pod Redirect ─────────────────────────────────────────────────────────── */
.redirect-wrap {
  text-align: center;
  padding-top: 32px;
}

.redirect-icon {
  font-size: 48px;
  margin-bottom: 24px;
}

.redirect-title {
  font-family: 'DM Serif Display', serif;
  font-size: 28px;
  margin-bottom: 16px;
  line-height: 1.2;
}

.redirect-body {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 380px;
  margin: 0 auto 32px;
}

/* ── Loading Screen ───────────────────────────────────────────────────────── */
.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
}

.loading-dots {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.loading-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  animation: bounce 1.2s ease infinite;
}

.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40%           { transform: scale(1);   opacity: 1; }
}

.loading-text {
  font-size: 16px;
  color: var(--text-muted);
}

/* ── Result Card ──────────────────────────────────────────────────────────── */
.result-card {
  border-radius: var(--radius);
  padding: 36px 28px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.result-card.sweet-tooth   { background: var(--sweet-bg); }
.result-card.purist        { background: var(--purist-bg); }
.result-card.adventurer    { background: var(--adventurer-bg); }
.result-card.classicist    { background: var(--classicist-bg); }

.result-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.sweet-tooth   .result-eyebrow { color: var(--sweet-accent); }
.purist        .result-eyebrow { color: var(--purist-accent); }
.adventurer    .result-eyebrow { color: var(--adventurer-accent); }
.classicist    .result-eyebrow { color: var(--classicist-accent); }

.result-name {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(40px, 10vw, 56px);
  line-height: 1.05;
  margin-bottom: 12px;
}
.sweet-tooth   .result-name { color: var(--sweet-dark); }
.purist        .result-name { color: var(--purist-dark); }
.adventurer    .result-name { color: var(--adventurer-dark); }
.classicist    .result-name { color: var(--classicist-dark); }

.result-subhead {
  font-size: 16px;
  line-height: 1.5;
  font-style: italic;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.sweet-tooth   .result-subhead { color: var(--sweet-accent); }
.purist        .result-subhead { color: var(--purist-accent); }
.adventurer    .result-subhead { color: var(--adventurer-accent); }
.classicist    .result-subhead { color: var(--classicist-accent); }

.result-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.result-bullet {
  display: flex;
  gap: 10px;
  font-size: 15px;
  line-height: 1.5;
}

.bullet-mark {
  font-size: 13px;
  margin-top: 3px;
  flex-shrink: 0;
}
.sweet-tooth   .bullet-mark { color: var(--sweet-accent); }
.purist        .bullet-mark { color: var(--purist-accent); }
.adventurer    .bullet-mark { color: var(--adventurer-accent); }
.classicist    .bullet-mark { color: var(--classicist-accent); }

.result-bullet-text {
  color: inherit;
  opacity: 0.85;
}
.purist .result-bullet-text { color: var(--purist-dark); }

/* ── Result Guidance ─────────────────────────────────────────────────────── */
.result-guidance {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 4px;
}

.result-guidance-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.sweet-tooth  .result-guidance-label { color: var(--sweet-accent); }
.purist       .result-guidance-label { color: var(--purist-accent); }
.adventurer   .result-guidance-label { color: var(--adventurer-accent); }
.classicist   .result-guidance-label { color: var(--classicist-accent); }

.result-guidance-body {
  font-size: 14px;
  line-height: 1.65;
  opacity: 0.85;
}

.result-gap {
  font-size: 14px;
  line-height: 1.65;
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}
.sweet-tooth   .result-gap { background: rgba(196,121,74,0.1); color: var(--sweet-dark); }
.purist        .result-gap { background: rgba(196,149,106,0.15); color: var(--purist-dark); }
.adventurer    .result-gap { background: rgba(160,118,26,0.1); color: var(--adventurer-dark); }
.classicist    .result-gap { background: rgba(74,103,65,0.1); color: var(--classicist-dark); }

/* ── CTA Section ──────────────────────────────────────────────────────────── */
.cta-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.btn-kit {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 99px;
  padding: 16px 32px;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  display: block;
  transition: background var(--transition), transform var(--transition);
}
.btn-kit:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.waitlist-msg {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 4px;
}

.waitlist-form {
  display: flex;
  gap: 8px;
}

.waitlist-input {
  flex: 1;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 99px;
  padding: 13px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}

.waitlist-input:focus { border-color: var(--blue); }

.waitlist-submit {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 99px;
  padding: 13px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition);
}
.waitlist-submit:hover { background: var(--blue-dark); }

.email-optional-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Share Section ────────────────────────────────────────────────────────── */
.share-section {
  text-align: center;
  padding-top: 8px;
}

.share-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  letter-spacing: 0.04em;
}

.btn-share {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 99px;
  padding: 12px 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color var(--transition), background var(--transition);
}
.btn-share:hover {
  border-color: var(--blue);
  background: #EBF2F8;
}

.share-copied {
  font-size: 13px;
  color: var(--blue);
  margin-top: 8px;
  display: none;
}
.share-copied.visible { display: block; }

/* ── Email screen ─────────────────────────────────────────────────────────── */
.email-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 400px) {
  #screen { padding: 24px 16px 40px; }
  .result-card { padding: 28px 20px; }
  .waitlist-form { flex-direction: column; }
  .waitlist-submit { border-radius: 99px; }
}
