/* ═══════════════════════════════════════════════════════════
   Escuela de Sanidad del Reino — Quiz Styles
   sanidadporfe.com
═══════════════════════════════════════════════════════════ */

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

:root {
  --navy:     #0D1B3E;
  --navy-mid: #162348;
  --gold:     #C8860A;
  --gold-lt:  #FEF3DC;
  --gold-md:  #E8A020;
  --white:    #FFFFFF;
  --off:      #F9F7F2;
  --text:     #1A1A2E;
  --muted:    #6B6575;
  --border:   #E8E3DA;
  --danger:   #991B1B;
  --danger-bg:#FEE2E2;
  --radius:   10px;
  --shadow:   0 2px 16px rgba(13,27,62,0.08);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--off);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Header ────────────────────────────────────────── */
.site-header {
  background: var(--navy);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { font-family: 'Lora', Georgia, serif; color: var(--gold); font-size: 1rem; letter-spacing: 0.03em; }
.brand-sub { font-size: 0.7rem; color: rgba(255,255,255,0.38); letter-spacing: 0.04em; margin-top: 1px; }

/* ── Screens (only one visible at a time) ────────────── */
.screen { display: none; }
.screen.active { display: block; }

/* ── INTRO SCREEN ────────────────────────────────────── */
.intro-hero {
  background: var(--navy);
  color: #fff;
  padding: 4rem 1.5rem 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.intro-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(200,134,10,0.14) 0%, transparent 70%);
  pointer-events: none;
}
.intro-eyebrow {
  display: inline-block;
  background: rgba(200,134,10,0.18);
  border: 1px solid rgba(200,134,10,0.3);
  color: var(--gold-md);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 1rem;
  border-radius: 20px;
  margin-bottom: 1.35rem;
}
.intro-hero h1 {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  font-weight: 600;
  line-height: 1.2;
  max-width: 620px;
  margin: 0 auto 1.1rem;
}
.intro-hero h1 em { color: var(--gold-md); font-style: italic; }
.intro-hero .subtitle {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.68);
  max-width: 500px;
  margin: 0 auto 0.85rem;
  line-height: 1.65;
}
.time-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.55);
  font-size: 0.82rem;
  padding: 0.35rem 1rem;
  border-radius: 20px;
  margin-bottom: 2rem;
}
.time-badge::before { content: '⏱'; font-size: 0.9rem; }

.btn-start {
  display: inline-block;
  background: var(--gold);
  color: #fff;
  border: none;
  padding: 1.1rem 3rem;
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
}
.btn-start:hover { background: #A56E06; transform: translateY(-2px); }
.btn-start:active { transform: translateY(0); }

/* ── WHY TAKE THE QUIZ section ───────────────────────── */
.why-section {
  max-width: 700px;
  margin: 0 auto;
  padding: 3rem 1.5rem 3.5rem;
}
.why-section h2 {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 1rem;
  text-align: center;
}
.why-section .lead {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.75;
  text-align: center;
  max-width: 560px;
  margin: 0 auto 2rem;
}
.why-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.why-card {
  background: var(--white);
  border: 1px solid var(--border);
  flex: 1 1 200px;
  max-width: 260px;
  border-radius: var(--radius);
  padding: 1.25rem;
}
.why-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.why-card h4 {
  font-family: 'Lora', Georgia, serif;
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.35rem;
}
.why-card p { font-size: 0.88rem; color: var(--muted); line-height: 1.6; }
.scripture-strip {
  background: var(--gold-lt);
  border: 1px solid #F0D8A0;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-align: center;
  margin-bottom: 2.5rem;
}
.scripture-strip p {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--navy);
  line-height: 1.6;
  margin-bottom: 0.4rem;
}
.scripture-strip cite {
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-style: normal;
}
.intro-cta-bottom {
  text-align: center;
}
.intro-cta-bottom .note {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.65rem;
}

/* ── QUIZ SCREEN ─────────────────────────────────────── */
.quiz-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* Progress bar */
.progress-wrap { margin-bottom: 2rem; }
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width 0.45s ease;
}

/* Question card */
.q-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  animation: fadeSlideIn 0.3s ease;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.q-num {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}
.q-text {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--navy);
  margin-bottom: 1.5rem;
}

