/* =========================================================================
   Aprueba — hoja de estilos
   Concepto: «papel oficial». Papel cálido, tinta azul marino, sello terracota.
   Reglas: docs/design/ui.md（SVG 禁止・押せる所は cursor:pointer・CLS を出さない）
   ========================================================================= */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin-opsz-normal.woff2") format("woff2-variations");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin-opsz-italic.woff2") format("woff2-variations");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #14213d;
  --ink-2: #26375c;
  --ink-3: #4a5878;
  --muted: #5f6678;
  --paper: #f6f1e7;
  --paper-2: #ede5d3;
  --card: #fffdf8;
  --line: #e2d9c6;
  --line-2: #cfc3aa;
  --accent: #b8431a;
  --accent-2: #d9822b;
  --accent-soft: #f7e3d6;
  --gold: #c99a2e;
  --ok: #1d7448;
  --ok-bg: #e5f3ea;
  --ok-line: #9fd0b2;
  --bad: #b3261e;
  --bad-bg: #fbe9e7;
  --bad-line: #efb2ab;
  --focus: #2f6fed;
  --shadow-1: 0 1px 2px rgba(20, 33, 61, .06), 0 2px 8px rgba(20, 33, 61, .05);
  --shadow-2: 0 2px 6px rgba(20, 33, 61, .08), 0 14px 32px rgba(20, 33, 61, .10);
  --shadow-paper: 0 1px 0 rgba(255,255,255,.7) inset, 0 18px 40px -18px rgba(20, 33, 61, .35);
  --radius: 14px;
  --radius-s: 9px;
  --serif: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1120px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}


*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(1200px 500px at 85% -10%, rgba(217, 130, 43, .10), transparent 60%),
    radial-gradient(900px 400px at -10% 10%, rgba(38, 55, 92, .08), transparent 60%);
  background-repeat: no-repeat;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink-2); text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
a, button, summary, select, label[for], input[type="checkbox"], input[type="radio"], [role="button"] { cursor: pointer; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); color: var(--ink); }

