/* ===========================================================
   PIR Test — hoja de estilos global (plataforma)
   =========================================================== */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400..600;1,9..144,400..600&display=swap');
:root {
  /* estilo editorial claro (por defecto, igual que la portada) */
  --bg:#f4f1ea; --bg-soft:#efebe1; --surface:#ffffff; --surface-2:#f7f4ed;
  --surface-3:#efe9dd; --border:#e3ddd0; --text:#1a1916; --text-soft:#565249;
  --text-dim:#8a857a; --primary:#145a48; --primary-2:#1d7a61;
  --primary-glow:rgba(20,90,72,.22); --accent:#1d7a61; --green:#157346;
  --green-soft:rgba(21,115,70,.10); --green-border:rgba(21,115,70,.40);
  --red:#c0392b; --red-soft:rgba(192,57,43,.09); --red-border:rgba(192,57,43,.38);
  --amber:#b45309;
  --ok-text:#14603a; --err-text:#9b1c10; --warn-text:#825207;
  --radius:16px; --radius-sm:12px;
  --shadow:0 20px 45px -28px rgba(40,35,20,.40); --maxw:980px;
  --font:'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif:'Fraunces', Georgia, 'Times New Roman', serif;
}
[data-theme="dark"] {
  /* verde-carbón profundo, a juego con la portada */
  --bg:#0e1311; --bg-soft:#121916; --surface:#161e1b; --surface-2:#1d2723;
  --surface-3:#26332d; --border:#2d3b34; --text:#eaf1ed; --text-soft:#a4b2ab;
  --text-dim:#6e7d75; --primary:#25b894; --primary-2:#31caa4;
  --primary-glow:rgba(37,184,148,.35); --accent:#3dd9b4; --green:#34d399;
  --green-soft:rgba(52,211,153,.15); --green-border:rgba(52,211,153,.5);
  --red:#f87171; --red-soft:rgba(248,113,113,.14); --red-border:rgba(248,113,113,.5);
  --amber:#fbbf24;
  --ok-text:#8ef0c0; --err-text:#fecaca; --warn-text:#fde68a;
  --shadow:0 22px 50px -28px rgba(0,0,0,.75);
}
[data-theme="dark"] body {
  background:
    radial-gradient(900px 520px at 88% -160px, rgba(37,184,148,.07), transparent 62%),
    var(--bg);
}
[data-theme="dark"] .card { box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, var(--shadow); }
[data-theme="dark"] .option:hover:not(.locked) { background: var(--surface-3); }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text); min-height: 100vh; -webkit-font-smoothing: antialiased; line-height: 1.5;
}
a { color: var(--accent); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 18px 18px 90px; }
.narrow { max-width: 460px; }
.hidden { display: none !important; }

/* ---------- splash / pantalla de carga ---------- */
.splash {
  position: fixed; inset: 0; z-index: 200; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  transition: opacity .45s ease; opacity: 1;
}
.splash.hide { opacity: 0; pointer-events: none; }
.splash-mark { border-radius: 22px; box-shadow: 0 18px 50px -14px var(--primary-glow); animation: splashPulse 1.6s ease-in-out infinite; }
.splash-mark svg { display: block; border-radius: 22px; }
.splash-word { font-family: var(--serif); font-weight: 600; font-size: 28px; letter-spacing: -.01em; color: var(--text); margin-top: 4px; }
.splash-word span { color: var(--primary); }
.splash-sub { font-size: 13px; color: var(--text-dim); letter-spacing: .3px; margin-top: -6px; }
.splash-bar { position: relative; width: 180px; height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.splash-bar i { position: absolute; top: 0; left: -40%; width: 40%; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent); animation: splashBar 1.1s ease-in-out infinite; }
@keyframes splashPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes splashBar { 0% { left: -45%; } 100% { left: 100%; } }

