:root {
  --ink: #241f1c;
  --ink-soft: #5a524c;
  --paper: #f5f2ee;
  --surface: #ffffff;
  --line: #e4d6cb;
  --red: #bd2f41;
  --red-bright: #df4158;
  --sea: #3b4a48;
  --todo-bg: #fff3c4;
  --todo-ink: #6b4e00;
  --radius: 16px;
  --max: 1040px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f5f2ee;
    --ink-soft: #c9beb4;
    --paper: #141c20;
    --surface: #19242a;
    --line: #2b3a3f;
    --red: #ff7a8c;
    --red-bright: #df4158;
    --sea: #223336;
    --todo-bg: #4a3b00;
    --todo-ink: #ffe28a;
  }
}

* { box-sizing: border-box; }
[id] { scroll-margin-top: 80px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red); }
a:hover { text-decoration-thickness: 2px; }

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

/* Cabecera */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 20px; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.top nav { display: flex; gap: 20px; font-size: 15px; }
.top nav a { color: var(--ink-soft); text-decoration: none; }
.top nav a:hover { color: var(--ink); }
.top nav { margin-left: auto; }
.top .lang {
  flex: none; font-size: 14px; font-weight: 700; line-height: 1; padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-soft); text-decoration: none;
}
.top .lang:hover { color: var(--ink); border-color: var(--ink-soft); }

/* Portada */
.hero { padding: 72px 0 56px; text-align: center; }
.hero img { width: 112px; height: 112px; border-radius: 28px; box-shadow: 0 12px 32px rgb(0 0 0 / 0.18); }
.hero h1 { font-size: clamp(36px, 7vw, 60px); line-height: 1.08; margin: 28px 0 12px; letter-spacing: -0.02em; }
.hero .sub { font-size: clamp(18px, 2.6vw, 22px); color: var(--ink-soft); max-width: 640px; margin: 0 auto; }
.stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }
.badge {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  padding: 10px 20px; border-radius: 12px;
  background: var(--ink); color: var(--paper); text-decoration: none; line-height: 1.2;
}
.badge small { font-size: 12px; opacity: 0.75; }
.badge strong { font-size: 17px; }

/* Secciones */
section { padding: 56px 0; }
section h2 { font-size: clamp(26px, 4vw, 34px); margin: 0 0 8px; letter-spacing: -0.01em; }
section .lead { color: var(--ink-soft); margin: 0 0 32px; max-width: 680px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { margin: 0 0 6px; font-size: 19px; }
.card p { margin: 0; color: var(--ink-soft); font-size: 16px; }
.card .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red-bright); margin-bottom: 14px; }

.band { background: var(--sea); color: #f5f2ee; border-radius: 24px; padding: 40px; }
.band h2 { color: #fff; }
.band p { color: #e4d6cb; margin: 0; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.steps li { counter-increment: s; display: flex; gap: 14px; align-items: baseline; }
.steps li::before {
  content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--red-bright); color: #fff; font-weight: 700; font-size: 14px;
}

/* Páginas legales */
.doc { max-width: 760px; padding: 48px 20px 72px; }
.doc h1 { font-size: clamp(30px, 5vw, 40px); line-height: 1.15; margin: 0 0 8px; }
.doc .meta { color: var(--ink-soft); font-size: 15px; margin: 0 0 32px; }
.doc h2 { font-size: 22px; margin: 40px 0 8px; }
.doc h3 { font-size: 18px; margin: 24px 0 6px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 12px 0; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 700; }
.doc .toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 24px; }
.doc .toc ol { margin: 0; padding-left: 20px; }
.note { background: var(--surface); border-left: 4px solid var(--red-bright); border-radius: 8px; padding: 14px 18px; margin: 20px 0; }

/* Dato que falta completar antes de publicar */
.pendiente { background: var(--todo-bg); color: var(--todo-ink); padding: 0 4px; border-radius: 4px; font-weight: 600; }

/* Pie */
footer { border-top: 1px solid var(--line); padding: 32px 0 48px; font-size: 15px; color: var(--ink-soft); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
footer a { color: var(--ink-soft); }

@media (max-width: 640px) {
  .top nav { display: none; }
  .top .lang { margin-left: auto; }
  .band { padding: 28px 22px; }
  .doc table, .doc thead, .doc tbody, .doc tr, .doc th, .doc td { display: block; }
  .doc thead { display: none; }
  .doc td:first-child { font-weight: 700; padding-bottom: 0; border: 0; }
}
