/* ============================================================
   Test de Dones del Espíritu Santo
   Alianza Cristiana y Misionera — Stylesheet
   ============================================================ */

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

:root {
  --navy:    #0f2447;
  --blue:    #1a3a6b;
  --gold:    #c9a227;
  --gold-l:  #f0d060;
  --white:   #ffffff;
  --g50:     #f8fafc;
  --g100:    #f1f5f9;
  --g200:    #e2e8f0;
  --g600:    #475569;
  --g800:    #1e293b;
  --purple:  #7c3aed;
  --red:     #dc2626;
  --green:   #059669;
  --shadow:  0 8px 32px rgba(0,0,0,0.18);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.25);
}

html { min-height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(160deg, #0a1628 0%, #0f2447 45%, #1a3a6b 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--g800);
  padding: 16px;
}

.app {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 0 40px;
}

/* ── Screens ────────────────────────────────────────────────── */
.screen { display: none; animation: fadeIn 0.4s ease; }
.screen.active { display: block; }

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

/* ── Card ────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow);
}

/* ── Welcome screen ──────────────────────────────────────────── */
.w-header { text-align: center; margin-bottom: 28px; }
.w-icon   { font-size: 64px; display: block; margin-bottom: 12px; }
.w-title  { font-size: 28px; font-weight: 800; color: var(--navy); line-height: 1.2; margin-bottom: 6px; }
.w-sub    { font-size: 15px; color: var(--g600); font-style: italic; }
.w-line   { width: 56px; height: 3px; background: var(--gold); margin: 18px auto; border-radius: 2px; }

.w-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin: 24px 0;
}
.stat   { text-align: center; padding: 16px 8px; background: var(--g50); border-radius: 12px; border: 1px solid var(--g200); }
.stat-n { font-size: 30px; font-weight: 800; color: var(--gold); display: block; }
.stat-l { font-size: 12px; color: var(--g600); margin-top: 2px; }

