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

:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-hover: #f0f0f3;
  --border: #e2e2e8;
  --accent: #f97316;
  --accent-light: #fb923c;
  --accent-glow: rgba(249, 115, 22, 0.08);
  --accent-strong: rgba(249, 115, 22, 0.12);
  --text: #111118;
  --text-secondary: #5a5a72;
  --green: #059669;
  --green-bg: rgba(5, 150, 105, 0.08);
  --warm: #f59e0b;
  --warm-bg: rgba(245, 158, 11, 0.08);
  --radius: 20px;
  --radius-sm: 14px;
  --font: 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'EB Garamond', Garamond, 'Times New Roman', serif;
  --max-width: 520px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.08), 0 16px 40px rgba(0,0,0,0.06);
}

html { font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
}

/* ───── Logo header ───── */
.quiz-header {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto 4px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quiz-logo-text {
  font-family: var(--font);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  letter-spacing: 0.3px;
}

/* ───── App container ───── */
#app {
  width: 100%;
  max-width: var(--max-width);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ───── Progress ───── */
.progress-container {
  width: 100%;
  text-align: center;
}
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #059669, #10b981);
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 8px;
  font-weight: 500;
}

/* ───── Card ───── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  width: 100%;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* ───── Screen transitions ───── */
.screen {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.35s ease-out;
  flex: 1;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ───── Typography ───── */
.screen-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
  width: fit-content;
}
.screen-headline {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.screen-subheadline {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}
.screen-body {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}
.screen-body strong {
  color: var(--text);
  font-weight: 600;
}
.screen-micro {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 12px;
}

/* ───── Intro screen ───── */
.intro-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-glow);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}
.intro-icon svg {
  width: 24px;
  height: 24px;
}

/* ───── Option buttons (single & multi) ───── */
.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  flex: 1;
}
.option-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.93rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.4;
}
.option-btn:hover {
  background: var(--accent-glow);
  border-color: var(--accent-light);
}
.option-btn.selected {
  background: var(--accent-glow);
  border-color: var(--accent);
}
.option-btn .check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.option-btn.selected .check {
  border-color: var(--accent);
  background: var(--accent);
}
.option-btn.selected .check::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}
/* Multi-select checkbox style */
.option-btn .checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.option-btn.selected .checkbox {
  border-color: var(--accent);
  background: var(--accent);
}
.option-btn.selected .checkbox::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

/* ───── Primary CTA ───── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 16px 32px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: auto;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.3);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ───── Secondary / skip link ───── */
.btn-skip {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 12px;
  text-align: center;
  transition: color var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.btn-skip:hover { color: var(--text); }

/* ───── Back button ───── */
.btn-back {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--transition);
  width: fit-content;
}
.btn-back:hover { color: var(--text); }
.btn-back svg { width: 16px; height: 16px; }

/* ───── Email inputs ───── */
.form-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.email-input {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  width: 100%;
  outline: none;
  transition: border-color var(--transition);
}
.email-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}
.email-input::placeholder {
  color: #b0b0c0;
}

/* ───── Analysis screen ───── */
.analysis-spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 28px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.analysis-step {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-align: center;
  min-height: 1.5em;
  transition: opacity 0.3s;
}

/* ───── Education screens ───── */
.edu-card {
  background: var(--accent-glow);
  border: 1px solid rgba(249, 115, 22, 0.15);
  border-radius: var(--radius-sm);
  padding: 24px;
  margin-bottom: 20px;
}
.edu-card .screen-body {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 12px;
}
.edu-card .screen-body:last-child {
  margin-bottom: 0;
}
.edu-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 1.4rem;
}
.edu-icon--heart {
  background: var(--green-bg);
}
.edu-icon--brain {
  background: var(--warm-bg);
}

/* ───── Result screen ───── */
.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green);
  background: var(--green-bg);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
  width: fit-content;
}
.result-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
}

/* Result section labels */
.result-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 8px;
  margin-top: 24px;
}

.result-mirror {
  font-family: var(--font-body);
  font-size: 1.05rem;
  background: var(--bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 20px;
  margin: 12px 0 0;
  color: var(--text);
  line-height: 1.75;
}

.result-explanation {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-top: 8px;
}

.result-validation {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  line-height: 1.6;
  font-weight: 500;
  font-style: italic;
  margin-top: 8px;
}

.product-card {
  background: var(--accent-glow);
  border: 1px solid rgba(249, 115, 22, 0.15);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin: 8px 0 0;
}
.product-card-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 6px;
}
.product-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.product-card-body {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Product image */
.product-image-wrap {
  text-align: center;
  margin: -4px 0 16px;
}
.product-img {
  width: 160px;
  height: 160px;
  object-fit: contain;
}

/* Social proof quote */
.social-proof {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 16px 0;
}
.social-proof-quote {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  line-height: 1.65;
  font-style: italic;
  margin-bottom: 6px;
}
.social-proof-author {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Trust bar */
.trust-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 12px;
  flex-wrap: wrap;
  text-align: center;
  line-height: 1.5;
}
.trust-bar .stars {
  color: var(--warm);
  letter-spacing: 1px;
}

/* ───── Responsive ───── */
@media (min-width: 768px) {
  :root { --max-width: 640px; }
  .card { padding: 48px 44px; }
  .screen-headline { font-size: 1.75rem; }
}

@media (max-width: 480px) {
  body { padding: 12px; }
  .card { padding: 28px 20px; min-height: 380px; }
  .screen-headline { font-size: 1.3rem; }
  .option-btn { padding: 14px 16px; font-size: 0.9rem; }
}