h1, h2, h3, h4 { font-family: var(--serif); font-optical-sizing: auto; letter-spacing: -.012em; line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2rem, 1.2rem + 3.4vw, 3.35rem); font-weight: 650; }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2.05rem); font-weight: 620; }
h3 { font-size: 1.22rem; font-weight: 620; }
p { margin: 0 0 1em; }
.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 2rem, 780px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: .6rem 1rem; z-index: 99; }
.skip:focus { left: 1rem; top: 1rem; }
.eyebrow { font: 600 .78rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: .9rem; display: inline-flex; gap: .5rem; align-items: center; }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }
.lead { font-size: clamp(1.08rem, 1rem + .4vw, 1.25rem); color: var(--ink-3); max-width: 62ch; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 40px; height: 40px; border-radius: 11px; box-shadow: var(--shadow-1); transition: transform .5s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.04); }
.brand-word { font: 700 1.42rem/1 var(--serif); letter-spacing: -.02em; }
.nav-toggle > summary { list-style: none; display: none; align-items: center; gap: .5rem; padding: .5rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-weight: 600; font-size: .92rem; }
.nav-toggle > summary::-webkit-details-marker { display: none; }
.burger, .burger::before, .burger::after { display: block; width: 16px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; transition: transform .3s var(--ease), opacity .2s; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -5px; } .burger::after { top: 5px; }
.nav-toggle[open] .burger { background: transparent; }
.nav-toggle[open] .burger::before { transform: translateY(5px) rotate(45deg); }
.nav-toggle[open] .burger::after { transform: translateY(-5px) rotate(-45deg); }
.nav-list { list-style: none; display: flex; gap: .3rem; margin: 0; padding: 0; }
.nav-list a { display: block; padding: .5rem .85rem; border-radius: 999px; text-decoration: none; font-weight: 550; font-size: .95rem; color: var(--ink-2); transition: background .2s, color .2s; }
.nav-list a:hover { background: var(--paper-2); color: var(--ink); }
.nav-list a.is-current { background: var(--ink); color: var(--paper); }
.nav-toggle { display: none; }
@media (max-width: 820px) {
  .nav-desktop { display: none; }
  .nav-toggle { display: block; }
  .nav-toggle > summary { display: inline-flex; }
  .nav-mobile { position: absolute; right: 1rem; top: 60px; flex-direction: column; min-width: 230px; padding: .5rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2); animation: drop .25s var(--ease); }
  .nav-mobile a { border-radius: 10px; padding: .75rem .9rem; }
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Breadcrumbs ---------- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem .5rem; padding: 1rem 0 0; margin: 0; font-size: .86rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: .5rem; color: var(--line-2); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- Buttons & chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; padding: .85rem 1.3rem; border-radius: 999px; font-weight: 650; font-size: 1rem; text-decoration: none; border: 1px solid transparent; transition: transform .2s var(--ease), box-shadow .2s, background .2s, color .2s; line-height: 1.1; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--ink); color: var(--paper); box-shadow: 0 10px 24px -10px rgba(20,33,61,.6); }
.btn-primary:hover { color: var(--paper); background: var(--ink-2); box-shadow: 0 14px 28px -12px rgba(20,33,61,.65); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -10px rgba(184,67,26,.7); }
.btn-accent:hover { color: #fff; filter: brightness(1.06); }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-1); }
.btn-small { padding: .5rem .9rem; font-size: .88rem; }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.linklike { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .65rem; border-radius: 999px; font: 600 .78rem/1.2 var(--sans); letter-spacing: .02em; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.chip--accent { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.chip--ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.chip--ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(2.5rem, 2rem + 3vw, 5rem) 0; }
.section--tight { padding: 2rem 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.section-head p { margin: 0; color: var(--muted); max-width: 60ch; }
.band { background: var(--card); border-block: 1px solid var(--line); }
.band--ink { background: linear-gradient(180deg, #fbf8f1, #f3ecdc); color: var(--ink); border-block: 1px solid var(--line); }
.band--ink h2, .band--ink h3 { color: var(--ink); }

/* ---------- Hero (home) ---------- */
.hero { padding: clamp(2.5rem, 1.5rem + 5vw, 5.5rem) 0 clamp(2.5rem, 2rem + 3vw, 4.5rem); position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 1rem + 4vw, 4.5rem); align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 1.2rem + 4.6vw, 4.1rem); line-height: 1.04; letter-spacing: -.025em; }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--accent); position: relative; white-space: nowrap; }
.hero h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: .06em; height: .18em; background: linear-gradient(90deg, var(--accent-2), var(--gold)); opacity: .35; border-radius: 4px; transform-origin: left; animation: underline 1.2s .4s var(--ease) both; z-index: -1; }
@keyframes underline { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.8rem 0 1.4rem; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: .9rem; color: var(--muted); padding: 0; margin: 0; list-style: none; }
.hero-trust li { display: inline-flex; align-items: center; gap: .45rem; }
.tick { width: 18px; height: 18px; border-radius: 50%; background: var(--ok-bg); border: 1px solid var(--ok-line); position: relative; flex: none; }
.tick::after { content: ""; position: absolute; left: 5.5px; top: 3px; width: 5px; height: 9px; border: solid var(--ok); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* Documento «BOE» dibujado con CSS */
.doc-stage { position: relative; min-height: 430px; perspective: 1200px; margin-bottom: 64px; }
.doc { position: absolute; inset: 0 6% 0 4%; background: linear-gradient(180deg, #fffefb, #fbf7ee); border-radius: 6px; box-shadow: var(--shadow-paper); padding: 2.1rem 2rem 2rem; transform: rotate(-2.2deg); color: #1b2440; animation: float-in .9s var(--ease) both; }
.doc::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(180deg, transparent 0 30px, rgba(20,33,61,.045) 30px 31px); pointer-events: none; }
.doc--back { transform: rotate(3.5deg) translate(18px, 10px); background: #f4ecdc; animation-delay: .05s; }
.doc--back2 { transform: rotate(-6deg) translate(-16px, 16px); background: #efe5d0; animation-delay: 0s; opacity: .9; }
@keyframes float-in { from { opacity: 0; transform: translateY(18px) rotate(0deg); } }
.doc-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #1b2440; padding-bottom: .55rem; margin-bottom: 1.1rem; font: 700 .74rem/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; }
.doc-head span:last-child { font-weight: 500; letter-spacing: .04em; color: #5a6178; }
.doc-art { font: 650 1.15rem/1.3 var(--serif); margin-bottom: .6rem; }
.doc-text { font: 400 .98rem/1.7 var(--serif); position: relative; }
.doc-text p { margin: 0 0 .7rem; }
.hl { background: linear-gradient(90deg, rgba(217,130,43,.38), rgba(201,154,46,.32)); background-size: 0% 100%; background-repeat: no-repeat; animation: mark 1.1s 1s var(--ease) forwards; border-radius: 3px; padding: 0 .1em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
@keyframes mark { to { background-size: 100% 100%; } }
.stamp { position: absolute; right: -6px; bottom: 34px; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; text-align: center; color: var(--accent); border: 3px solid currentColor; box-shadow: inset 0 0 0 5px var(--card), inset 0 0 0 7px currentColor; font: 800 .74rem/1.15 var(--sans); letter-spacing: .12em; text-transform: uppercase; transform: rotate(-14deg) scale(1); background: color-mix(in srgb, var(--card) 70%, transparent); animation: stamp .55s 1.8s cubic-bezier(.3,1.6,.5,1) both; mix-blend-mode: multiply; }
.stamp strong { display: block; font: 800 1.25rem/1 var(--serif); letter-spacing: .02em; margin: .25rem 0; }
@keyframes stamp { from { opacity: 0; transform: rotate(-14deg) scale(1.8); } to { opacity: .92; transform: rotate(-14deg) scale(1); } }
.qcard-float { position: absolute; left: -4%; bottom: -64px; width: min(320px, 76%); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 1rem 1.05rem; font-size: .9rem; animation: float-in .9s .5s var(--ease) both; }
.qcard-float .q { font-weight: 650; margin-bottom: .6rem; line-height: 1.35; }
.qcard-float .opt { display: flex; gap: .5rem; align-items: center; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 9px; margin-top: .35rem; background: var(--paper); }
.qcard-float .opt.ok { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); font-weight: 650; animation: pulse-ok 2.6s 2.4s ease-in-out infinite; }
@keyframes pulse-ok { 0%, 100% { box-shadow: 0 0 0 0 rgba(29,116,72,.0); } 50% { box-shadow: 0 0 0 5px rgba(29,116,72,.14); } }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; flex: none; opacity: .6; }
.opt.ok .dot { background: currentColor; opacity: 1; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .doc-stage { min-height: 400px; margin-top: 1rem; }
  .qcard-float { left: 0; }
}
@media (max-width: 520px) {
  .doc { padding: 1.5rem 1.2rem; inset: 0 3% 0 2%; }
  .doc-stage { min-height: 360px; }
  .doc-text p:first-child { display: none; }
  .stamp { width: 96px; height: 96px; right: -4px; bottom: 16px; font-size: .58rem; }
  .stamp strong { font-size: 1rem; }
}

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--card); padding: 1.3rem 1.4rem; }
.stat b { display: block; font: 700 clamp(1.7rem, 1.2rem + 1.6vw, 2.4rem)/1 var(--serif); letter-spacing: -.02em; color: var(--ink); margin-bottom: .35rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .9rem; color: var(--muted); }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr; } }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 1.2rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.4rem 1.3rem; box-shadow: var(--shadow-1); transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; }
.card--link:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.card--link a.stretch::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card h3 { margin-bottom: .4rem; }
.card h3 a { text-decoration: none; color: var(--ink); }
.card .meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.card p { color: var(--ink-3); font-size: .97rem; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-top: 1rem; padding-top: .9rem; border-top: 1px dashed var(--line); font-size: .9rem; color: var(--muted); }
.card-foot .go { font-weight: 650; color: var(--accent); }
.card-media { margin: -1.4rem -1.4rem 1.1rem; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; aspect-ratio: 16 / 7; background: var(--paper-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.card--link:hover .card-media img { transform: scale(1.04); }
.card-exam { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: start; }
.badge-group { font: 800 1.6rem/1 var(--serif); color: var(--accent); border: 2px solid currentColor; border-radius: 12px; padding: .5rem .6rem; transform: rotate(-4deg); }

/* steps */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.step { position: relative; padding: 1.3rem 1.2rem 1.2rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-1); border-top: 3px solid var(--ink-2); }
.step::before { counter-increment: step; content: counter(step, decimal-leading-zero); font: 700 2.2rem/1 var(--serif); color: var(--accent); display: block; margin-bottom: .7rem; }
.step h3 { font-size: 1.08rem; }
.step p { font-size: .94rem; margin: 0; color: var(--ink-3); }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Page header (inner pages) ---------- */
.page-head { padding: 1.6rem 0 2rem; }
.page-head h1 { max-width: 22ch; }
.page-head .lead { margin-bottom: 1.2rem; }
.page-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; font-size: .9rem; color: var(--muted); margin: 0; padding: 0; list-style: none; }
.page-meta li { display: inline-flex; align-items: center; gap: .4rem; }
.page-meta b { color: var(--ink); font-weight: 650; }
.head-split { display: grid; grid-template-columns: 1fr 340px; gap: 2.5rem; align-items: center; }
.head-figure { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-2); aspect-ratio: 4 / 3; background: var(--paper-2); transform: rotate(1.2deg); }
.head-figure img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) { .head-split { grid-template-columns: 1fr; } .head-figure { max-width: 420px; } }

