/* guinot.es — sistema visual v2
   Sin fuentes, scripts ni peticiones de terceros. */

:root {
  --bg: #f7f6f3;
  --bg-soft: #fbfaf8;
  --surface: #ffffff;
  --ink: #14161a;
  --ink-soft: #2a2e36;
  --muted: #5b6472;
  --line: #e3e1dc;
  --line-strong: #cfccc5;
  --accent: #f0281e;
  --accent-dark: #c81e15;
  --accent-soft: #fdecea;
  --ok: #1e7b34;
  --ok-soft: #e8f4ea;
  --warn: #9a4a06;
  --warn-soft: #fff4e5;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 18px 40px -30px rgba(20, 22, 26, .4);
  --shadow-lift: 0 2px 4px rgba(20, 22, 26, .05), 0 24px 48px -28px rgba(20, 22, 26, .45);
  --wrap: 1080px;
  --wrap-narrow: 760px;
  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, iframe { max-width: 100%; }
img { height: auto; }

a { color: var(--accent-dark); text-underline-offset: 2px; }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 3px solid rgba(240, 40, 30, .4);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: var(--wrap-narrow); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; top: 0; color: #fff; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Cabecera ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 246, 243, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 68px;
}
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.brand svg { width: 128px; height: auto; display: block; }

.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  padding: 8px 11px;
  border-radius: 8px;
  transition: color .15s ease, background .15s ease;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); background: rgba(20, 22, 26, .05); }
.site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"]::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px;
  background: var(--surface);
  flex: 0 0 auto;
}
.lang-switch a {
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  color: var(--muted);
  padding: 5px 9px;
  border-radius: 999px;
  line-height: 1;
}
.lang-switch a[aria-current="true"] { background: var(--ink); color: #fff; }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current="true"]:hover { color: #fff; }

.nav-toggle {
  display: none;
  margin-left: auto;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 9px;
  padding: 8px 11px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
}

@media (max-width: 860px) {
  .site-header .wrap { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .nav-toggle { display: inline-flex; align-items: center; gap: 8px; }
  .site-nav {
    order: 3;
    width: 100%;
    margin: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-bottom: 8px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 11px 12px; }
  .site-nav a[aria-current="page"]::after { display: none; }
  .site-nav a[aria-current="page"] { background: var(--accent-soft); }
  .lang-switch { margin-left: auto; }
}

/* ---------- Banner temporal ---------- */

.banner-slot { position: relative; z-index: 60; }
.banner-slot:empty { display: none; }
.banner-slot > div { font-family: var(--sans) !important; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(240, 40, 30, .07), transparent 65%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(20, 22, 26, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 22, 26, .035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(620px 340px at 70% 30%, #000 0%, transparent 75%);
  pointer-events: none;
}
#particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: .85;
}
.hero .wrap {
  position: relative;
  z-index: 1;
  padding-top: 84px;
  padding-bottom: 80px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 48px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin: 0 0 18px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--accent);
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -.045em;
  margin: 0 0 22px;
  max-width: 13ch;
  text-wrap: balance;
}
.hero h1 em { color: var(--accent); font-style: normal; }
.hero .lead {
  font-size: clamp(1.08rem, 1.8vw, 1.28rem);
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 30px;
}
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 10px;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 12px 22px;
  font: inherit;
  font-size: .98rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.btn:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -14px rgba(240, 40, 30, .8);
}
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { border-color: var(--ink); background: transparent; color: var(--ink); box-shadow: none; }
.btn.small { padding: 8px 14px; font-size: .88rem; }

.hero-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .72);
  box-shadow: var(--shadow);
  padding: 10px;
  transform: rotate(.6deg);
}
.hero-panel-inner {
  border-radius: 13px;
  background: var(--surface);
  padding: 26px;
}
.hero-panel h2 {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin: 0 0 14px;
}
.hero-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hero-list a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 6px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 650;
  border-top: 1px solid var(--line);
}
.hero-list li:first-child a { border-top: 0; }
.hero-list a span { color: var(--accent); font-weight: 800; font-size: .8rem; }
.hero-list small { display: block; color: var(--muted); font-weight: 400; font-size: .84rem; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero .wrap { padding-top: 56px; padding-bottom: 58px; }
  .hero-panel { transform: none; }
}

/* ---------- Secciones ---------- */

