/* =========================================================
   JILURU - Hoja de estilos principal
   Colores de marca: ver variables en :root
   ========================================================= */

/* ---------- Fuente Nunito (alojada en la propia web, sin servicios externos) ---------- */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/nunito-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/nunito-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/nunito-latin-800-normal.woff2") format("woff2");
}

/* ---------- Variables (modo claro) ---------- */
:root {
  --verde: #22684B;
  --tinta: #16232B;
  --ambar: #E0A43A;
  --menta: #5FC394;
  --menta-claro: #A9DFC5;
  --blanco-roto: #F4F5F2;

  --fondo: #F4F5F2;
  --superficie: #FFFFFF;
  --superficie-2: #E9F3EE;
  --texto: #16232B;
  --texto-suave: #43525A;
  --borde: #D5DED9;
  --enlace: #1D5C42;
  --acento: #22684B;
  --acento-texto: #FFFFFF;
  --sombra: 0 1px 2px rgba(22, 35, 43, .06), 0 8px 24px rgba(22, 35, 43, .06);
  --aviso-fondo: #FFF4DC;
  --aviso-borde: #E0A43A;

  --radio: 18px;
  --ancho: 1120px;
  color-scheme: light;
}

/* ---------- Modo oscuro (automático según el sistema, salvo que el usuario elija claro) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --fondo: #101A20;
    --superficie: #16232B;
    --superficie-2: #1C2E37;
    --texto: #F4F5F2;
    --texto-suave: #B9C6C0;
    --borde: #2A3C45;
    --enlace: #7FD3AB;
    --acento: #5FC394;
    --acento-texto: #10221A;
    --sombra: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --aviso-fondo: #33291A;
    --aviso-borde: #E0A43A;
    color-scheme: dark;
  }
}
/* Modo oscuro elegido manualmente con el botón */
:root[data-tema="oscuro"] {
  --fondo: #101A20;
  --superficie: #16232B;
  --superficie-2: #1C2E37;
  --texto: #F4F5F2;
  --texto-suave: #B9C6C0;
  --borde: #2A3C45;
  --enlace: #7FD3AB;
  --acento: #5FC394;
  --acento-texto: #10221A;
  --sombra: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --aviso-fondo: #33291A;
  --aviso-borde: #E0A43A;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--texto);
  background: var(--fondo);
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--enlace); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ambar); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); margin: 0 0 .5em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 2em 0 .6em; }
h3 { font-size: 1.25rem; margin: 1.6em 0 .5em; }
p, ul, ol { margin: 0 0 1em; }
.contenedor { width: min(100% - 2.5rem, var(--ancho)); margin-inline: auto; }
.texto-largo { max-width: 46rem; }
.solo-lectores {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.saltar {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--acento); color: var(--acento-texto); padding: .6rem 1rem; border-radius: 10px; font-weight: 700;
}
.saltar:focus { top: 1rem; }

/* ---------- Cabecera ---------- */
.cabecera {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--fondo) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--borde);
}
.cabecera .contenedor { display: flex; align-items: center; gap: 1rem; min-height: 68px; flex-wrap: wrap; }
.marca { display: inline-flex; align-items: center; margin-right: auto; padding: .4rem 0; }
.marca img { height: 38px; width: auto; }
.logo-oscuro { display: none !important; }
:root[data-tema="oscuro"] .logo-claro { display: none !important; }
:root[data-tema="oscuro"] .logo-oscuro { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) .logo-claro { display: none !important; }
  :root:not([data-tema="claro"]) .logo-oscuro { display: block !important; }
}
.menu ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; }
.menu a {
  display: block; padding: .45rem .8rem; border-radius: 999px;
  color: var(--texto); text-decoration: none; font-weight: 700;
}
.menu a:hover { background: var(--superficie-2); }
.menu a[aria-current="page"] { background: var(--acento); color: var(--acento-texto); }
.boton-tema {
  border: 1px solid var(--borde); background: var(--superficie); color: var(--texto);
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
}
.boton-tema svg { width: 20px; height: 20px; }
.boton-tema .icono-sol { display: none; }
:root[data-tema="oscuro"] .boton-tema .icono-sol { display: block; }
:root[data-tema="oscuro"] .boton-tema .icono-luna { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) .boton-tema .icono-sol { display: block; }
  :root:not([data-tema="claro"]) .boton-tema .icono-luna { display: none; }
}
@media (max-width: 720px) {
  .menu { order: 3; width: 100%; overflow-x: auto; padding-bottom: .5rem; }
  .menu ul { gap: .15rem; }
  .menu a { padding: .4rem .7rem; white-space: nowrap; }
}