/* ---------- Prose ---------- */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.6rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .4rem; }
.prose table { width: 100%; }
.note { border-left: 4px solid var(--accent-2); background: var(--card); padding: 1rem 1.2rem; border-radius: 0 var(--radius-s) var(--radius-s) 0; box-shadow: var(--shadow-1); margin: 1.4rem 0; }
.note p:last-child { margin: 0; }

/* intro with citations */
.intro-list { display: grid; gap: .9rem; margin: 0 0 1rem; }
.intro-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.intro-item p { margin: 0 0 .5rem; }
.cite-inline { font-size: .84rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
.cite-inline a { color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-1); -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font: 650 .78rem/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--paper-2); position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .2s; }
tbody tr:hover { background: color-mix(in srgb, var(--paper-2) 55%, transparent); }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* facts grid (exam) */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.fact { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.15rem 1rem; position: relative; overflow: hidden; }
.fact::after { content: ""; position: absolute; right: -24px; top: -24px; width: 80px; height: 80px; border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 70%); }
.fact .k { font: 650 .76rem/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fact .v { font: 700 1.55rem/1.15 var(--serif); margin: .45rem 0 .35rem; letter-spacing: -.01em; }
.fact .d { font-size: .88rem; color: var(--ink-3); margin: 0; }
.fact sup a, sup.ref a { text-decoration: none; font: 700 .7rem/1 var(--sans); color: var(--accent); padding: 0 .15rem; }
@media (max-width: 900px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; } }