/* ---------- nav ---------- */
.nav {
  display: flex; align-items: center; gap: 14px; max-width: var(--maxw);
  margin: 0 auto; padding: 16px 18px;
}
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; text-decoration: none; color: inherit; }
.brand-mark {
  flex: none; display: inline-grid; place-items: center; line-height: 0;
  border-radius: 14px; box-shadow: 0 10px 24px -8px var(--primary-glow);
  transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease;
}
.brand-mark svg { display: block; border-radius: 14px; }
.brand:hover .brand-mark { transform: translateY(-1px) rotate(-4deg) scale(1.05); box-shadow: 0 16px 30px -8px var(--primary-glow); }
.brand-txt b { font-family: var(--serif); font-weight: 600; font-size: 19px; letter-spacing: -.01em; }
.brand-txt b { white-space: nowrap; }
.brand-accent { color: var(--primary); }
.brand-txt > span { display: block; font-size: 11.5px; color: var(--text-dim); letter-spacing: .2px; }
.nav .spacer { flex: 1; }
.nav a.link { color: var(--text-soft); text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 10px; border-radius: 8px; }
.nav a.link:hover { color: var(--text); background: var(--surface-2); }

/* ---------- botones ---------- */
.btn {
  appearance: none; border: none; cursor: pointer; font-family: inherit; font-weight: 600;
  font-size: 15px; padding: 13px 22px; border-radius: 12px; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--primary); color: #fff;
  transition: .15s;
}
.btn:hover { transform: translateY(-1px); background: var(--primary-2); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.block { width: 100%; }
.btn.sm { padding: 9px 14px; font-size: 13.5px; }
.btn.danger { background: #d83b3b; box-shadow: none; }
.btn.danger:hover { background: #c22f2f; }
.btn.paypal { background: #ffc439; color: #062c5b; }
.btn.stripe { background: #635bff; }

/* ---------- cards / forms ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
h1 { font-family: var(--serif); font-weight: 600; font-size: 30px; letter-spacing: -.01em; margin: 0 0 8px; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 21px; letter-spacing: -.005em; margin: 0 0 12px; }
.stat b, .price-big, .score-ring .pct { font-family: var(--serif); font-weight: 600; }
.muted { color: var(--text-dim); } .center { text-align: center; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-soft); margin-bottom: 6px; font-weight: 600; }
.input, input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-family: inherit; font-size: 15px;
}
.input:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-soft); }
.checkbox input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.alert { padding: 12px 14px; border-radius: 11px; font-size: 14px; margin-bottom: 14px; }
.alert.err { background: var(--red-soft); border: 1px solid var(--red-border); color: var(--err-text); }
.alert.ok { background: var(--green-soft); border: 1px solid var(--green-border); color: var(--ok-text); }
.alert.warn { background: rgba(180,83,9,.10); border: 1px solid rgba(180,83,9,.35); color: var(--warn-text); }
.icon-btn { width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--text-soft); cursor: pointer; display: grid; place-items: center; font-size: 18px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.tag { font-size: 11.5px; font-weight: 700; letter-spacing: .4px; padding: 4px 10px; border-radius: 8px; display: inline-block; }
.tag.year { background: var(--green-soft); color: var(--primary); }
.tag.topic { background: var(--surface-3); color: var(--text-soft); }
.tag.ok { background: var(--green-soft); color: var(--ok-text); }
.tag.no { background: var(--red-soft); color: var(--err-text); }
.tag.warn { background: rgba(180,83,9,.12); color: var(--warn-text); }
.badge-pill { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }

/* ---------- landing ---------- */
.hero-land { text-align: center; padding: 50px 20px 30px; }
.hero-land h1 { font-size: 40px; line-height: 1.1; margin-bottom: 14px; }
.hero-land .grad { background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-land p { color: var(--text-soft); font-size: 17px; max-width: 620px; margin: 0 auto 26px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 30px 0; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.feature .emoji { font-size: 26px; } .feature h3 { margin: 10px 0 6px; font-size: 16px; }
.feature p { color: var(--text-soft); font-size: 14px; margin: 0; }
.pricing { max-width: 380px; margin: 30px auto; text-align: center; }
.price-big { font-size: 44px; font-weight: 800; } .price-big small { font-size: 16px; color: var(--text-dim); font-weight: 500; }

/* ---------- stats / admin ---------- */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; text-align: center; }
.stat b { display: block; font-size: 24px; line-height: 1.1; } .stat span { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
tbody tr:hover { background: var(--surface-2); cursor: pointer; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab { padding: 9px 16px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-soft); cursor: pointer; font-weight: 600; font-size: 14px; }
.tab.active { background: var(--primary); color: #fff; border-color: transparent; }
.bar { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); }

/* ---------- quiz ---------- */
.mode-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.mode { position: relative; text-align: left; cursor: pointer; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; transition: .18s; display: flex; gap: 14px; align-items: flex-start; color: inherit; }
.mode:hover { transform: translateY(-3px); border-color: var(--primary); }
.mode .emoji { width: 44px; height: 44px; flex: none; border-radius: 12px; font-size: 22px; display: grid; place-items: center; background: var(--surface-3); }
.mode h3 { margin: 0 0 4px; font-size: 16px; } .mode p { margin: 0; font-size: 13px; color: var(--text-soft); }
.mode .count { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { cursor: pointer; padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-soft); }
.chip:hover { color: var(--text); border-color: var(--primary); }
.chip.active { background: var(--primary); color: #fff; border-color: transparent; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); margin: 24px 4px 12px; }
.quiz-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.progress-wrap { flex: 1; } .progress-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-dim); margin-bottom: 6px; }
.progress-bar { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--primary); transition: width .35s ease; }
.q-tags { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.q-text { font-size: 18px; font-weight: 600; line-height: 1.45; margin: 4px 0 18px; }
.options { display: flex; flex-direction: column; gap: 11px; }
.option { display: flex; gap: 13px; align-items: flex-start; text-align: left; width: 100%; cursor: pointer; padding: 14px 16px; border-radius: var(--radius-sm); font-family: inherit; background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text); font-size: 15px; transition: .14s; line-height: 1.4; }
.option:hover:not(.locked) { border-color: var(--primary); transform: translateX(2px); }
.option .key { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); font-weight: 700; font-size: 14px; }
.option.locked { cursor: default; }
.option.correct { background: var(--green-soft); border-color: var(--green-border); } .option.correct .key { background: var(--green); color: #04210f; }
.option.wrong { background: var(--red-soft); border-color: var(--red-border); } .option.wrong .key { background: var(--red); color: #2a0606; }
.option .mark { margin-left: auto; font-weight: 800; } .option.correct .mark { color: var(--green); } .option.wrong .mark { color: var(--red); }
.feedback { margin-top: 18px; border-radius: var(--radius-sm); border: 1px solid var(--border); overflow: hidden; }
.feedback-head { padding: 12px 16px; font-weight: 700; }
.feedback.ok .feedback-head { background: var(--green-soft); color: var(--green); } .feedback.no .feedback-head { background: var(--red-soft); color: var(--red); }
.feedback-body { padding: 14px 16px; font-size: 14.5px; color: var(--text-soft); line-height: 1.6; background: var(--surface-2); }
.feedback-topic { margin-top: 10px; font-size: 12px; color: var(--text-dim); }
.quiz-foot { display: flex; gap: 12px; margin-top: 18px; }
.score-ring { width: 150px; height: 150px; margin: 0 auto 18px; position: relative; }
.score-ring svg { transform: rotate(-90deg); } .score-ring .pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; font-weight: 800; }
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.year-cell { cursor: pointer; text-align: center; padding: 16px 8px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); color: inherit; }
.year-cell:hover { transform: translateY(-2px); border-color: var(--primary); } .year-cell b { font-size: 19px; display: block; } .year-cell span { font-size: 11px; color: var(--text-dim); }
.review-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 10px; background: var(--surface-2); }
.review-line { font-size: 13.5px; padding: 2px 0; } .review-line.good { color: var(--green); } .review-line.bad { color: var(--red); }

/* ---------- gate (paywall / verify) ---------- */
.gate { max-width: 520px; margin: 40px auto; text-align: center; }
.gate .emoji { font-size: 46px; }

/* ---------- cookie banner ---------- */
.cookie-banner { position: fixed; bottom: 16px; left: 16px; right: 16px; max-width: 760px; margin: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); z-index: 80; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cookie-banner p { margin: 0; font-size: 13.5px; color: var(--text-soft); flex: 1; min-width: 240px; }

/* ---------- toast / qr ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--surface-3); border: 1px solid var(--border); color: var(--text); padding: 11px 20px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 90; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#qrcode { display: inline-block; padding: 12px; background: #fff; border-radius: 12px; }
.legal { max-width: 760px; line-height: 1.7; } .legal h2 { margin-top: 28px; } .legal p, .legal li { color: var(--text-soft); }

@media (max-width: 720px) {
  .features { grid-template-columns: 1fr; } .stats-row { grid-template-columns: repeat(2,1fr); }
  .mode-grid { grid-template-columns: 1fr; } .grid2 { grid-template-columns: 1fr; }
  .hero-land h1 { font-size: 30px; } table { font-size: 12.5px; } th, td { padding: 8px; }
}