/* Answer options */
.resp-lista { display: flex; flex-direction: column; gap: 0.6rem; }
.resp-op { position: relative; }
.resp-op input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.resp-op label {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.9rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.5;
  background: #fff;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  user-select: none;
}
.resp-op label:hover {
  border-color: var(--gold);
  background: var(--gold-lt);
  transform: translateX(3px);
}
.resp-op input:checked + label {
  border-color: var(--gold);
  background: var(--gold-lt);
  font-weight: 500;
}
.dot-radio {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.resp-op input:checked + label .dot-radio {
  border-color: var(--gold);
  background: var(--gold);
}
.resp-op input:checked + label .dot-radio::after {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #fff;
}

/* Nav buttons */
.q-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  gap: 1rem;
}
.btn-prev {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--muted);
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-prev:hover { border-color: var(--navy); color: var(--navy); }
.btn-prev:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-next {
  background: var(--gold);
  color: #fff;
  border: none;
  padding: 0.7rem 1.75rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-left: auto;
}
.btn-next:hover { background: #A56E06; }
.auto-note {
  text-align: center;
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 0.85rem;
}

/* ── INTAKE SCREEN ───────────────────────────────────── */
.intake-wrap {
  max-width: 520px;
  margin: 3rem auto;
  padding: 0 1.25rem 4rem;
}
.intake-card {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  color: #fff;
  box-shadow: var(--shadow);
}
.intake-card h2 {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.intake-card .sub {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 2rem;
  line-height: 1.6;
}
.score-preview {
  background: rgba(200,134,10,0.15);
  border: 1px solid rgba(200,134,10,0.25);
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.score-preview .sp-num {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--gold-md);
  line-height: 1;
  flex-shrink: 0;
}
.score-preview .sp-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.4;
}
.campo-grupo { margin-bottom: 1.1rem; }
.campo-grupo label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.4rem;
}
.campo-grupo input {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.07);
  color: #fff;
  font-size: 0.97rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: 'Inter', sans-serif;
}
.campo-grupo input::placeholder { color: rgba(255,255,255,0.28); }
.campo-grupo input:focus { border-color: var(--gold); }
.optional-tag {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.35);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 0.4rem;
}
.btn-ver-resultados {
  width: 100%;
  padding: 1.1rem;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.2s;
  letter-spacing: 0.02em;
}
.btn-ver-resultados:hover { background: #A56E06; }
.intake-nota {
  text-align: center;
  font-size: 0.76rem;
  color: rgba(255,255,255,0.32);
  margin-top: 0.85rem;
}
.error-msg {
  background: var(--danger-bg);
  border: 1px solid #FCA5A5;
  color: var(--danger);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  margin-bottom: 1rem;
  display: none;
}
.error-msg.show { display: block; }

/* ── RESULTS SCREEN ──────────────────────────────────── */
.results-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}
.res-hero { text-align: center; margin-bottom: 1.75rem; }
.res-etiqueta {
  display: inline-block;
  padding: 0.35rem 1.1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}
.res-puntaje {
  font-size: 3.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--navy);
}
.res-puntaje span { font-size: 1.5rem; color: var(--muted); }
.res-puntaje-label { font-size: 0.82rem; color: var(--muted); margin: 0.3rem 0 1.25rem; }
.res-titular {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.35rem, 3.5vw, 2rem);
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
  max-width: 540px;
  margin: 0 auto;
}
.res-scripture {
  background: var(--gold-lt);
  border: 1px solid #F0D8A0;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-align: center;
  margin-bottom: 1.35rem;
}
.res-scripture p {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  font-size: 0.97rem;
  color: var(--navy);
  line-height: 1.65;
  margin-bottom: 0.4rem;
}
.res-scripture cite {
  font-size: 0.74rem;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-style: normal;
}
.res-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.35rem;
  box-shadow: var(--shadow);
}
.res-card p {
  font-size: 0.98rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 0.9rem;
}
.res-card p:last-child { margin-bottom: 0; }
.res-cta {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 2.25rem;
  text-align: center;
  color: #fff;
}
.res-cta-tag {
  display: inline-block;
  background: var(--gold-lt);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.25rem 0.9rem;
  border-radius: 20px;
  margin-bottom: 0.9rem;
}
.res-cta h3 {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.35rem;
  margin-bottom: 0.6rem;
}
.res-cta .sub {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.62);
  max-width: 420px;
  margin: 0 auto 0.85rem;
  line-height: 1.6;
}
.res-detalles {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.res-det { font-size: 0.82rem; color: rgba(255,255,255,0.48); }
.res-det strong { display: block; color: var(--gold-md); font-size: 0.88rem; margin-bottom: 2px; }
.btn-inscribir {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: var(--gold);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s;
}
.btn-inscribir:hover { background: #A56E06; }
.res-nota { font-size: 0.74rem; color: rgba(255,255,255,0.3); margin-top: 0.9rem; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
  .intro-hero { padding: 2.75rem 1rem 3.5rem; }
  .q-card { padding: 1.35rem; }
  .intake-card { padding: 1.75rem 1.25rem; }
  .res-cta { padding: 1.75rem 1.25rem; }
  .why-section { padding: 2rem 1rem 2.5rem; }
}