/* exam diagram */
.exam-diagram { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-1); }
.bar { display: flex; height: 64px; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); }
.bar > div { display: flex; flex-direction: column; justify-content: center; padding: 0 .9rem; color: #fff; font: 650 .86rem/1.2 var(--sans); min-width: 0; position: relative; }
.bar > div small { font-weight: 500; opacity: .85; font-size: .76rem; }
.bar .b1 { background: linear-gradient(135deg, #26375c, #14213d); }
.bar .b2 { background: linear-gradient(135deg, #4a6fa5, #33528a); }
.bar .b3 { background: linear-gradient(135deg, #d9822b, #b8431a); }
.bar > div { animation: grow 1s var(--ease) both; transform-origin: left; }
.bar > div:nth-child(2) { animation-delay: .12s; } .bar > div:nth-child(3) { animation-delay: .24s; }
@keyframes grow { from { transform: scaleX(0); opacity: 0; } }
.bar-legend { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); margin-top: .6rem; flex-wrap: wrap; gap: .5rem; }
.calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: .8rem; margin-top: 1.3rem; }
.calc div { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; }
.calc b { display: block; font: 700 1.5rem/1.1 var(--serif); }
.calc span { font-size: .85rem; color: var(--muted); }
.calc .eq { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.calc .eq span { color: var(--ok); }

/* temario */
.temario { display: grid; gap: 1.5rem; }
.tema-block h3 { display: flex; align-items: center; gap: .6rem; }
.tema-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.tema { display: grid; grid-template-columns: 52px 1fr auto; gap: 1rem; padding: .95rem 1.1rem; border-bottom: 1px solid var(--line); align-items: start; }
.tema:last-child { border-bottom: 0; }
.tema-n { font: 700 1.25rem/1.2 var(--serif); color: var(--accent); }
.tema-t { font-size: .96rem; }
.tema-s { white-space: nowrap; }
.tema.is-ready { background: linear-gradient(90deg, var(--ok-bg), transparent 55%); }
@media (max-width: 640px) { .tema { grid-template-columns: 38px 1fr; } .tema-s { grid-column: 2; } }

/* sources list */
.sources { list-style: none; counter-reset: src; padding: 0; margin: 0; display: grid; gap: .7rem; }
.sources li { counter-increment: src; display: grid; grid-template-columns: 34px 1fr; gap: .6rem; font-size: .92rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; }
.sources li::before { content: counter(src); font: 700 .8rem/1 var(--sans); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.sources li:target { outline: 2px solid var(--accent); }
blockquote.q { margin: .4rem 0; padding: .5rem .8rem; border-left: 3px solid var(--gold); background: var(--paper); font: italic 400 .95rem/1.55 var(--serif); border-radius: 0 8px 8px 0; color: var(--ink-2); }

/* ---------- Quiz ---------- */
.quiz-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; align-items: start; }
.quiz-side { position: sticky; top: 84px; display: grid; gap: 1rem; }
@media (max-width: 1000px) { .quiz-layout { grid-template-columns: 1fr; } .quiz-side { position: static; } }
.mbar { display: none; }
@media (max-width: 1000px) {
  .mbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; align-items: center; gap: .8rem; padding: .55rem 1rem calc(.55rem + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--line); font-size: .85rem; box-shadow: 0 -6px 20px rgba(20,33,61,.08); }
  .mbar .progress { flex: 1; height: 8px; }
  .mbar b { font-variant-numeric: tabular-nums; }
  .mbar .ok { color: var(--ok); } .mbar .bad { color: var(--bad); }
  .page-quiz .site-footer { padding-bottom: 4.5rem; }
}
.scorebox { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.15rem; box-shadow: var(--shadow-1); }
.scorebox h2 { font-size: 1.05rem; margin-bottom: .8rem; }
.progress { height: 10px; border-radius: 999px; background: var(--paper-2); overflow: hidden; display: flex; }
.progress i { display: block; height: 100%; transition: width .5s var(--ease); }
.progress .p-ok { background: var(--ok); } .progress .p-bad { background: var(--bad); }
.score-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .9rem 0; text-align: center; }
.score-nums b { display: block; font: 700 1.35rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.score-nums span { font-size: .75rem; color: var(--muted); }
.score-nums .n-ok b { color: var(--ok); } .score-nums .n-bad b { color: var(--bad); }
.net { display: flex; justify-content: space-between; align-items: baseline; padding: .7rem .8rem; background: var(--paper); border-radius: 10px; font-size: .88rem; }
.net b { font: 700 1.3rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.side-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.toggle { display: flex; align-items: center; gap: .55rem; font-size: .88rem; margin-top: .8rem; color: var(--ink-3); }
.toggle input { width: 18px; height: 18px; accent-color: var(--ink); }
.qnav { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: .35rem; }
.qnav a { display: grid; place-items: center; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font: 650 .82rem/1 var(--sans); text-decoration: none; color: var(--ink-3); transition: transform .15s, background .2s; }
.qnav a:hover { transform: translateY(-2px); color: var(--ink); border-color: var(--line-2); }
.qnav a.is-ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.qnav a.is-bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }

.qlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.2rem; counter-reset: q; }
.qcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 1.35rem 1.4rem 1.2rem; position: relative; transition: border-color .3s, box-shadow .3s; scroll-margin-top: 90px; }
.qcard:target { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent), var(--shadow-1); }
.qcard.is-ok { border-color: var(--ok-line); }
.qcard.is-bad { border-color: var(--bad-line); }
.qcard.is-hidden { display: none; }
.q-top { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.q-num { font: 700 .8rem/1 var(--sans); letter-spacing: .08em; color: var(--muted); text-transform: uppercase; text-decoration: none; }
.q-num:hover { color: var(--accent); }
.q-body { font: 600 1.13rem/1.5 var(--sans); margin: 0 0 1rem; letter-spacing: -.005em; }
.choices { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.choice { width: 100%; text-align: left; display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: .8rem; padding: .78rem .95rem; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); font-size: 1rem; line-height: 1.4; transition: border-color .2s, background .2s, transform .15s var(--ease), box-shadow .2s; }
.choice:hover:not([disabled]) { border-color: var(--ink-3); background: var(--card); transform: translateX(3px); box-shadow: var(--shadow-1); }
.choice:active:not([disabled]) { transform: scale(.995); }
.choice[disabled] { cursor: default; }
.choice .letter { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 .85rem/1 var(--sans); background: var(--card); border: 1.5px solid var(--line-2); color: var(--ink-3); transition: all .2s; }
.choice .mark { font-weight: 700; font-size: .82rem; opacity: 0; transition: opacity .3s; white-space: nowrap; }
.choice.is-correct { border-color: var(--ok); background: var(--ok-bg); }
.choice.is-correct .letter { background: var(--ok); border-color: var(--ok); color: #fff; }
.choice.is-correct .mark { opacity: 1; color: var(--ok); }
.choice.is-wrong { border-color: var(--bad); background: var(--bad-bg); animation: shake .4s; }
.choice.is-wrong .letter { background: var(--bad); border-color: var(--bad); color: #fff; }
.choice.is-wrong .mark { opacity: 1; color: var(--bad); }
.choice.is-dim { opacity: .62; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.tf { grid-template-columns: 1fr 1fr; }
.tf .choice { grid-template-columns: 32px 1fr; justify-items: start; }
.tf .choice .mark { display: none; }
.solution { margin-top: 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); overflow: hidden; }
.solution > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .75rem 1rem; font-weight: 650; font-size: .93rem; color: var(--ink-2); }
.solution > summary::-webkit-details-marker { display: none; }
.solution > summary::after { content: ""; width: 9px; height: 9px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .3s var(--ease); margin-right: .3rem; }
.solution[open] > summary::after { transform: rotate(-135deg); }
.solution-body { padding: 0 1rem 1rem; animation: reveal .45s var(--ease); }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }
.answer-line { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .7rem .9rem; background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok); border-radius: 10px; font-weight: 650; margin-bottom: .8rem; }
.explanation { font-size: .99rem; color: var(--ink-2); }
.basis { margin-top: .9rem; display: grid; gap: .7rem; }
.basis-item { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem .8rem 1.1rem; }
.basis-item::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: linear-gradient(var(--gold), var(--accent)); }
.basis-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .7rem; font-weight: 650; font-size: .92rem; }
.basis-title .loc { color: var(--accent); }
.basis-meta { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .45rem; }
.basis-meta a { color: var(--muted); }
.article-full { margin-top: .55rem; }
.article-full > summary { font-size: .84rem; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; list-style: none; display: inline; }
.article-full > summary::-webkit-details-marker { display: none; }
.article-text { margin-top: .5rem; font: 400 .93rem/1.65 var(--serif); background: var(--paper); border-radius: 8px; padding: .7rem .9rem; border: 1px dashed var(--line-2); }
.article-text p { margin: 0 0 .5rem; }
.q-foot { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-top: .9rem; flex-wrap: wrap; }
.report-btn { background: none; border: 0; padding: .25rem 0; color: var(--muted); font-size: .84rem; text-decoration: underline; text-underline-offset: 3px; }
.report-btn:hover { color: var(--accent); }
.report-form { margin-top: .8rem; display: grid; gap: .6rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.report-form[hidden] { display: none; }
.updated { font-size: .78rem; color: var(--muted); }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.results { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-top: 4px solid var(--ok); border-radius: var(--radius); padding: 1.6rem; margin-top: 1.6rem; box-shadow: var(--shadow-2); position: relative; overflow: hidden; }
.results[hidden] { display: none; }
.results::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(29,116,72,.10), transparent 70%); }
.results h2 { color: var(--ink); }
.results .big { font: 700 3rem/1 var(--serif); }
.results p { color: var(--ink-3); }
.results .big { color: var(--ok); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1.1rem; }
.field label, .field .label { display: block; font-weight: 650; font-size: .93rem; margin-bottom: .35rem; }
.field .hint { font-size: .84rem; color: var(--muted); margin-top: .3rem; }
input[type="text"], input[type="email"], input[type="password"], select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 11px; padding: .75rem .9rem; transition: border-color .2s, box-shadow .2s; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2.5rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent); }
textarea { min-height: 150px; resize: vertical; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .93rem; }
.check input { width: 20px; height: 20px; margin-top: .15rem; accent-color: var(--ink); flex: none; }
.errors { background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad); border-radius: 12px; padding: .9rem 1.1rem; }
.errors ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.success { background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok); border-radius: 12px; padding: 1rem 1.2rem; font-weight: 600; }