/* ---------- Portada (hero) ---------- */
.portada { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem); position: relative; overflow: hidden; }
.portada .contenedor { display: grid; grid-template-columns: 1.25fr .75fr; gap: 2rem; align-items: center; }
.portada .entradilla { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--texto-suave); max-width: 36rem; }
.etiqueta-sup { display: inline-block; font-weight: 800; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--enlace); margin-bottom: .8rem; }
.puntos { position: relative; aspect-ratio: 1; max-width: 340px; justify-self: end; width: 100%; }
.puntos span { position: absolute; border-radius: 50%; }
.puntos .p1 { width: 36%; height: 36%; left: 2%;  top: 58%; background: var(--tinta); }
.puntos .p2 { width: 36%; height: 36%; left: 22%; top: 12%; background: var(--verde); }
.puntos .p3 { width: 25%; height: 25%; left: 60%; top: 2%;  background: var(--ambar); }
.puntos .p4 { width: 25%; height: 25%; left: 72%; top: 40%; background: var(--menta); }
:root[data-tema="oscuro"] .puntos .p1 { background: var(--blanco-roto); }
@media (prefers-color-scheme: dark) { :root:not([data-tema="claro"]) .puntos .p1 { background: var(--blanco-roto); } }
@media (max-width: 760px) {
  .portada .contenedor { grid-template-columns: 1fr; }
  .puntos { max-width: 180px; justify-self: start; order: -1; }
}

