:root {
  --primary:       #e84545;
  --primary-dark:  #c73232;
  --text:          #1a1a2e;
  --text-muted:    #64748b;
  --bg:            #f8fafc;
  --white:         #ffffff;
  --border:        #e2e8f0;
  --success:       #22c55e;
}

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

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Progress bar */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 4px;
  background: var(--primary);
  transition: width .4s ease;
  z-index: 100;
  width: 0%;
}

/* App container */
#app {
  max-width: 600px;
  margin: 0 auto;
  padding: 52px 20px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Screen */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: fadeIn .25s ease;
}

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

/* Question header */
.q-section {
  font-size: .72rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .4rem;
}
.q-number {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}
.q-text {
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: .4rem;
}
.q-hint {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
}

/* Options */
.options {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-bottom: 1.25rem;
}

.option-btn {
  display: flex;
  align-items: center;
  padding: .875rem 1rem;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: .98rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color .12s, background .12s;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.35;
}
.option-btn:hover,
.option-btn:focus { border-color: var(--primary); background: #fff5f5; outline: none; }
.option-btn.selected {
  border-color: var(--primary);
  background: #fff5f5;
  color: var(--primary);
  font-weight: 600;
}

.check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  margin-right: .85rem;
  flex-shrink: 0;
  transition: all .12s;
  background: transparent;
}
.option-btn.selected .check { background: var(--primary); border-color: var(--primary); }
.option-btn.multi .check { border-radius: 4px; }

/* Number input */
.number-input-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.number-input-wrap input[type=number] {
  width: 120px;
  padding: .875rem 1rem;
  font-size: 1.5rem;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  -moz-appearance: textfield;
  outline: none;
}
.number-input-wrap input[type=number]:focus { border-color: var(--primary); }
.number-input-wrap input::-webkit-outer-spin-button,
.number-input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; }
.number-unit { font-size: 1rem; color: var(--text-muted); }

/* Slider */
.slider-wrap { margin-bottom: 1.5rem; }
.slider-value {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: .5rem;
}
.slider-wrap input[type=range] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
  margin: .75rem 0;
  cursor: pointer;
}
.slider-wrap input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(232,69,69,.35);
}
.slider-wrap input[type=range]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 50%;
  border: none;
  cursor: pointer;
}
.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
  color: var(--text-muted);
}

/* Buttons */
.btn-next {
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s;
  margin-top: auto;
  min-height: 54px;
}
.btn-next:hover  { background: var(--primary-dark); }
.btn-next:disabled { opacity: .45; cursor: not-allowed; }

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem 0;
  margin-bottom: .6rem;
}
.btn-back:hover { color: var(--text); }

/* ── Welcome ─────────────────────────────── */
.welcome-screen { padding-top: 1rem; text-align: center; }
.welcome-screen h1 {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: .875rem;
}
.welcome-screen .promise {
  color: var(--text-muted);
  font-size: .93rem;
  line-height: 1.65;
  margin-bottom: 1.5rem;
}
.welcome-list {
  text-align: left;
  background: var(--white);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  list-style: none;
}
.welcome-list li {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .55rem 0;
  font-size: .93rem;
  color: var(--text);
}
.welcome-list li + li { border-top: 1px solid var(--border); }
.check-icon { color: var(--success); flex-shrink: 0; margin-top: 2px; }

/* ── Cliffhanger ─────────────────────────── */
.cliffhanger-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 0;
}
.cliff-icon { font-size: 2.75rem; margin-bottom: 1rem; }
.cliffhanger-screen p {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.5;
  max-width: 320px;
}

/* ── Analyzing ───────────────────────────── */
.analyzing-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.spinner {
  width: 56px; height: 56px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1.75rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.analyzing-text { font-size: .95rem; color: var(--text-muted); min-height: 1.5em; }

/* ── Result ──────────────────────────────── */
.result-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border-left: 4px solid var(--primary);
}
.ages {
  display: flex;
  justify-content: space-around;
  margin-bottom: 1.25rem;
}
.age-block { text-align: center; }
.age-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: .3rem;
}
.age-number { font-size: 3rem; font-weight: 900; line-height: 1; }
.age-number.bio    { color: var(--primary); }
.age-number.chrono { color: var(--text); }
.delta-badge {
  text-align: center;
  font-size: .95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
}
.critical-zone {
  display: flex;
  justify-content: space-between;
  font-size: .88rem;
  padding: .6rem 0 0;
  border-top: 1px solid var(--border);
}
.zone-label { color: var(--text-muted); }
.zone-value { font-weight: 700; }

.locked-section {
  background: #f1f5f9;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.locked-section h3 { font-size: .95rem; margin-bottom: .875rem; }
.locked-section ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.locked-section li { font-size: .88rem; color: var(--text-muted); display: flex; align-items: center; gap: .5rem; }
.locked-section li::before { content: '✓'; color: var(--success); font-weight: 700; }

/* ── Gate ────────────────────────────────── */
.gate-screen h2  { font-size: 1.3rem; font-weight: 800; margin-bottom: .4rem; }
.gate-screen .subtitle { font-size: .88rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.field { margin-bottom: .875rem; }
.field label { display: block; font-size: .82rem; font-weight: 700; margin-bottom: .35rem; }
.field input {
  width: 100%;
  padding: .875rem 1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  outline: none;
}
.field input:focus { border-color: var(--primary); }
.field .optional { font-size: .75rem; color: var(--text-muted); margin-top: .3rem; }
.consent-block {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  margin: .875rem 0;
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.consent-block input[type=checkbox] {
  margin-top: 2px;
  accent-color: var(--primary);
  width: 16px; height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}
.trust-badges {
  display: flex;
  gap: 1rem;
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: 1rem;
  flex-wrap: wrap;
}
.trust-badges span::before { content: '🔒 '; }

/* ── Confirmation ────────────────────────── */
.confirmation-screen { text-align: center; padding-top: 1.5rem; }
.success-icon { font-size: 3.5rem; margin-bottom: .875rem; }
.confirmation-screen h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: .5rem; }
.confirmation-screen p { color: var(--text-muted); font-size: .93rem; line-height: 1.65; margin-bottom: 2rem; }
.cta-cards { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.5rem; }
.cta-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .12s;
  text-align: left;
}
.cta-card:hover { border-color: var(--primary); }
.cta-icon { font-size: 1.5rem; flex-shrink: 0; }
.cta-text  { font-size: .9rem; font-weight: 700; }
.cta-sub   { font-size: .78rem; color: var(--text-muted); font-weight: 400; margin-top: .15rem; }

/* ── Shared ──────────────────────────────── */
.disclaimer {
  font-size: .7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 1.25rem;
  padding-bottom: .5rem;
  line-height: 1.5;
}
.error-msg { color: var(--primary); font-size: .82rem; margin-top: .35rem; }