/* ---------- Changelog ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.4rem; border-left: 2px solid var(--line); display: grid; gap: 1.2rem; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: calc(-1.4rem - 7px); top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--paper); }
.empty { text-align: center; padding: 2.5rem 1.5rem; border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: var(--card); }
.empty .big { font: 700 1.4rem/1.3 var(--serif); margin-bottom: .5rem; }

/* ---------- Structure (law) ---------- */
.structure { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.structure li { display: grid; grid-template-columns: 120px 1fr auto; gap: 1rem; align-items: center; padding: .75rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.structure .lab { font: 700 .95rem/1.2 var(--serif); }
.structure .rng { font-size: .85rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.structure li.is-ready { border-color: var(--ok-line); background: linear-gradient(90deg, var(--ok-bg), var(--card) 60%); }
.structure li a { font-weight: 650; }
@media (max-width: 560px) { .structure li { grid-template-columns: 1fr; gap: .2rem; } }

/* ---------- Footer ---------- */
.site-footer { margin-top: 4rem; background: #efe8d8; color: var(--ink-3); padding: 3rem 0 1.5rem; font-size: .93rem; border-top: 1px solid var(--line-2); }
.site-footer a, .site-footer .linklike { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover, .site-footer .linklike:hover { color: var(--accent); text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.footer-title { font: 650 .78rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.brand--footer .brand-word { color: var(--ink); }
.footer-note { font-size: .84rem; color: var(--muted); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .8rem; border-top: 1px solid var(--line-2); margin-top: 2rem; padding-top: 1.2rem; font-size: .84rem; color: var(--muted); }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .site-footer, .quiz-side, .q-foot, .crumbs { display: none !important; }
  .solution { display: block; } .solution-body { display: block !important; }
  body { background: #fff; }
}

/* ---------- Cuenta (会員) ---------- */
.acct-link { display: inline-flex; align-items: center; gap: .4rem; margin-left: .4rem; padding: .48rem .95rem; border-radius: 999px; border: 1.5px solid var(--ink-2); color: var(--ink); font-weight: 650; font-size: .92rem; text-decoration: none; white-space: nowrap; transition: background .2s, color .2s; }
.acct-link:hover { background: var(--ink); color: var(--paper); }
.acct-link .dot-on { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: none; }
.acct-link.is-in .dot-on { display: inline-block; }
.header-actions { display: flex; align-items: center; gap: .3rem; }
@media (max-width: 820px) { .acct-link { padding: .42rem .75rem; font-size: .86rem; } }
.auth-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 2rem; align-items: start; padding: 2rem 0 1rem; }
.auth-card h1 { font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.4rem); }
.auth-card .form { margin-top: 1rem; }
.auth-side { padding: 1.5rem; border-radius: var(--radius); background: linear-gradient(180deg, #fbf8f1, #f3ecdc); border: 1px solid var(--line); }
.auth-side h2 { font-size: 1.25rem; }
.benefits { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .9rem; }
.benefits li { display: grid; grid-template-columns: 22px 1fr; gap: .6rem; font-size: .95rem; }
.benefits .tick { margin-top: .2rem; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } }
.acc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 1rem; }
@media (max-width: 640px) { .acc-stats { grid-template-columns: 1fr; } }
.activity { display: grid; grid-template-columns: repeat(14, 1fr); gap: .45rem; align-items: end; height: 140px; padding-top: .5rem; }
.act-col { display: flex; flex-direction: column; align-items: center; gap: .3rem; height: 100%; justify-content: flex-end; }
.act-col span { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.act-bar { width: 100%; max-width: 30px; background: #d9d0bc; border-radius: 6px 6px 3px 3px; position: relative; overflow: hidden; display: flex; align-items: flex-end; animation: grow-up .8s var(--ease) both; transform-origin: bottom; }
.act-bar i { display: block; width: 100%; background: var(--ok); }
@keyframes grow-up { from { transform: scaleY(0); } }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 .25rem 0 .6rem; vertical-align: middle; }
.lg-ok { background: var(--ok); } .lg-all { background: #d9d0bc; }
.danger > summary { color: var(--bad); font-weight: 600; font-size: .92rem; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { color: #fff; filter: brightness(1.05); }
.sync-note { font-size: .84rem; color: var(--muted); margin: .8rem 0 0; }
.sync-note a { font-weight: 600; }
