:root {
  --navy: #123a5e;
  --navy-hi: #1c5182;
  --navy-lo: #0d2942;
  --buy: #e0393e;
  --buy-hi: #c22b30;
  --free: #0f8a4f;
  --free-hi: #0c7543;
  --ink: #1b2431;
  --muted: #5a6b7d;
  --line: #dfe5ec;
  --bg: #f4f6f9;
  --card: #ffffff;
  --bg-alt: #f7f9fb;
  --bg-alt2: #f2f5f9;
  --bg-alt3: #eef3f8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 34, 55, .08), 0 6px 18px rgba(16, 34, 55, .07);
}

html.tema-oscuro {
  --navy: #3a7ab8;
  --navy-hi: #4a8ac8;
  --navy-lo: #10222f;
  --buy: #f05a5e;
  --buy-hi: #d94a4e;
  --free: #2aaa7a;
  --free-hi: #35bd8a;
  --ink: #e8eef4;
  --muted: #9ab0c4;
  --line: #3a4a5e;
  --bg: #1a1f26;
  --card: #242a33;
  --bg-alt: #2a3038;
  --bg-alt2: #2d333c;
  --bg-alt3: #303640;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

a { color: var(--navy-hi); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg, video { max-width: 100%; height: auto; display: block; }

.envoltura { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* ---------- Cabecera ---------- */
.cabera { background: var(--navy-lo); color: #fff; position: sticky; top: 0; z-index: 40; }
.cabera__alta { display: flex; align-items: center; gap: 18px; padding: 12px 0; }
.marca { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 19px; letter-spacing: .2px; }
.marca:hover { text-decoration: none; }
.marca__marca-svg { width: 34px; height: 34px; flex: none; }
.marca small { display: block; font-size: 11px; font-weight: 500; color: #a9c4dd; letter-spacing: .4px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; align-items: center; }
.nav a, .nav button {
  color: #dbe8f4; background: none; border: 0; font: inherit; font-size: 15px;
  padding: 9px 13px; border-radius: 7px; cursor: pointer;
}
.nav a:hover, .nav button:hover { background: var(--navy-hi); color: #fff; text-decoration: none; }
.nav__tema {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0;
  background: transparent; border: 1px solid rgba(255, 255, 255, .2); border-radius: 7px;
  color: #dbe8f4; cursor: pointer;
}
.nav__tema:hover { background: var(--navy-hi); border-color: var(--navy-hi); color: #fff; }
.nav__tema-icono { width: 20px; height: 20px; }

.baner { background: var(--navy); color: #cfe1f2; font-size: 14px; }
.baner__lista { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 9px 0; }
.baner a { color: #fff; }
.baner span { color: #94b6d3; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(120deg, var(--navy-lo), var(--navy) 60%, var(--navy-hi)); color: #fff; }
.hero__rejilla { display: grid; grid-template-columns: 1.05fr .95fr; gap: 34px; align-items: center; padding: 46px 0 52px; }
.hero h1 { font-size: 36px; line-height: 1.18; margin: 0 0 12px; }
.hero p { color: #d6e6f4; font-size: 17px; margin: 0 0 20px; max-width: 60ch; }
.hero__botones { display: flex; flex-wrap: wrap; gap: 10px; }
.hero__nota { margin-top: 16px; font-size: 13px; color: #a9c4dd; }

/* Teléfono ilustrativo */
.telefono {
  width: 100%; max-width: 330px; margin: 0 auto;
  background: #14202b; border-radius: 26px; padding: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
  border: 1px solid rgba(255, 255, 255, .14);
}
.telefono__pantalla { background: #fffaf3; border-radius: 18px; overflow: hidden; color: #241f1b; }
.telefono__barra { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px 8px; font-size: 11px; color: #75665a; }
.telefono__cuerpo { padding: 0 14px 16px; }
.telefono__saludo { font-size: 17px; font-weight: 800; margin: 2px 0 12px; }
.telefono__kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid #eadfd2; border-radius: 10px; padding: 8px; text-align: center; }
.kpi strong { display: block; font-size: 16px; color: #0e6b5a; }
.kpi span { font-size: 9.5px; color: #75665a; }
.telefono__titulo { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: #75665a; margin: 14px 0 8px; }
.cita { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid #eadfd2; border-radius: 10px; padding: 9px 10px; margin-bottom: 7px; }
.cita__hora { min-width: 46px; text-align: center; background: #e7f2ee; color: #0e6b5a; border-radius: 8px; padding: 5px 4px; font-size: 12px; font-weight: 800; line-height: 1.1; }
.cita__hora small { display: block; font-size: 8.5px; font-weight: 600; }
.cita__texto { min-width: 0; }
.cita__texto b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cita__texto span { font-size: 10.5px; color: #75665a; }
.telefono__pie { margin-top: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.telefono__accion { background: #0e6b5a; color: #fff; border-radius: 9px; padding: 9px 4px; text-align: center; font-size: 9.5px; font-weight: 700; }
.telefono__caption { text-align: center; margin: 10px auto 0; font-size: 11.5px; color: #a9c4dd; max-width: 330px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 7px; padding: 10px 18px;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-align: center;
}
.btn:hover { text-decoration: none; }
.btn--descarga { background: var(--free); color: #fff; }
.btn--descarga:hover { background: var(--free-hi); }
.btn--mar { background: var(--navy); color: #fff; }
.btn--mar:hover { background: var(--navy-hi); }
.btn--fant { background: var(--card); color: var(--navy); border-color: var(--line); }
.btn--fant:hover { border-color: var(--navy-hi); color: var(--navy-hi); }
.btn--fant--claro { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.btn--fant--claro:hover { background: rgba(255, 255, 255, .12); color: #fff; border-color: #fff; }
.btn--grande { padding: 13px 26px; font-size: 16px; }
.btn--chica { padding: 7px 12px; font-size: 14px; }
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; pointer-events: none; }

/* ---------- Secciones ---------- */
.seccion { padding: 42px 0; }
.seccion--blanca { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.seccion--alt { background: var(--bg-alt); }
.seccion__titulo { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 0 0 8px; font-size: 26px; }
.seccion__texto { color: var(--muted); margin: 0 0 24px; max-width: 78ch; }
.seccion__subtitulo { font-size: 18px; margin: 30px 0 16px; color: var(--navy); font-weight: 700; }

.rejilla { display: grid; gap: 16px; }
.rejilla--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rejilla--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rejilla--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.tarjeta {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.tarjeta h3 { margin: 0 0 6px; font-size: 17px; }
.tarjeta p { margin: 0; color: var(--muted); font-size: 14.5px; }
.tarjeta ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 14.5px; }
.tarjeta li { margin: 4px 0; }
.tarjeta__icono {
  width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
  background: var(--bg-alt3); color: var(--navy); margin-bottom: 12px;
}
.tarjeta__icono svg { width: 22px; height: 22px; }

.oficio { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 12px; }
.oficio strong { display: block; font-size: 14.5px; }
.oficio span { font-size: 12.5px; color: var(--muted); }
.oficio__icono { width: 40px; height: 40px; margin: 0 auto 8px; color: var(--navy); }
.oficio__icono svg { width: 100%; height: 100%; }

.pasos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; counter-reset: paso; }
.paso { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: relative; }
.paso::before {
  counter-increment: paso; content: "Paso " counter(paso);
  display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: .5px;
  color: var(--free); background: rgba(15, 138, 79, .1); border-radius: 999px;
  padding: 3px 10px; margin-bottom: 10px;
}
.paso h3 { margin: 0 0 6px; font-size: 16px; }
.paso p { margin: 0; color: var(--muted); font-size: 14px; }

.franja {
  background: var(--bg-alt2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start;
}
.franja__icono { flex: none; width: 34px; height: 34px; color: var(--free); }
.franja strong { display: block; margin-bottom: 2px; }
.franja p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ---------- Preguntas ---------- */
.preguntas { display: grid; gap: 10px; }
.preguntas details {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px;
}
.preguntas summary { cursor: pointer; font-weight: 600; font-size: 15.5px; }
.preguntas details[open] summary { color: var(--navy); }
.preguntas details p { margin: 10px 0 0; color: var(--muted); font-size: 14.5px; }

/* ---------- Descarga ---------- */
.descarga { display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px; align-items: center; }
.descarga__caja { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.descarga__caja h3 { margin-top: 0; }
.descarga__meta { display: grid; gap: 6px; font-size: 14px; color: var(--muted); margin: 12px 0 18px; }
.descarga__meta b { color: var(--ink); }
.codigo { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; background: var(--bg-alt3); border-radius: 6px; padding: 2px 6px; word-break: break-all; }
.descarga__meta [data-apk-sha] { font-size: 11px; display: inline-block; max-width: 100%; }

/* ---------- Pie ---------- */
.pie { background: var(--navy-lo); color: #c7d8e8; padding: 34px 0 22px; margin-top: 10px; }
.pie__rejilla { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 24px; }
.pie h4 { color: #fff; margin: 0 0 10px; font-size: 14px; letter-spacing: .4px; text-transform: uppercase; }
.pie a { color: #c7d8e8; font-size: 14px; display: block; padding: 3px 0; }
.pie a:hover { color: #fff; }
.pie p { font-size: 13.5px; margin: 0 0 8px; color: #94b6d3; }
.pie__legal { border-top: 1px solid rgba(255, 255, 255, .14); margin-top: 24px; padding-top: 16px; font-size: 12.5px; color: #8aa7c1; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* ---------- Legal ---------- */
.documento { max-width: 860px; }
.documento h1 { font-size: 30px; margin: 0 0 6px; }
.documento .meta { color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.documento h2 { font-size: 19px; margin: 30px 0 8px; color: var(--navy); }
.documento h3 { font-size: 16px; margin: 20px 0 6px; }
.documento p, .documento li { font-size: 15px; color: var(--ink); }
.documento ul { padding-left: 20px; }
.documento li { margin: 5px 0; }
.documento table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14.5px; }
.documento th, .documento td { border: 1px solid var(--line); padding: 9px 11px; text-align: left; vertical-align: top; }
.documento th { background: var(--bg-alt2); }
.documento .nota { background: var(--bg-alt2); border-left: 4px solid var(--navy); border-radius: 6px; padding: 12px 16px; color: var(--muted); }

.error404 { text-align: center; padding: 80px 20px; }
.error404 strong { display: block; font-size: 72px; line-height: 1; color: var(--navy); }
.error404 h1 { font-size: 26px; margin: 12px 0 8px; }
.error404 p { color: var(--muted); margin: 0 0 22px; }

/* ---------- Utilidades ---------- */
.centrado { text-align: center; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  color: var(--free); background: rgba(15, 138, 79, .1); border-radius: 999px; padding: 4px 11px;
}
html.tema-oscuro .chip { background: rgba(42, 170, 122, .16); color: #58d3a6; }

.saltar {
  position: absolute; left: -9999px; top: 0; background: var(--card); color: var(--ink);
  padding: 10px 16px; border-radius: 6px; z-index: 100;
}
.saltar:focus { left: 12px; top: 12px; }

/* ---------- Responsivo ---------- */
@media (max-width: 940px) {
  .hero__rejilla { grid-template-columns: 1fr; padding: 36px 0 42px; }
  .hero h1 { font-size: 30px; }
  .rejilla--3, .rejilla--4, .pasos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .descarga { grid-template-columns: 1fr; }
  .pie__rejilla { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .nav { gap: 0; }
  .nav a { font-size: 14px; padding: 8px 9px; }
  .nav__oculto { display: none; }
  .hero h1 { font-size: 26px; }
  .rejilla--2, .rejilla--3, .rejilla--4, .pasos { grid-template-columns: 1fr; }
  .seccion { padding: 32px 0; }
  .seccion__titulo { font-size: 22px; }
  .pie__rejilla { grid-template-columns: 1fr; }
  .telefono { max-width: 300px; }
}

@media print {
  .cabera, .baner, .pie, .hero__botones, .nav__tema { display: none; }
  body { background: #fff; }
}