.scale-box {
  background: var(--g50);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 20px 0;
  border-left: 4px solid var(--gold);
}
.scale-box h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--g600);
  margin-bottom: 10px;
}
.scale-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sc-item   { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.sc-n {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.sc-n.n1 { background: #fee2e2; color: #dc2626; }
.sc-n.n2 { background: #fef3c7; color: #d97706; }
.sc-n.n3 { background: #d1fae5; color: #059669; }
.sc-n.n4 { background: #dbeafe; color: #2563eb; }

.hint {
  font-size: 13px;
  color: var(--g600);
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: block;
  width: 100%;
  padding: 15px 24px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: white;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15,36,71,0.35);
}
.btn-gold {
  background: linear-gradient(135deg, #b8860b, var(--gold));
  color: white;
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(180,134,11,0.3);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Quiz progress ───────────────────────────────────────────── */
.prog-wrap { margin-bottom: 18px; }
.prog-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.prog-label { font-size: 13px; color: rgba(255,255,255,0.65); }
.prog-count { font-size: 13px; color: white; font-weight: 700; }
.prog-bar {
  height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  overflow: hidden;
}
.prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-l));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ── Question card ───────────────────────────────────────────── */
.q-card {
  background: var(--white);
  border-radius: 20px;
  padding: 36px;
  box-shadow: var(--shadow);
  transition: opacity 0.15s, transform 0.15s;
}
.q-text {
  font-size: 18px;
  line-height: 1.65;
  color: var(--g800);
  margin-bottom: 26px;
  font-weight: 500;
  min-height: 60px;
}
.answers { display: grid; gap: 10px; margin-bottom: 22px; }
.ans {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 2px solid var(--g200);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s;
  user-select: none;
}
.ans:hover  { border-color: var(--gold); background: #fffbeb; }
.ans.selected { border-color: var(--navy); background: #eff6ff; }
.ans input { display: none; }
.ans-dot {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  flex-shrink: 0;
  transition: all 0.18s;
}
.ans:nth-child(1) .ans-dot { background: #fee2e2; color: #dc2626; }
.ans:nth-child(2) .ans-dot { background: #fef3c7; color: #d97706; }
.ans:nth-child(3) .ans-dot { background: #d1fae5; color: #059669; }
.ans:nth-child(4) .ans-dot { background: #dbeafe; color: #2563eb; }
.ans.selected .ans-dot { background: var(--navy) !important; color: white !important; }
.ans-lbl { font-size: 15px; color: var(--g800); font-weight: 500; }

/* ── Results screen ──────────────────────────────────────────── */
.res-hdr { text-align: center; margin-bottom: 28px; color: white; }
.res-hdr .trophy { font-size: 52px; display: block; margin-bottom: 10px; }
.res-title { font-size: 32px; font-weight: 800; color: white; margin-bottom: 6px; }
.res-sub   { font-size: 15px; color: rgba(255,255,255,0.7); }

/* Result card with hero image */
.r-card {
  background: var(--white);
  border-radius: 20px;
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.r-hero {
  position: relative;
  padding: 32px 24px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-bottom: 4px solid var(--gold);
}

.r-card.cat-sobrenatural .r-hero { background: linear-gradient(135deg, #faf5ff 0%, #ede9fe 100%); border-bottom-color: var(--purple); }
.r-card.cat-ministerial  .r-hero { background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%); border-bottom-color: var(--red); }
.r-card.cat-servicio     .r-hero { background: linear-gradient(135deg, #f0fdf4 0%, #d1fae5 100%); border-bottom-color: var(--green); }

.r-img-wrap {
  width: 150px;
  height: 150px;
  border-radius: 20px;
  background: #ffe4c4;
  border: solid 7px #ffb300;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  overflow: hidden;
}
.r-img-wrap img {
  width: 100%;
  height: 110%;
  object-fit: contain;
  scale: 1.1;
  padding-top: 10px;
}

.r-hero-info { flex: 1; min-width: 0; }

.r-medal-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.medal {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.m1 { background: linear-gradient(135deg, #b8860b, #ffd700); }
.m2 { background: linear-gradient(135deg, #9ca3af, #d1d5db); }
.m3 { background: linear-gradient(135deg, #b45309, #f59e0b); }

.r-rank-pill {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 10px;
  border-radius: 10px;
  background: var(--white);
}
.r-rank-pill.rk1 { color: #b8860b; }
.r-rank-pill.rk2 { color: #6b7280; }
.r-rank-pill.rk3 { color: #b45309; }

.r-name {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 4px;
}
.r-cat-line {
  font-size: 12px;
  font-weight: 600;
  color: var(--g600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.r-score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.r-score {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
}
.r-max {
  font-size: 12px;
  color: var(--g600);
}
.score-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.6);
  border-radius: 4px;
  overflow: hidden;
}
.sf {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease;
}
.sf1 { background: linear-gradient(90deg, #b8860b, #ffd700); }
.sf2 { background: linear-gradient(90deg, #9ca3af, #d1d5db); }
.sf3 { background: linear-gradient(90deg, #b45309, #f59e0b); }

/* Result body */
.r-body { padding: 24px 28px 28px; }
.r-sec  { margin-top: 18px; }
.r-sec:first-child { margin-top: 0; }
.r-sec-t {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--g600);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.r-sec-t::before {
  content: '';
  width: 16px;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
}
.r-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--g800);
}
.verse-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--g800);
  font-style: italic;
  line-height: 1.6;
}
.ul { list-style: none; }
.ul li {
  padding: 6px 0 6px 22px;
  font-size: 14px;
  color: var(--g800);
  position: relative;
  line-height: 1.55;
}
.ul li::before {
  content: '•';
  position: absolute;
  left: 6px;
  color: var(--gold);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  top: 8px;
}
.ul.warn li::before {
  content: '⚠';
  font-size: 11px;
  top: 8px;
}

/* ── Interpretación section ──────────────────────────────────── */
.interp-card {
  background: var(--white);
  border-radius: 20px;
  padding: 32px;
  margin-top: 32px;
  box-shadow: var(--shadow);
}
.interp-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
  text-align: center;
}
.interp-divider {
  width: 50px;
  height: 3px;
  background: var(--gold);
  margin: 0 auto 24px;
  border-radius: 2px;
}
.interp-list { list-style: none; }
.interp-list li {
  padding: 10px 0 10px 32px;
  font-size: 14.5px;
  color: var(--g800);
  position: relative;
  line-height: 1.6;
  border-bottom: 1px solid var(--g100);
}
.interp-list li:last-child { border-bottom: none; }
.interp-list li::before {
  content: '✓';
  position: absolute;
  left: 6px;
  top: 10px;
  width: 20px; height: 20px;
  background: var(--gold);
  color: white;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.interp-final {
  margin-top: 24px;
  background: linear-gradient(135deg, #0f2447 0%, #1a3a6b 100%);
  color: white;
  padding: 24px;
  border-radius: 14px;
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.7;
  text-align: center;
  position: relative;
}
.interp-final::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 18px;
  font-size: 60px;
  color: var(--gold);
  font-family: Georgia, serif;
  line-height: 1;
}

/* ── Action buttons (results) ────────────────────────────────── */
.res-acts {
  margin-top: 24px;
  display: grid;
  gap: 12px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .card, .q-card { padding: 24px; }
  .interp-card { padding: 22px; }
  .w-stats { grid-template-columns: 1fr; }
  .scale-grid { grid-template-columns: 1fr; }
  .w-title { font-size: 22px; }
  .q-text { font-size: 16px; }
  .r-hero { padding: 24px 18px 16px; gap: 14px; }
  .r-img-wrap { width: 115px; height: 115px; border-radius: 16px; border-width: 5px; }
  .r-name { font-size: 20px; }
  .r-body { padding: 20px 22px 22px; }
  .res-title { font-size: 26px; }
}

@media (max-width: 380px) {
  .r-hero { flex-direction: column; align-items: center; text-align: center; }
  .r-img-wrap { width: 130px; height: 130px; }
  .r-medal-row { justify-content: center; }
  .r-score-row { justify-content: center; }
}

/* ── Share row (iconos horizontales dentro de la card) ───────── */
.share-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--g200);
  flex-wrap: wrap;
}
.share-row-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--g600);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-right: 4px;
}
.share-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  transition: all 0.18s;
  font-family: inherit;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.share-icon:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 6px 16px rgba(0,0,0,0.22);
}
.share-icon:active { transform: translateY(0) scale(1); }
.share-icon.dl { background: linear-gradient(135deg, #b8860b, var(--gold)); }
.share-icon.fb { background: #1877f2; font-family: Georgia, serif; font-size: 22px; }
.share-icon.ig { background: linear-gradient(135deg, #f09433 0%, #dc2743 50%, #bc1888 100%); }
.share-icon.wa { background: #25d366; }

/* ── Cards expandibles (top 3) ───────────────────────────────── */
.r-card .r-hero {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: filter 0.2s;
  padding-right: 56px; /* espacio para el toggle arrow */
}
.r-card .r-hero:hover { filter: brightness(0.97); }
.r-card .r-body { display: none; }
.r-card.open .r-body { display: block; }

.r-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--navy);
  font-weight: 800;
  transition: transform 0.25s ease;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.r-card.open .r-toggle { transform: rotate(180deg); }

/* ── Sección genérica colapsable (otros dones, debilidades, etc.) ──*/
.section-card {
  background: white;
  border-radius: 20px;
  margin-top: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.section-head {
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}
.section-head:hover { background: var(--g50); }
.section-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.section-icon.cyan  { background: #e0f2fe; }
.section-icon.amber { background: #fef3c7; }
.section-icon.gold  { background: #fffbeb; }
.section-info { flex: 1; min-width: 0; }
.section-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.25;
}
.section-sub {
  font-size: 12.5px;
  color: var(--g600);
  margin-top: 3px;
}
.section-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--g100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--g600);
  font-weight: 700;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}
.section-card.open .section-toggle { transform: rotate(180deg); }
.section-body {
  display: none;
  padding: 6px 24px 24px;
  border-top: 1px solid var(--g100);
}
.section-card.open .section-body { display: block; }

.section-intro {
  font-size: 14px;
  color: var(--g600);
  line-height: 1.65;
  padding: 16px 0 6px;
}

/* ── Mini gift (lista de otros dones / debilidades) ──────────── */
.mini-gift {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--g100);
}
.mini-gift:last-child { border-bottom: none; }
.mini-img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: #ffe4c4;
  border: solid 4px #ffb300;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mini-img img {
  width: 100%;
  height: 110%;
  object-fit: contain;
  scale: 1.1;
  padding-top: 6px;
}
.mini-info { flex: 1; min-width: 0; }
.mini-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.25;
  margin-bottom: 2px;
}
.mini-cat {
  font-size: 10.5px;
  color: var(--g600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  margin-bottom: 6px;
}
.mini-principle {
  font-size: 13px;
  color: var(--g800);
  line-height: 1.55;
}
.mini-score-wrap {
  flex-shrink: 0;
  text-align: right;
  min-width: 56px;
}
.mini-score {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}
.mini-score-label {
  font-size: 10px;
  color: var(--g600);
  font-weight: 600;
  margin-top: 2px;
}

/* ── Caja de resumen (debilidades) ───────────────────────────── */
.summary-box {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  padding: 16px 20px;
  margin-top: 18px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--g800);
}
.summary-box strong { color: var(--navy); }

/* Toast para feedback */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: white;
  padding: 12px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1100;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Print ───────────────────────────────────────────────────── */
@media print {
  body { background: white !important; padding: 0; }
  .res-acts, .prog-wrap { display: none !important; }
  .res-hdr { color: var(--navy) !important; }
  .res-title { color: var(--navy) !important; }
  .res-sub { color: var(--g600) !important; }
  .r-card { break-inside: avoid; box-shadow: none; border: 1px solid var(--g200); }
  .interp-card { box-shadow: none; border: 1px solid var(--g200); }
  .interp-final { background: var(--g50) !important; color: var(--g800) !important; border-left: 4px solid var(--gold); }
}
