/* ============================================================
   Verifactu Readiness Check · hoja de estilo única
   Sin dependencias, sin fuentes externas, sin imágenes externas.
   ============================================================ */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #14202e;
  --ink-soft: #47576b;
  --line: #d3dbe4;
  --brand: #0b3d68;
  --brand-ink: #ffffff;
  --brand-soft: #e7eff7;
  --accent: #a4531a;
  --ok: #14663f;
  --warn-bg: #fdf3e3;
  --warn-line: #d8a24a;
  --danger-bg: #fdecec;
  --danger-line: #c0574f;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 32, 46, .08), 0 6px 18px rgba(20, 32, 46, .06);
  --wrap: 62rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10161d;
    --surface: #182029;
    --ink: #eef3f8;
    --ink-soft: #b3c0cf;
    --line: #2c3948;
    --brand: #7fb6e8;
    --brand-ink: #0b1720;
    --brand-soft: #1d2b3a;
    --accent: #e3a86b;
    --ok: #6ed3a0;
    --warn-bg: #33291a;
    --warn-line: #b9863c;
    --danger-bg: #33201f;
    --danger-line: #c9736c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
  word-break: break-word;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .6rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; margin-top: 1.4rem; }
p { margin: 0 0 .8rem; }
ul, ol { margin: 0 0 .8rem; padding-left: 1.25rem; }
li { margin-bottom: .4rem; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1rem;
}

.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;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: var(--brand-ink);
  padding: .6rem 1rem;
  z-index: 50;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------ cabecera */

.site-header {
  background: var(--brand);
  color: var(--brand-ink);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding-top: .6rem;
  padding-bottom: .6rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  font-weight: 700;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, .18);
  font-weight: 800;
}
.header-actions { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.lang-switch { display: flex; gap: .25rem; }

/* -------------------------------------------------------- botones */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: .6rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--brand);
  color: var(--brand-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-ghost {
  background: transparent;
  color: inherit;
  border-color: currentColor;
}
.site-header .btn-ghost { color: var(--brand-ink); border-color: rgba(255, 255, 255, .55); }
.btn-sm { min-height: 44px; padding: .35rem .7rem; font-size: .9rem; }
.btn.is-active { background: rgba(255, 255, 255, .28); }
main .btn-ghost { color: var(--brand); border-color: var(--line); }
main .btn-ghost:hover { background: var(--brand-soft); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------- tarjetas */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem;
  margin: 1rem 0;
}
.hero { margin-top: 1.2rem; }
.lead { font-size: 1.05rem; color: var(--ink-soft); }
.cta-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.cta-note { color: var(--ink-soft); font-size: .9rem; }

.disclaimer {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-left-width: 5px;
  border-radius: var(--radius);
  padding: .8rem 1rem;
  margin: 1rem 0;
}
.disclaimer p:last-child { margin-bottom: 0; }
.warn-note {
  background: var(--warn-bg);
  border-left: 4px solid var(--warn-line);
  padding: .6rem .8rem;
  border-radius: 6px;
}
.error-card { border-color: var(--danger-line); background: var(--danger-bg); }

/* ----------------------------------------------------- cuestionario */

.progress {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .5rem;
  align-items: center;
  margin: .4rem 0 1rem;
  font-size: .9rem;
  color: var(--ink-soft);
}
.progress-track {
  height: 10px;
  background: var(--brand-soft);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: var(--brand);
  transition: width .2s ease;
}

.step { border: 0; padding: 0; margin: 0 0 1rem; }
.step legend {
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0 0 .6rem;
}

.q { margin-bottom: 1.1rem; }
.q-label { font-weight: 600; margin-bottom: .45rem; }
.options { display: grid; gap: .4rem; }
.option {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  min-height: 44px;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--surface);
}
.option:hover { background: var(--brand-soft); }
.option input {
  width: 20px;
  height: 20px;
  margin: .2rem 0 0;
  flex: 0 0 auto;
  accent-color: var(--brand);
}
.option-text { flex: 1 1 auto; }
.q-error {
  color: var(--danger-line);
  font-size: .9rem;
  margin: .3rem 0 0;
  font-weight: 600;
}

.quiz-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  padding-top: .5rem;
  border-top: 1px solid var(--line);
}
.save-note { color: var(--ink-soft); font-size: .9rem; margin: .6rem 0 0; min-height: 1.4em; }

/* -------------------------------------------------------- resultado */

.state-card {
  border: 1px solid var(--line);
  border-left: 6px solid var(--brand);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  background: var(--brand-soft);
}
.state-label {
  margin: 0;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-soft);
}
.state-value { margin: .1rem 0 .5rem; font-size: 1.35rem; font-weight: 800; }
.state-detail p:last-child { margin-bottom: 0; }
.state-note {
  border-left: 3px solid var(--accent);
  padding-left: .7rem;
  color: var(--ink-soft);
}