.section { padding: 74px 0; border-bottom: 1px solid var(--line); }
.section.alt { background: var(--surface); }
.section.tight { padding: 52px 0; }
.section-head { max-width: 64ch; margin-bottom: 36px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.55rem);
  line-height: 1.12;
  letter-spacing: -.028em;
  margin: 0 0 12px;
  text-wrap: balance;
}
.section-head p { color: var(--muted); margin: 0; font-size: 1.05rem; }

.cards { display: grid; gap: 18px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.cards.two { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 860px) {
  .cards.three { grid-template-columns: 1fr; }
  .cards.two { grid-template-columns: 1fr; }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
a.card { color: inherit; text-decoration: none; }
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); }
.card h3 { margin: 0 0 8px; font-size: 1.18rem; letter-spacing: -.01em; }
.card p { color: var(--muted); margin: 0 0 14px; }
.card .more { margin-top: auto; font-weight: 700; font-size: .9rem; color: var(--accent-dark); }
.card .num {
  display: inline-block;
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--accent-dark);
  margin-bottom: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  background: var(--accent-soft);
  color: var(--accent-dark);
  text-decoration: none;
  text-transform: uppercase;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.muted { background: #eef0f2; color: var(--muted); }

.split {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 34px;
  align-items: center;
}
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

/* ---------- Prosa / artículos ---------- */

.article-header {
  padding: 58px 0 34px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-soft), var(--bg));
}
.article-header .crumbs { max-width: calc(var(--wrap-narrow) + 48px); margin: 0 auto; }
.article-header h1 {
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -.035em;
  margin: 12px 0 16px;
  max-width: 24ch;
  text-wrap: balance;
}
.article-header .standfirst {
  font-size: 1.16rem;
  color: var(--muted);
  max-width: 62ch;
  margin: 0;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 24px;
  color: var(--muted);
  font-size: .88rem;
}
.article-meta strong { color: var(--ink); font-weight: 650; }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .82rem;
  color: var(--muted);
  padding-top: 22px;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs span { color: var(--line-strong); }