/* ---------- Botones ---------- */
.botones { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.boton {
  display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1.3rem; border-radius: 999px;
  font-weight: 800; text-decoration: none; border: 2px solid var(--acento);
  background: var(--acento); color: var(--acento-texto);
}
.boton:hover { filter: brightness(1.08); }
.boton.secundario { background: transparent; color: var(--texto); border-color: var(--borde); }
.boton.secundario:hover { border-color: var(--acento); }
.boton-tienda {
  display: inline-flex; flex-direction: column; line-height: 1.2; padding: .6rem 1.1rem; border-radius: 12px;
  border: 1px dashed var(--borde); color: var(--texto-suave); background: var(--superficie);
  cursor: not-allowed; user-select: none;
}
.boton-tienda small { font-size: .75rem; }
.boton-tienda strong { font-size: 1rem; color: var(--texto); }

/* ---------- Secciones y tarjetas ---------- */
.seccion { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.seccion.alterna { background: var(--superficie-2); }
.seccion > .contenedor > h2:first-child { margin-top: 0; }
.subtitulo { color: var(--texto-suave); max-width: 40rem; margin-top: -.3rem; }
.rejilla { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-top: 1.75rem; }
.tarjeta {
  background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 1.5rem; box-shadow: var(--sombra); display: flex; flex-direction: column; gap: .4rem;
}
.tarjeta h3 { margin: .2rem 0 .2rem; }
.tarjeta p { color: var(--texto-suave); margin: 0; }
.tarjeta .pie-tarjeta { margin-top: auto; padding-top: 1rem; }
.icono-app {
  width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
  background: var(--superficie-2); color: var(--verde); margin-bottom: .4rem;
}
:root[data-tema="oscuro"] .icono-app { color: var(--menta); }
@media (prefers-color-scheme: dark) { :root:not([data-tema="claro"]) .icono-app { color: var(--menta); } }
.icono-app svg { width: 30px; height: 30px; }
.chapa {
  display: inline-block; align-self: flex-start; font-size: .78rem; font-weight: 800; letter-spacing: .04em;
  padding: .2rem .65rem; border-radius: 999px; background: var(--ambar); color: var(--tinta);
}
.chapa.plantilla { background: transparent; border: 2px dashed var(--ambar); color: var(--texto); }
.chapa.gris { background: var(--superficie-2); color: var(--texto); }

/* ---------- Ficha de app ---------- */
.ficha-app {
  display: grid; grid-template-columns: 1fr 280px; gap: 2rem; align-items: start;
  background: var(--superficie); border: 1px solid var(--borde); border-radius: calc(var(--radio) + 6px);
  padding: clamp(1.5rem, 4vw, 2.5rem); box-shadow: var(--sombra); margin-bottom: 2rem; scroll-margin-top: 90px;
}
.ficha-app h2 { margin-top: .4rem; }
.ficha-app ul { padding-left: 1.2rem; color: var(--texto-suave); }
.capturas { display: flex; gap: .75rem; }
.movil {
  flex: 1; aspect-ratio: 9 / 19; border-radius: 22px; border: 2px dashed var(--borde);
  display: grid; place-items: center; text-align: center; padding: .75rem; font-size: .85rem; color: var(--texto-suave);
  background: var(--superficie-2);
}
.movil img { border-radius: 20px; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 800px) { .ficha-app { grid-template-columns: 1fr; } .capturas { max-width: 320px; } }

/* ---------- Llamada a la acción ---------- */
.llamada {
  background: var(--verde); color: #FFFFFF; border-radius: calc(var(--radio) + 8px);
  padding: clamp(2rem, 5vw, 3rem); display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between;
}
.llamada h2 { margin: 0 0 .3rem; color: #FFFFFF; }
.llamada p { margin: 0; color: #E3F2EA; }
.llamada .boton { background: var(--ambar); border-color: var(--ambar); color: var(--tinta); }

/* ---------- Preguntas frecuentes ---------- */
.faq details {
  background: var(--superficie); border: 1px solid var(--borde); border-radius: 14px;
  padding: 0 1.2rem; margin-bottom: .75rem;
}
.faq summary { cursor: pointer; font-weight: 800; padding: 1rem 0; list-style-position: outside; }
.faq details[open] summary { border-bottom: 1px solid var(--borde); margin-bottom: .8rem; }
.faq details > *:last-child { margin-bottom: 1rem; }

/* ---------- Textos legales ---------- */
.legal { padding: clamp(2rem, 5vw, 3.5rem) 0 4rem; }
.legal h2 { font-size: 1.4rem; margin-top: 2.2em; }
.legal h3 { font-size: 1.1rem; }
.legal table { border-collapse: collapse; width: 100%; margin: 0 0 1.2rem; font-size: .95rem; }
.legal th, .legal td { border: 1px solid var(--borde); padding: .6rem .7rem; text-align: left; vertical-align: top; }
.legal th { background: var(--superficie-2); }
.tabla-scroll { overflow-x: auto; }
.fecha { color: var(--texto-suave); font-size: .95rem; }
.indice { background: var(--superficie); border: 1px solid var(--borde); border-radius: 14px; padding: 1rem 1.4rem; margin: 1.5rem 0; }
.indice ol { margin: 0; padding-left: 1.2rem; }

/* Marcadores de contenido pendiente: SE VEN A PROPÓSITO para que no se publiquen sin revisar */
.pendiente {
  background: var(--aviso-fondo); border: 2px dashed var(--aviso-borde); border-radius: 6px;
  padding: 0 .3rem; font-weight: 700;
}
.nota-revision {
  background: var(--aviso-fondo); border-left: 5px solid var(--aviso-borde); border-radius: 10px;
  padding: .9rem 1.1rem; margin: 1rem 0 1.4rem; font-size: .95rem;
}

/* ---------- Pie ---------- */
.pie { border-top: 1px solid var(--borde); padding: 2.5rem 0 2rem; margin-top: 2rem; font-size: .95rem; color: var(--texto-suave); }
.pie .contenedor { display: grid; gap: 1.5rem; grid-template-columns: 1.4fr 1fr 1fr; }
.pie img { height: 30px; width: auto; margin-bottom: .6rem; }
.pie h2 { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 .6rem; color: var(--texto); }
.pie ul { list-style: none; padding: 0; margin: 0; }
.pie li { margin-bottom: .35rem; }
.pie a { color: var(--texto-suave); }
.pie a:hover { color: var(--texto); }
.pie .legal-final { grid-column: 1 / -1; border-top: 1px solid var(--borde); padding-top: 1.2rem; font-size: .85rem; }
@media (max-width: 720px) { .pie .contenedor { grid-template-columns: 1fr; } }

/* ---------- Página 404 ---------- */
.error-404 { text-align: center; padding: 5rem 0; }
.error-404 .numero { font-size: clamp(4rem, 14vw, 8rem); font-weight: 800; color: var(--acento); line-height: 1; margin: 0; }
.error-404 .botones { justify-content: center; }