.countdown {
  margin: 1rem 0;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.countdown-label { margin: 0; font-weight: 600; }
.countdown-value { margin: .1rem 0 .4rem; font-size: 2.4rem; font-weight: 800; line-height: 1; }
.countdown-value span:last-child { font-size: 1rem; font-weight: 600; }
.countdown-note, .countdown-extra { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.countdown-extra { margin-top: .3rem; }

.gap-list li { font-weight: 500; }
.checklist { list-style: none; padding-left: 0; }
.checklist li {
  position: relative;
  padding-left: 1.9rem;
  margin-bottom: .5rem;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .28rem;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--brand);
  border-radius: 3px;
}
.ask-list li { margin-bottom: .5rem; }
.empty { color: var(--ink-soft); font-style: italic; }
.result-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.2rem; }
.review-note { color: var(--ink-soft); font-size: .9rem; margin-top: .8rem; }

/* ------------------------------------------------------------ hash */

.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 56rem) {
  .grid-2 { grid-template-columns: 1.15fr 1fr; }
}

.hash-record {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .6rem .8rem .2rem;
  margin-bottom: .8rem;
}
.hash-record legend { font-weight: 700; padding: 0 .3rem; }
.field { margin-bottom: .55rem; }
.field label { display: block; font-size: .85rem; color: var(--ink-soft); margin-bottom: .15rem; }
.field input {
  width: 100%;
  min-height: 44px;
  padding: .45rem .6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .95rem;
}

.hash-output { list-style: none; padding-left: 0; }
.hash-step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .55rem .7rem;
  margin-bottom: .6rem;
}
.hash-step-title { margin: 0 0 .2rem; font-weight: 700; font-size: .92rem; }
.hash-value {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  letter-spacing: .01em;
  word-break: break-all;
  color: var(--ok);
  font-weight: 600;
}
.hash-meta {
  margin: .3rem 0 0;
  font-size: .78rem;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}
.hash-tamper { font-weight: 600; margin-top: .6rem; }
.vector-result { font-weight: 600; }
.vector-list { margin-top: .5rem; font-weight: 400; font-size: .85rem; }

.code-block {
  background: var(--brand-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .7rem;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
  max-width: 100%;
}
.code-block-lg { font-size: .82rem; }
.tech { margin-top: .8rem; }
.tech summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }

/* -------------------------------------------------------------- QR */

.qr-form { display: grid; gap: .2rem; }
.qr-mode { font-weight: 600; margin: .6rem 0 .4rem; }
.qr-hint { color: var(--ink-soft); font-size: .9rem; margin-top: .6rem; }

/* ------------------------------------------------------ tablas/listas */

.table-scroll { overflow-x: auto; max-width: 100%; }
.facts { width: 100%; border-collapse: collapse; font-size: .95rem; }
.facts caption {
  text-align: left;
  color: var(--ink-soft);
  font-size: .88rem;
  padding-bottom: .5rem;
}
.facts th, .facts td {
  border: 1px solid var(--line);
  padding: .5rem .6rem;
  text-align: left;
  vertical-align: top;
}
.facts thead th { background: var(--brand-soft); }
.plain-list { padding-left: 1.2rem; }

.source-list { list-style: none; padding-left: 0; }
.source-item { margin-bottom: .8rem; }
.source-meta { display: block; font-size: .85rem; color: var(--ink-soft); }
.review-line { font-weight: 600; }

/* ----------------------------------------------------------- pie */

.site-footer {
  margin-top: 2rem;
  padding: 1.2rem 0 2rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.footer-disclaimer { font-size: .9rem; color: var(--ink-soft); }
.footer-meta { font-size: .85rem; color: var(--ink-soft); margin-bottom: 0; }

/* ------------------------------------------------------- impresión */

@media print {
  :root {
    --bg: #fff;
    --surface: #fff;
    --ink: #000;
    --ink-soft: #333;
    --line: #999;
    --brand: #000;
    --brand-soft: #f2f2f2;
    --shadow: none;
  }
  @page { size: A4; margin: 15mm; }

  body { background: #fff; color: #000; font-size: 11pt; }
  .no-print, .site-header, #quiz-section, .result-actions, .tech summary { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .card {
    border: 1px solid #999;
    box-shadow: none;
    page-break-inside: avoid;
    break-inside: avoid;
    margin: 0 0 6mm;
    padding: 4mm;
  }
  #result-section, #deadlines-section { page-break-inside: auto; break-inside: auto; }
  .countdown-value { font-size: 20pt; }
  .hash-value, .hash-meta, .code-block { font-size: 8pt; }
  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; word-break: break-all; }
  .facts { font-size: 9pt; }
  .step, .options { display: none !important; }
  .disclaimer { border: 1px solid #000; background: #f4f4f4; }
  .warn-note { background: #f4f4f4; border-left: 3px solid #000; }
}