.prose {
  max-width: 72ch;
  margin: 0 auto;
  padding: 52px 0 72px;
  font-size: 1.06rem;
}
.prose > :first-child { margin-top: 0; }
.prose h2 {
  font-size: clamp(1.5rem, 2.6vw, 1.95rem);
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 2.2em 0 .6em;
  scroll-margin-top: 90px;
}
.prose h3 {
  font-size: 1.22rem;
  line-height: 1.3;
  margin: 1.8em 0 .5em;
  scroll-margin-top: 90px;
}
.prose h4 { font-size: 1.05rem; margin: 1.5em 0 .4em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.05em; }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li { margin-bottom: .4em; }
.prose blockquote {
  margin: 1.6em 0;
  padding: 16px 22px;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 0 10px 10px 0;
  color: var(--ink-soft);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code {
  font-family: var(--mono);
  font-size: .88em;
  background: #eef0f2;
  padding: 2px 6px;
  border-radius: 5px;
}
.prose pre {
  overflow-x: auto;
  background: var(--ink);
  color: #f3f2ef;
  padding: 18px 20px;
  border-radius: 10px;
  font-size: .9rem;
}
.prose pre code { background: none; padding: 0; color: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose a { font-weight: 500; }

.prose .lede { font-size: 1.15rem; color: var(--ink-soft); }
.prose .small { font-size: .88rem; color: var(--muted); }

.table-wrap { overflow-x: auto; margin: 1.6em 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table-wrap th, .table-wrap td { text-align: left; padding: 10px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap th { background: var(--bg-soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.table-wrap tr:last-child td { border-bottom: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: .93rem; background: var(--surface); }
.prose th, .prose td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { background: var(--bg-soft); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
.prose tr:last-child td { border-bottom: 0; }

.callout {
  margin: 1.6em 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: 0 10px 10px 0;
  background: var(--surface);
  font-size: .97rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout strong:first-child { display: block; margin-bottom: 4px; }
.callout.info { border-left-color: #2563eb; background: #f4f8ff; }
.callout.warn { border-left-color: #b45309; background: var(--warn-soft); }
.callout.ok { border-left-color: var(--ok); background: var(--ok-soft); }

.article-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 70px;
}
.license-note {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px;
  font-size: .9rem;
  color: var(--muted);
}
.license-note img { width: 88px; height: 31px; flex: 0 0 auto; }
.license-note p { margin: 0 0 6px; }
.license-note p:last-child { margin-bottom: 0; }

.references { margin-top: 2.4em; padding-top: 1.2em; border-top: 1px solid var(--line); }
.references h2 { margin-top: 0; }
.references ol { padding-left: 1.4em; }
.references li { margin-bottom: .75em; font-size: .95rem; }
.references p { padding-left: 1.4em; text-indent: -1.4em; margin: 0 0 .7em; }
.references .url { word-break: break-word; }

.toc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px 22px;
  margin: 0 0 2em;
  font-size: .93rem;
}
.toc strong { display: block; margin-bottom: 8px; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.toc ol { margin: 0; padding-left: 1.2em; }
.toc li { margin: .25em 0; }

/* ---------- Herramientas ---------- */

.tool-frame {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tool-frame iframe { display: block; width: 100%; border: 0; background: #fff; }
.tool-frame.tall iframe { min-height: 980px; }
.tool-frame.exam iframe { min-height: 1100px; }

.credit {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 18px 20px;
  margin: 22px 0 0;
  font-size: .92rem;
  color: var(--muted);
}
.credit strong { color: var(--ink); }
.credit .btn { flex: 0 0 auto; }

.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.feature-list li { position: relative; padding-left: 26px; color: var(--ink-soft); }
.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--ok);
  font-weight: 800;
}

/* ---------- Formulario ---------- */

.form-shell {
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.form-progress { height: 5px; background: var(--line); }
.form-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .3s ease;
}
.form-body { padding: 38px; }
.form-step { display: none; }
.form-step.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .form-step.active { animation: none; }
  html { scroll-behavior: auto; }
}

.form-step .step-label {
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin: 0 0 6px;
}
.form-step h2 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 22px; letter-spacing: -.02em; }
.form-step h2 .opt { color: var(--accent); }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 650; margin-bottom: 6px; font-size: .92rem; }
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--ink);
  font: inherit;
  padding: 12px 14px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(240, 40, 30, .12);
  outline: none;
}
.field small { color: var(--muted); font-size: .82rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }
.error-text { color: #b3261e; font-size: .85rem; display: none; margin-top: 5px; }
.field.invalid .error-text { display: block; }
.field.invalid input, .field.invalid textarea { border-color: #b3261e; }

.choices { display: grid; gap: 10px; }
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  background: var(--surface);
  font-weight: 600;
  transition: border-color .15s ease, background .15s ease;
}
.choice:hover { border-color: var(--accent); }
.choice input { accent-color: var(--accent); width: 18px; height: 18px; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice.invalid, .choices.invalid .choice { border-color: #b3261e; }
.choices.invalid + .error-text { display: block; color: #b3261e; }

.form-nav { display: flex; align-items: center; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.form-nav .hint { color: var(--muted); font-size: .84rem; margin-left: auto; }
.back-btn { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 8px 0; }
.back-btn:hover { color: var(--ink); }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--muted); }
.consent input { margin-top: 4px; accent-color: var(--accent); width: 17px; height: 17px; flex: 0 0 auto; }


.consent.invalid + .error-text { display: block; }
.consent.invalid { color: #b3261e; }

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin-top: 16px; font-size: .9rem; }
.form-status.error { color: #b3261e; }
.thanks { text-align: center; padding: 18px 0; }
.thanks .tick {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--ok-soft); color: var(--ok);
  display: grid; place-items: center; font-size: 1.7rem;
  margin: 0 auto 18px;
}

/* ---------- Pie ---------- */

.site-footer {
  background: var(--ink);
  color: #cfd3d9;
  padding: 54px 0 34px;
  font-size: .92rem;
}
.site-footer a { color: #e8eaed; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; }
.footer-brand svg { width: 120px; margin-bottom: 14px; }
.footer-brand svg path[fill="#14161A"] { fill: #ffffff; }
.footer-brand p { margin: 0 0 8px; max-width: 34ch; }
.footer-col h2 {
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #8d949e;
  margin: 0 0 12px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, .14);
  margin-top: 36px;
  padding-top: 22px;
  font-size: .84rem;
  color: #9aa1ab;
}
.footer-bottom img { width: 88px; height: 31px; display: block; }
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .site-footer { padding-top: 42px; }
}

/* ---------- Utilidades ---------- */

.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.stack-2 { margin-top: 18px; }
.stack-3 { margin-top: 28px; }
.stack-4 { margin-top: 40px; }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

@media print {
  .site-header, .site-footer, .banner-slot, .actions, .lang-switch, .nav-toggle { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .prose { max-width: none; padding: 0; }
  a { color: #000; }
}

/* ---------- Aplicación del simulador ---------- */

body.app { background: var(--bg); }
body.app .hero h1 { max-width: 22ch; }
body.app .section { padding: 52px 0; }

.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 820px) {
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
}

.exam-shell { max-width: 900px; margin: 0 auto; }
.toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: end;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 18px;
}
.toolbar .field { margin: 0; min-width: 180px; flex: 1; }
.toolbar label { font-size: .8rem; }
.toolbar select, .toolbar input { background: var(--bg); }

.quiz-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
}
.quiz-meta {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; color: var(--muted); font-size: .85rem; margin-bottom: 18px;
}
.timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.question-text { font-size: 1.2rem; font-weight: 700; line-height: 1.4; margin: 0 0 20px; }
.question-images { margin: 0 0 18px; display: grid; gap: 10px; }
.question-images img, .option img, .qbody img {
  max-width: 100%; height: auto; display: block;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.option img { margin-top: 6px; }
.qbody img { margin: 8px 0; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 16px; cursor: pointer; background: var(--bg);
  transition: border-color .15s ease, background .15s ease;
}
.option:hover { border-color: var(--accent); }
.option input { margin-top: 4px; accent-color: var(--accent); }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option.correct { border-color: var(--ok); background: var(--ok-soft); }
.option.wrong { border-color: #b3261e; background: #fdecea; }
.option.disabled { cursor: default; opacity: .85; }

.feedback {
  margin-top: 18px; border-left: 3px solid var(--accent);
  background: var(--bg); padding: 14px 18px; border-radius: 0 8px 8px 0;
}
.feedback.ok { border-left-color: var(--ok); }
.feedback strong { display: block; margin-bottom: 4px; }
.feedback p { margin: 0; color: var(--muted); }
.feedback .credit { display: block; margin-top: 10px; font-size: .8rem; }

.quiz-nav { display: flex; gap: 12px; align-items: center; margin-top: 24px; }
.quiz-nav .spacer { flex: 1; }

.result-card { text-align: center; padding: 42px 28px; }
.result-score { font-size: 3.4rem; font-weight: 800; letter-spacing: -.05em; line-height: 1; }
.result-score.pass { color: var(--ok); }
.result-score.fail { color: #b3261e; }
.result-card h2 { margin: 14px 0 6px; }
.result-card p { color: var(--muted); margin: 0 auto 20px; max-width: 52ch; }
.breakdown { display: grid; gap: 8px; max-width: 420px; margin: 22px auto; text-align: left; }
.breakdown div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 8px 0; }

.listing-controls { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 10px; margin-bottom: 16px; }
.listing-controls input, .listing-controls select {
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
  color: var(--ink); font: inherit; padding: 10px 12px; min-width: 0;
}
.listing-count { color: var(--muted); font-size: .85rem; margin-bottom: 10px; }
.qrow { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.qrow summary {
  cursor: pointer; padding: 14px 16px; font-weight: 600; list-style: none;
  display: flex; gap: 12px; align-items: baseline;
}
.qrow summary::-webkit-details-marker { display: none; }
.qrow summary::before { content: "+"; color: var(--accent); font-weight: 800; }
.qrow[open] summary::before { content: "−"; }
.qrow .qid { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qrow .qtext { flex: 1; }
.qrow .qbody { padding: 0 16px 16px 42px; }
.qrow .qbody ol { margin: 0 0 12px; padding-left: 22px; }
.qrow .qbody li { padding: 3px 0; }
.qrow .qbody li.right { color: var(--ok); font-weight: 700; }
.qrow .qbody .why { color: var(--muted); }
.qrow .origin { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }

.src-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.src-table th, .src-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.src-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
  .listing-controls { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .quiz-card { padding: 20px 16px; }
  .listing-controls { grid-template-columns: 1fr; }
  .qrow .qbody { padding-left: 16px; }
}

/* ---------- HAREC: progreso local, catálogo y test ---------- */

.study-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, .65fr);
  gap: 28px;
  align-items: center;
}
.study-actions { display: flex; flex-direction: column; gap: 10px; }
.study-actions .btn { width: 100%; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--bg);
}
.stat strong { display: block; font-size: 1.55rem; line-height: 1.1; letter-spacing: -.03em; }
.stat span { display: block; color: var(--muted); font-size: .76rem; line-height: 1.3; margin-top: 3px; }
.btn.danger { background: transparent; border-color: var(--line-strong); color: var(--accent-dark); }
.btn.danger:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }

.confirm-dialog {
  width: calc(100% - 32px);
  max-width: 440px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lift);
}
.confirm-dialog::backdrop { background: rgba(20, 22, 26, .45); }
.confirm-dialog h2 { margin: 0 0 10px; font-size: 1.3rem; letter-spacing: -.02em; }
.confirm-dialog p { color: var(--muted); margin: 0 0 20px; }

.qstat {
  font-size: .76rem;
  color: var(--muted);
  background: #eef0f2;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}
.qrow summary { flex-wrap: wrap; }
.qrow .qbody .qactions { margin: 10px 0 0; display: flex; gap: 8px; }
.reveal-answer, .hide-answer {
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--accent-dark);
  border-radius: 8px;
  padding: 5px 10px;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
}
.reveal-answer:hover, .hide-answer:hover { border-color: var(--accent); background: var(--accent-soft); }
.qrow .qbody .qanswer {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border-left: 3px solid var(--ok);
  border-radius: 0 8px 8px 0;
}
.qrow .qbody.revealed .qanswer { display: block; }
.qrow .qbody li.correct { color: var(--ok); font-weight: 700; }
.result-card .qrow { text-align: left; }
.option.chosen { border-color: var(--accent); background: var(--accent-soft); }

@media (max-width: 820px) {
  .study-panel { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr; }
}

#practicar, #test-panel, #quiz, #result, #catalog { scroll-margin-top: 88px; }

/* ---------- HAREC: mapa lateral del examen ---------- */

.exam-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 18px;
  align-items: start;
}
.exam-layout.no-nav { grid-template-columns: 1fr; }
.exam-nav {
  position: sticky;
  top: 88px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
}
.exam-nav h2 {
  margin: 0 0 10px;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.exam-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.exam-dot {
  aspect-ratio: 1;
  min-width: 0;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.exam-dot:hover { border-color: var(--ink); color: var(--ink); }
.exam-dot.answered { background: #2563eb; border-color: #2563eb; color: #fff; }
.exam-dot.passed { background: #f5c542; border-color: #d9a900; color: #3b2f00; }
.exam-dot.current { outline: 3px solid rgba(240, 40, 30, .45); outline-offset: 2px; }
.exam-legend { display: grid; gap: 6px; margin-top: 12px; font-size: .76rem; color: var(--muted); }
.exam-legend span { display: flex; align-items: center; gap: 7px; }
.exam-legend span::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  flex: 0 0 auto;
}
.exam-legend .answered::before { background: #2563eb; border-color: #2563eb; }
.exam-legend .passed::before { background: #f5c542; border-color: #d9a900; }
.exam-hint { margin: 10px 0 0; font-size: .76rem; line-height: 1.35; color: var(--muted); min-height: 1.2em; }

@media (max-width: 900px) {
  .exam-layout { grid-template-columns: 1fr; }
  .exam-nav { position: static; order: -1; }
  .exam-grid { grid-template-columns: repeat(10, 1fr); }
}
@media (max-width: 560px) {
  .exam-nav { padding: 12px; }
  .exam-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ---------- Listas de enlaces externos ---------- */

.sdr-list { list-style: none; margin: 12px 0 0; padding: 0; }
.sdr-list li { padding: 8px 0; border-top: 1px solid var(--line); }
.sdr-list li:first-child { border-top: 0; }
.sdr-list a { font-weight: 700; text-decoration: none; }
.sdr-list small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.35; }

/* ---------- Consentimiento de analítica ---------- */

body.consent-open { padding-bottom: 120px; }
.consent-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.consent-banner[hidden] { display: none; }
.consent-inner {
  pointer-events: auto;
  width: 100%;
  max-width: 760px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-lift);
  font-size: .86rem;
}
.consent-inner p { margin: 0; color: var(--muted); }
.consent-inner p strong { color: var(--ink); }
.consent-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.consent-actions .btn { white-space: nowrap; }
@media (max-width: 640px) {
  .consent-inner { flex-direction: column; align-items: flex-start; }
  .consent-actions { width: 100%; }
  .consent-actions .btn { flex: 1; }
}
