/* ConsultaPe — sitio público. Marca: docs/GUIA-DE-MARCA.md */
@font-face {
  font-family: "Sora";
  src: url("/assets/fonts/Sora.woff2") format("woff2-variations"), url("/assets/fonts/Sora.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --cp-rojo-700: #B81F2F;
  --cp-rojo-600: #D62839;
  --cp-rojo-500: #F0444F;
  --cp-tinta-900: #12161F;
  --cp-noche-950: #0E1117;
  --cp-noche-900: #161B24;
  --cp-gris-600: #5B6270;
  --cp-gris-400: #A3AAB8;
  --cp-humo-100: #F3F4F6;
  --cp-blanco: #FFFFFF;
  --cp-verde: #12805C;
  --cp-verde-claro: #5FD39A;

  --bg: var(--cp-blanco);
  --bg-suave: #F6F7F9;
  --superficie: var(--cp-blanco);
  --borde: #E3E5EA;
  --borde-fuerte: #CDD1D9;
  --texto: var(--cp-tinta-900);
  --texto-2: var(--cp-gris-600);
  --acento: var(--cp-rojo-600);
  --acento-suave: rgba(214, 40, 57, .08);
  --exito: var(--cp-verde);
  --exito-suave: rgba(18, 128, 92, .1);

  /* La consola es oscura en ambos temas */
  --consola: var(--cp-noche-950);
  --consola-2: #171C26;
  --consola-borde: #262C38;
  --consola-texto: #D9DCE3;

  --fuente: "Sora", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --sombra: 0 24px 60px -24px rgba(18, 22, 31, .35), 0 2px 6px rgba(18, 22, 31, .06);
  --ancho: 74rem;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--cp-noche-950);
    --bg-suave: #12161F;
    --superficie: var(--cp-noche-900);
    --borde: #252B37;
    --borde-fuerte: #353C4A;
    --texto: var(--cp-humo-100);
    --texto-2: var(--cp-gris-400);
    --acento: var(--cp-rojo-500);
    --acento-suave: rgba(240, 68, 79, .12);
    --exito: var(--cp-verde-claro);
    --exito-suave: rgba(95, 211, 154, .12);
    --consola: #090C11;
    --consola-2: #121620;
    --sombra: 0 24px 60px -24px rgba(0, 0, 0, .8), 0 0 0 1px #1E2430;
  }
}

/* ───────── Base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--fuente);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--texto);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.1; font-weight: 700; letter-spacing: -0.03em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code, pre { font-family: var(--mono); }
::selection { background: var(--cp-rojo-600); color: #fff; }
:focus-visible { outline: 3px solid var(--acento); outline-offset: 3px; border-radius: 6px; }
html { scrollbar-color: var(--borde-fuerte) transparent; }

.contenedor { width: 100%; max-width: var(--ancho); margin: 0 auto; padding: 0 1.5rem; }
.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;
}
.saltar {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  padding: .5rem 1rem; border-radius: .5rem;
  background: var(--cp-rojo-600); color: #fff; text-decoration: none;
}
.saltar:focus { top: 1rem; }

/* ───────── Botones ───────── */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3rem; padding: .75rem 1.375rem;
  border-radius: .75rem; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .9375rem; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .2s var(--ease), box-shadow .2s ease;
}
.boton svg { width: 1.125rem; height: 1.125rem; flex: none; transition: transform .25s var(--ease); }
.boton:hover svg.flecha { transform: translateX(3px); }
.boton:active { transform: translateY(1px); }
/* Texto blanco siempre sobre rojo-600 (5.0:1, también en oscuro) */
.boton-primario { background: var(--cp-rojo-600); color: #fff; box-shadow: 0 8px 20px -10px rgba(214, 40, 57, .7); }
.boton-primario:hover { background: var(--cp-rojo-700); }
.boton-secundario { background: var(--superficie); color: var(--texto); border-color: var(--borde-fuerte); }
.boton-secundario:hover { border-color: var(--texto-2); }
.boton-sm { min-height: 2.5rem; padding: .5rem 1rem; font-size: .875rem; border-radius: .625rem; }

/* ───────── Cabecera ───────── */
.cabecera {
  position: sticky; top: 0; z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color .2s ease, border-color .2s ease, backdrop-filter .2s ease;
}
.cabecera--fija {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom-color: var(--borde);
}
.cabecera__fila { display: flex; align-items: center; gap: 1.5rem; height: 4.25rem; }
.marca { display: inline-flex; border-radius: .5rem; }
.marca img { height: 2rem; width: auto; }

.nav { margin-left: auto; }
.nav > ul { display: flex; align-items: center; gap: .25rem; }
.nav a:not(.boton) {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .5rem .75rem; border-radius: .5rem;
  color: var(--texto-2); text-decoration: none; font-size: .9375rem; font-weight: 500;
  transition: color .15s ease, background-color .15s ease;
}
.nav a:not(.boton):hover, .nav a[aria-current="page"] { color: var(--texto); background: var(--bg-suave); }
.nav .boton { margin-left: .5rem; }

.nav__servicios { position: relative; }
.nav__servicios > a svg { width: 1rem; height: 1rem; transition: transform .2s var(--ease); }
.nav__sub {
  position: absolute; top: calc(100% + .5rem); left: 50%;
  width: 19rem; padding: .5rem;
  background: var(--superficie); border: 1px solid var(--borde); border-radius: 1rem;
  box-shadow: var(--sombra);
  opacity: 0; visibility: hidden;
  transform: translate(-50%, -6px);
  transition: opacity .18s ease, transform .25s var(--ease), visibility .18s;
}
.nav__servicios::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: .75rem; }
.nav__servicios:hover .nav__sub,
.nav__servicios:focus-within .nav__sub { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.nav__servicios:hover > a svg { transform: rotate(180deg); }
.nav__sub a { display: flex !important; width: 100%; gap: .75rem !important; padding: .625rem .75rem !important; }
.nav__sub svg { width: 1.25rem; height: 1.25rem; color: var(--acento); flex: none; }

.menu-boton {
  display: none; margin-left: auto;
  width: 2.75rem; height: 2.75rem; align-items: center; justify-content: center;
  border: 1px solid var(--borde); border-radius: .75rem;
  background: var(--superficie); color: var(--texto); cursor: pointer;
}
.menu-boton svg { width: 1.25rem; height: 1.25rem; }
.menu-boton .cerrar { display: none; }
.menu-abierto .menu-boton .abrir { display: none; }
.menu-abierto .menu-boton .cerrar { display: block; }

@media (max-width: 56rem) {
  .menu-boton { display: inline-flex; }
  .nav {
    position: fixed; inset: 4.25rem 0 auto 0; z-index: 49;
    max-height: calc(100dvh - 4.25rem); overflow: auto;
    padding: 1rem 1.5rem 1.5rem;
    background: var(--bg); border-bottom: 1px solid var(--borde);
    box-shadow: 0 24px 40px -24px rgba(0, 0, 0, .35);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .2s ease, transform .3s var(--ease), visibility .2s;
  }
  .menu-abierto .nav { opacity: 1; visibility: visible; transform: none; }
  .menu-abierto .cabecera { background: var(--bg); border-bottom-color: var(--borde); }
  .nav > ul { flex-direction: column; align-items: stretch; gap: .25rem; }
  .nav a:not(.boton) { padding: .75rem; font-size: 1rem; }
  .nav .boton { margin: .75rem 0 0; }
  .nav__sub {
    position: static; width: auto; padding: 0 0 0 .5rem;
    opacity: 1; visibility: visible; transform: none;
    background: none; border: 0; box-shadow: none;
  }
  .nav__servicios > a svg { display: none; }
}

/* ───────── Hero ───────── */
.hero { position: relative; padding: 3.5rem 0 5rem; overflow: hidden; }
.hero::before {
  /* Retícula tenue que se desvanece: el "papel" de un formulario de consulta */
  content: ""; position: absolute; inset: -4rem 0 0; z-index: -1;
  background-image:
    linear-gradient(var(--borde) 1px, transparent 1px),
    linear-gradient(90deg, var(--borde) 1px, transparent 1px);
  background-size: 3rem 3rem;
  mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 10%, transparent 70%);
  opacity: .6;
}
.hero__rejilla { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 3.5rem; align-items: center; }
.hero h1 { font-size: clamp(2.25rem, 5vw, 4.25rem); letter-spacing: -0.04em; line-height: 1.02; }
.hero__lead { margin-top: 1.25rem; max-width: 30rem; font-size: 1.1875rem; color: var(--texto-2); }
.hero__acciones { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.hero__fuentes { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2.25rem; }
.fuente {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .25rem .625rem; border-radius: 999px;
  border: 1px solid var(--borde); background: var(--superficie);
  font-size: .8125rem; color: var(--texto-2);
}
.fuente::before { content: ""; width: .375rem; height: .375rem; border-radius: 50%; background: var(--exito); }

/* Entrada orquestada de la portada: una sola vez */
.js .entra { animation: entra .8s var(--ease) both; animation-delay: calc(var(--d, 0) * 90ms); }
@keyframes entra { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }

/* ───────── Consola ───────── */
.consola {
  position: relative;
  border-radius: 1.25rem; overflow: hidden;
  background: var(--consola); color: var(--consola-texto);
  border: 1px solid var(--consola-borde);
  box-shadow: var(--sombra);
  font-family: var(--mono); font-size: .8125rem; line-height: 1.65;
}
.consola__barra {
  display: flex; align-items: center; gap: 1rem;
  padding: .625rem .75rem .625rem 1rem;
  background: var(--consola-2); border-bottom: 1px solid var(--consola-borde);
}
.consola__puntos { display: flex; gap: .375rem; flex: none; }
.consola__puntos i { width: .625rem; height: .625rem; border-radius: 50%; background: #2B3240; }
.consola__puntos i:first-child { background: var(--cp-rojo-600); }
.consola__tabs { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; font-family: var(--fuente); }
.consola__tabs::-webkit-scrollbar { display: none; }
.consola__tabs button {
  flex: none; padding: .375rem .75rem; border: 0; border-radius: .5rem;
  background: transparent; color: #8B93A3; cursor: pointer;
  font: inherit; font-size: .8125rem; font-weight: 500;
  transition: color .15s ease, background-color .15s ease;
}
.consola__tabs button:hover { color: #F3F4F6; }
.consola__tabs button[aria-selected="true"] { color: #fff; background: rgba(240, 68, 79, .16); box-shadow: inset 0 0 0 1px rgba(240, 68, 79, .35); }
.consola__cuerpo { padding: 1.125rem 1.25rem 1.25rem; min-height: 22rem; }
.consola--compacta .consola__cuerpo { min-height: 17rem; }
.consola__peticion { color: #F3F4F6; word-break: break-all; min-height: 1.65em; }
.consola__peticion::before { content: "$ "; color: #5B6270; }
.c-metodo { font-weight: 700; }
.c-get { color: var(--cp-verde-claro); }
.c-post { color: #FF8A91; }
.c-cuerpo { color: #8B93A3; }
.c-cursor {
  display: inline-block; width: .55em; height: 1.1em; margin-left: 1px;
  vertical-align: -.2em; background: var(--cp-rojo-500);
  animation: parpadeo 1s steps(1) infinite;
}
@keyframes parpadeo { 50% { opacity: 0; } }
.consola__estado {
  display: flex; align-items: center; gap: .5rem; margin: .875rem 0 .625rem;
  color: #8B93A3; font-size: .75rem; min-height: 1.2rem;
}
.consola__estado b { color: var(--cp-verde-claro); }
.js .consola__estado:not(.visible) { opacity: 0; }
.consola__estado.visible { animation: entra .4s var(--ease) both; }
.consola.cargando .consola__estado { opacity: 1; }
.consola.cargando .consola__estado::before {
  content: ""; width: 4rem; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--cp-rojo-500), transparent);
  background-size: 200% 100%; animation: barrido 1s linear infinite;
}
@keyframes barrido { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.consola__salida { margin: 0; white-space: pre-wrap; word-break: break-word; }
.c-linea { display: block; }
.c-entra { animation: linea .35s var(--ease) both; }
@keyframes linea { from { opacity: 0; transform: translateX(-6px); } }
.j-k { color: #82B6FF; }
.j-s { color: #F6C177; }
.j-n { color: #FF8A91; }
.j-b { color: var(--cp-verde-claro); }

/* ───────── Secciones ───────── */
.seccion { padding: 6rem 0; }
.seccion--suave { background: var(--bg-suave); border-block: 1px solid var(--borde); }
.seccion__cabeza { max-width: 38rem; margin-bottom: 3rem; }
.seccion__cabeza h2 { font-size: clamp(2rem, 3.6vw, 2.875rem); }
.seccion__cabeza p { margin-top: .875rem; font-size: 1.0625rem; color: var(--texto-2); }

/* Lista de servicios: filas, no tarjetas */
.servicios { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 3rem; border-top: 1px solid var(--borde); }
.servicio { border-bottom: 1px solid var(--borde); }
.servicio a {
  position: relative; display: grid; grid-template-columns: 3rem 1fr auto; align-items: center; gap: 1.25rem;
  padding: 1.5rem .25rem; text-decoration: none;
}
.servicio__icono {
  display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: .875rem;
  background: var(--acento-suave); color: var(--acento);
  transition: transform .35s var(--ease), background-color .2s ease, color .2s ease;
}
.servicio__icono svg { width: 1.5rem; height: 1.5rem; }
.servicio h3 { font-size: 1.25rem; letter-spacing: -0.02em; }
.servicio p { margin-top: .25rem; font-size: .9375rem; color: var(--texto-2); }
.servicio code { display: block; margin-top: .5rem; font-size: .75rem; color: var(--texto-2); opacity: .8; }
.servicio__flecha { width: 1.25rem; height: 1.25rem; color: var(--texto-2); transition: transform .3s var(--ease), color .2s ease; }
.servicio a:hover .servicio__icono { transform: rotate(-6deg) scale(1.06); background: var(--cp-rojo-600); color: #fff; }
.servicio a:hover .servicio__flecha { transform: translateX(4px); color: var(--acento); }
.servicio a:hover h3 { color: var(--acento); }
.escena.play .servicio { animation: entra .6s var(--ease) both; animation-delay: calc(var(--d, 0) * 70ms); }

/* Pasos: secuencia real (token → petición → JSON) */
.pasos { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; counter-reset: paso; }
.pasos::before {
  content: ""; position: absolute; top: 1.375rem; left: 1.375rem; right: 1.375rem; height: 2px;
  background: var(--acento); transform-origin: left; transform: scaleX(1); opacity: .5;
}
.escena.play.pasos::before { animation: traza-x 1.4s var(--ease) both .2s; }
@keyframes traza-x { from { transform: scaleX(0); } }
.paso { position: relative; }
.paso__num {
  position: relative; z-index: 1;
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  background: var(--cp-rojo-600); color: #fff; font-weight: 700;
  box-shadow: 0 0 0 6px var(--bg);
}
.seccion--suave .paso__num { box-shadow: 0 0 0 6px var(--bg-suave); }
.paso__num::before { counter-increment: paso; content: counter(paso); }
.paso h3 { margin-top: 1.25rem; font-size: 1.25rem; letter-spacing: -0.02em; }
.paso p { margin-top: .375rem; color: var(--texto-2); font-size: .9375rem; max-width: 18rem; }
.paso code { font-size: .8125rem; padding: .1rem .375rem; border-radius: .375rem; background: var(--acento-suave); color: var(--acento); }

/* Bloque de código con pestañas */
.codigo {
  margin-top: 3.5rem; border-radius: 1.25rem; overflow: hidden;
  background: var(--consola); border: 1px solid var(--consola-borde); box-shadow: var(--sombra);
}
.codigo__barra {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .5rem .5rem .5rem .75rem; background: var(--consola-2); border-bottom: 1px solid var(--consola-borde);
}
.codigo__tabs { position: relative; display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.codigo__tabs button {
  padding: .4rem .75rem; border: 0; border-radius: .5rem; background: none; cursor: pointer;
  color: #8B93A3; font: inherit; font-size: .8125rem; font-weight: 500; transition: color .15s ease, background-color .2s ease;
}
.codigo__tabs button:hover { color: #F3F4F6; }
.codigo__tabs button[aria-selected="true"] { color: #fff; background: rgba(255, 255, 255, .08); }
.codigo__copiar {
  flex: none; padding: .4rem .75rem; border-radius: .5rem; cursor: pointer;
  border: 1px solid var(--consola-borde); background: transparent; color: #D9DCE3;
  font: inherit; font-size: .8125rem; transition: border-color .15s ease, color .15s ease;
}
.codigo__copiar:hover { border-color: #5B6270; }
.codigo__copiar.copiado { color: var(--cp-verde-claro); border-color: var(--cp-verde-claro); }
.codigo pre { margin: 0; padding: 1.25rem 1.5rem; overflow-x: auto; color: #D9DCE3; font-size: .8125rem; line-height: 1.7; }
.codigo [role="tabpanel"]:not([hidden]) { animation: entra .35s var(--ease) both; }
.codigo .t-c { color: #6B7385; }
.codigo .t-s { color: #F6C177; }
.codigo .t-k { color: #FF8A91; }
.codigo .t-f { color: #82B6FF; }

/* Razones: tres hechos con su propia micro-animación */
.razones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--borde); border: 1px solid var(--borde); border-radius: 1.25rem; overflow: hidden; }
.razon { background: var(--superficie); padding: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.razon h3 { font-size: 1.25rem; letter-spacing: -0.02em; }
.razon p { margin-top: .375rem; color: var(--texto-2); font-size: .9375rem; }
.razon__visual {
  height: 9rem; border-radius: .875rem; background: var(--bg-suave); border: 1px solid var(--borde);
  display: grid; place-items: center; overflow: hidden; position: relative;
}

/* Razón 1: cuota que no baja cuando la fuente falla */
.cuota { width: 78%; font-size: .8125rem; color: var(--texto-2); }
.cuota__fila { display: flex; justify-content: space-between; align-items: baseline; }
.cuota__fila b { font-size: 1.75rem; color: var(--texto); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.cuota__barra { height: .5rem; margin-top: .625rem; border-radius: 99px; background: var(--borde); overflow: hidden; }
.cuota__barra i { display: block; height: 100%; width: 38%; border-radius: inherit; background: var(--acento); }
.cuota__aviso {
  display: inline-flex; align-items: center; gap: .375rem; margin-top: .75rem;
  padding: .2rem .5rem; border-radius: 99px; background: var(--exito-suave); color: var(--exito); font-weight: 600; font-size: .75rem;
}
.cuota__aviso svg { width: .875rem; height: .875rem; }
.escena.play .cuota__aviso { animation: pop .5s var(--ease) both; animation-delay: calc(var(--d, 0) * 120ms); }

/* Razón 2: IPs permitidas */
.ips { width: 80%; display: grid; gap: .375rem; font-family: var(--mono); font-size: .75rem; }
.ip { display: flex; justify-content: space-between; align-items: center; padding: .375rem .625rem; border-radius: .5rem; background: var(--superficie); border: 1px solid var(--borde); }
.ip span:last-child { font-family: var(--fuente); font-weight: 600; font-size: .6875rem; }
.ip--ok span:last-child { color: var(--exito); }
.ip--no { color: var(--texto-2); }
.ip--no span:last-child { color: var(--acento); }
.escena.play .ip { animation: entra .5s var(--ease) both; animation-delay: calc(var(--d, 0) * 120ms); }
.escena.play .ip--no { animation: entra .5s var(--ease) both, sacude .45s ease calc(var(--d, 0) * 120ms + 500ms); }
@keyframes sacude { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

/* Razón 3: JSON uniforme */
.uniforme { font-family: var(--mono); font-size: .8125rem; line-height: 1.8; color: var(--texto-2); }
.uniforme b { color: var(--acento); font-weight: 600; }
.uniforme span { display: block; }
.escena.play .uniforme span { animation: entra .5s var(--ease) both; animation-delay: calc(var(--d, 0) * 120ms); }

@keyframes pop { from { opacity: 0; transform: scale(.6); } }

/* Preguntas frecuentes */
.faq { max-width: 48rem; border-top: 1px solid var(--borde); }
.faq details { border-bottom: 1px solid var(--borde); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.25rem 0; cursor: pointer; list-style: none;
  font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: var(--bg-suave) no-repeat center / 1rem
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D62839' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
  transition: transform .3s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--acento); }
.faq details p { padding: 0 3rem 1.25rem 0; color: var(--texto-2); }
.faq details[open] p { animation: entra .4s var(--ease) both; }

/* Llamado final */
.cta { padding: 5rem 0 6rem; }
.cta__caja {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
  padding: 3.5rem; border-radius: 1.75rem;
  background: var(--cp-noche-950); color: #F3F4F6;
}
.cta__caja::before {
  /* Lupa de la marca, enorme y girando lento: el único adorno */
  content: ""; position: absolute; right: -4rem; top: 50%; z-index: -1;
  width: 22rem; height: 22rem; translate: 0 -50%;
  background: no-repeat center / contain url("/assets/lupa.svg");
  opacity: .14;
  animation: orbita 24s linear infinite;
}
@keyframes orbita { to { rotate: 360deg; } }
.cta__caja h2 { font-size: clamp(1.875rem, 3.5vw, 2.75rem); max-width: 30rem; }
.cta__caja p { margin-top: .75rem; color: #A3AAB8; }
.cta__caja .hero__acciones { margin-top: 0; }
.cta__caja .boton-secundario { background: transparent; color: #F3F4F6; border-color: #353C4A; }
.cta__caja .boton-secundario:hover { border-color: #A3AAB8; }

/* ───────── Páginas de servicio ───────── */
.migas { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .875rem; color: var(--texto-2); margin-bottom: 1.5rem; }
.migas a { text-decoration: none; }
.migas a:hover { color: var(--acento); }
.migas li + li::before { content: "/"; margin-right: .5rem; opacity: .5; }

.hero--servicio { padding-top: 2.5rem; }
.hero--servicio h1 { font-size: clamp(2.375rem, 5vw, 4rem); }

.visual {
  position: relative; aspect-ratio: 5 / 4; width: 100%;
  border-radius: 1.5rem; background: var(--bg-suave); border: 1px solid var(--borde);
  display: grid; place-items: center; overflow: hidden;
}

/* Animaciones de escena genéricas (solo con .play; sin ella se ve el estado final) */
.escena.play .a-sube { animation: entra .6s var(--ease) both; animation-delay: calc(var(--d, 0) * 120ms); }
.escena.play .a-pop { animation: pop .55s var(--ease) both; animation-delay: calc(var(--d, 0) * 120ms); }
.escena.play .a-traza { animation: traza 1.4s var(--ease) both; animation-delay: calc(var(--d, 0) * 120ms); }
.escena.play .a-sello { animation: sello .6s var(--ease) both; animation-delay: calc(var(--d, 0) * 120ms); }
.escena.play .a-barre { animation: barre 1.6s var(--ease) both; animation-delay: calc(var(--d, 0) * 120ms); }
.escena.play .a-ancho { animation: ancho 1s var(--ease) both; animation-delay: calc(var(--d, 0) * 120ms); transform-origin: left; }
.escena.play .a-cae { animation: cae .7s var(--ease) both; animation-delay: calc(var(--d, 0) * 120ms); }
@keyframes traza { from { stroke-dashoffset: 1; } }
@keyframes sello { from { opacity: 0; transform: scale(1.8) rotate(-24deg); filter: blur(4px); } }
@keyframes barre { from { transform: translateY(-100%); opacity: 1; } 85% { opacity: 1; } to { transform: translateY(var(--hasta, 18rem)); opacity: 0; } }
@keyframes ancho { from { transform: scaleX(0); } }
@keyframes cae { from { opacity: 0; transform: translateY(-40px) scale(.9); } }
.a-traza { stroke-dasharray: 1; stroke-dashoffset: 0; }
.a-barre { opacity: 0; }

/* Tarjeta tipo documento (DNI y licencia) */
.doc {
  position: relative; width: 82%; aspect-ratio: 1.586; padding: 1.25rem;
  border-radius: 1rem; background: var(--superficie); border: 1px solid var(--borde);
  box-shadow: var(--sombra); overflow: hidden;
  display: grid; grid-template-columns: 30% 1fr; grid-template-rows: auto 1fr; gap: .75rem 1rem;
}
.doc__cabeza { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; font-size: .6875rem; font-weight: 700; color: var(--texto-2); letter-spacing: .02em; }
.doc__cabeza span:last-child { color: var(--acento); }
.doc__foto { border-radius: .625rem; background: var(--bg-suave); border: 1px solid var(--borde); display: grid; place-items: end center; overflow: hidden; }
.doc__foto svg { width: 92%; height: auto; color: var(--borde-fuerte); }
.doc__campos { display: grid; align-content: start; gap: .5rem; min-width: 0; }
.doc__campo small { display: block; font-size: .625rem; color: var(--texto-2); }
.doc__campo span { display: block; font-size: .875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.3em; }
.doc__campo .numero { font-family: var(--mono); font-size: 1rem; letter-spacing: .04em; color: var(--acento); }
.doc__escaner {
  position: absolute; left: 0; right: 0; top: 0; height: 3rem; pointer-events: none; --hasta: 20rem;
  background: linear-gradient(180deg, transparent, rgba(214, 40, 57, .18) 85%, var(--cp-rojo-600) 86%, transparent 90%);
}

/* Chips de estado */
.chip { display: inline-flex; align-items: center; gap: .375rem; padding: .25rem .625rem; border-radius: 99px; font-size: .75rem; font-weight: 700; }
.chip--ok { background: var(--exito-suave); color: var(--exito); }
.chip--acento { background: var(--acento-suave); color: var(--acento); }
.chip svg { width: .875rem; height: .875rem; }

/* RUC */
.ruc { width: 84%; display: grid; gap: 1rem; }
.ruc__numero { display: flex; justify-content: center; gap: .25rem; font-family: var(--mono); font-size: clamp(.9375rem, 2vw, 1.375rem); font-weight: 700; }
.ruc__numero span { display: grid; place-items: center; flex: 1 1 0; min-width: 0; max-width: 2.2em; height: 2.2em; border-radius: .5rem; background: var(--superficie); border: 1px solid var(--borde); }
.ruc__numero span:last-child { background: var(--cp-rojo-600); color: #fff; border-color: transparent; }
.ruc__ficha { padding: 1.25rem; border-radius: 1rem; background: var(--superficie); border: 1px solid var(--borde); box-shadow: var(--sombra); }
.ruc__ficha strong { display: block; font-size: 1.0625rem; letter-spacing: -0.01em; }
.ruc__ficha small { display: block; margin-top: .25rem; color: var(--texto-2); font-size: .8125rem; }
.ruc__chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .875rem; }
.ruc__locales { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; padding-top: .875rem; border-top: 1px dashed var(--borde-fuerte); font-size: .8125rem; color: var(--texto-2); }
.ruc__locales b { font-size: 1.25rem; color: var(--texto); font-variant-numeric: tabular-nums; }

/* Tipo de cambio */
.tc { width: 86%; }
.tc__cifras { display: flex; gap: 2rem; margin-bottom: 1rem; }
.tc__cifras small { display: block; font-size: .75rem; color: var(--texto-2); }
.tc__cifras b { font-size: clamp(1.75rem, 3.4vw, 2.5rem); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tc__cifras div:last-child b { color: var(--acento); }
.tc svg { width: 100%; height: auto; overflow: visible; }
.tc .rejilla line { stroke: var(--borde); stroke-width: 1; }
.tc .compra { stroke: var(--texto-2); }
.tc .venta { stroke: var(--acento); }
.tc .area { fill: var(--acento-suave); }
.escena.play .tc .area { animation: entra 1s var(--ease) both .9s; }
.tc .punto { fill: var(--acento); stroke: var(--superficie); stroke-width: 3; }

/* Comprobante con sello */
.cpe { position: relative; width: 54%; translate: 14% -6%; }
.ticket {
  padding: 1.25rem 1.25rem 1.5rem; background: var(--superficie); border: 1px solid var(--borde);
  border-radius: .75rem .75rem 0 0; box-shadow: var(--sombra); font-size: .75rem;
  mask: radial-gradient(circle at 50% 100%, transparent .5rem, #000 .52rem) bottom / 1.25rem 100% repeat-x;
  -webkit-mask: radial-gradient(circle .5rem at 50% 100%, transparent 98%, #000) bottom / 1.25rem 100% repeat-x;
}
.ticket__cabeza { text-align: center; padding-bottom: .75rem; border-bottom: 1px dashed var(--borde-fuerte); }
.ticket__cabeza strong { display: block; font-size: .875rem; }
.ticket__cabeza code { color: var(--acento); font-size: .8125rem; font-weight: 700; }
.ticket__linea { display: flex; justify-content: space-between; padding: .375rem 0; color: var(--texto-2); }
.ticket__linea b { color: var(--texto); }
.ticket__barras { height: .5rem; margin: .375rem 0; border-radius: 99px; background: var(--bg-suave); }
.ticket__barras:nth-child(odd) { width: 70%; }
.ticket__total { display: flex; justify-content: space-between; padding-top: .75rem; margin-top: .375rem; border-top: 1px dashed var(--borde-fuerte); font-size: .9375rem; font-weight: 700; }
.sello {
  position: absolute; right: -12%; bottom: -16%;
  padding: .5rem 1rem; border: 3px solid var(--exito); border-radius: .625rem;
  color: var(--exito); font-weight: 800; font-size: 1.125rem; letter-spacing: .04em;
  transform: rotate(-8deg); background: color-mix(in srgb, var(--superficie) 85%, transparent);
}
.lote { position: absolute; left: 5%; bottom: 5%; width: 38%; padding: .75rem; border-radius: .75rem; background: var(--superficie); border: 1px solid var(--borde); box-shadow: var(--sombra); font-size: .6875rem; }
.lote__fila { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: center; padding: .3rem 0; border-bottom: 1px solid var(--borde); font-family: var(--mono); }
.lote__fila:last-child { border: 0; }
.lote__fila svg { width: 1rem; height: 1rem; }
.lote__fila .ok { color: var(--exito); }
.lote__fila .obs { color: #C98A0E; }

/* Archivos XML / CDR / PDF */
.archivos { position: relative; width: 86%; display: grid; justify-items: center; gap: 1.5rem; }
.candado {
  display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem;
  border-radius: .875rem; background: var(--superficie); border: 1px solid var(--borde); box-shadow: var(--sombra);
  font-size: .8125rem; font-weight: 600;
}
.candado svg { width: 1.5rem; height: 1.5rem; color: var(--acento); }
.candado .arco { transform-origin: 17px 11px; }
.escena.play .candado .arco { animation: abre .5s var(--ease) both .4s; }
@keyframes abre { to { transform: translateY(-3px) rotate(28deg); } }
.archivos__fila { display: flex; gap: 1rem; }
.archivo {
  width: 5.75rem; padding: 1rem .75rem .75rem; border-radius: .75rem;
  background: var(--superficie); border: 1px solid var(--borde); box-shadow: var(--sombra);
  display: grid; justify-items: center; gap: .5rem; text-align: center;
}
.archivo svg { width: 2.25rem; height: 2.25rem; }
.archivo b { font-size: .875rem; }
.archivo small { font-size: .625rem; color: var(--texto-2); }
.archivo--xml svg { color: #2F7BD8; }
.archivo--cdr svg { color: var(--exito); }
.archivo--pdf svg { color: var(--acento); }
.archivos__flujo { width: 2px; height: 2.5rem; background: linear-gradient(var(--acento), transparent); transform-origin: top; }
.escena.play .archivos__flujo { animation: crece .5s var(--ease) both .7s; }
@keyframes crece { from { transform: scaleY(0); } }

/* Qué devuelve: campos que se encienden en orden */
.campos { display: flex; flex-wrap: wrap; gap: .5rem; max-width: 52rem; }
.campos li {
  padding: .5rem .875rem; border-radius: .625rem; background: var(--superficie); border: 1px solid var(--borde);
  font-family: var(--mono); font-size: .8125rem;
}
.campos li::before { content: ""; display: inline-block; width: .4rem; height: .4rem; margin-right: .5rem; border-radius: 50%; background: var(--acento); vertical-align: .1em; }
.escena.play .campos li { animation: pop .45s var(--ease) both; animation-delay: calc(var(--d, 0) * 45ms); }

/* Endpoints */
.endpoints { display: grid; border-top: 1px solid var(--borde); }
.endpoint {
  display: grid; grid-template-columns: 4.25rem minmax(0, 1fr) auto; gap: 1rem; align-items: center;
  padding: 1rem .25rem; border-bottom: 1px solid var(--borde);
}
.metodo { justify-self: start; padding: .2rem .5rem; border-radius: .375rem; font-family: var(--mono); font-size: .75rem; font-weight: 700; }
.metodo--get { background: var(--exito-suave); color: var(--exito); }
.metodo--post { background: var(--acento-suave); color: var(--acento); }
.endpoint code { font-size: .875rem; font-weight: 600; overflow-wrap: anywhere; }
.endpoint p { grid-column: 2; font-size: .875rem; color: var(--texto-2); }
.endpoint .modulo { grid-row: 1; grid-column: 3; font-family: var(--mono); font-size: .75rem; color: var(--texto-2); padding: .15rem .5rem; border: 1px solid var(--borde); border-radius: 99px; }

.dos-col { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 3.5rem; align-items: start; }

/* Relacionados */
.relacionados { display: flex; flex-wrap: wrap; gap: .75rem; }
.relacionados a {
  display: inline-flex; align-items: center; gap: .625rem; padding: .75rem 1rem;
  border-radius: .875rem; border: 1px solid var(--borde); background: var(--superficie);
  text-decoration: none; font-weight: 600; font-size: .9375rem;
  transition: border-color .15s ease, transform .25s var(--ease), color .15s ease;
}
.relacionados a svg { width: 1.25rem; height: 1.25rem; color: var(--acento); }
.relacionados a:hover { border-color: var(--acento); color: var(--acento); transform: translateY(-2px); }

/* ───────── Pie ───────── */
.pie { border-top: 1px solid var(--borde); padding: 4rem 0 2rem; font-size: .9375rem; }
.pie__rejilla { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
.pie__marca img { height: 2rem; width: auto; }
.pie__marca p { margin-top: 1rem; max-width: 18rem; color: var(--texto-2); font-size: .875rem; }
.pie h2 { font-size: .9375rem; letter-spacing: 0; margin-bottom: 1rem; }
.pie ul { display: grid; gap: .5rem; }
.pie a { color: var(--texto-2); text-decoration: none; }
.pie a:hover { color: var(--acento); }
.pie__legal { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--borde); color: var(--texto-2); font-size: .8125rem; }

/* ───────── 404 ───────── */
.error404 { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 4rem 0; }
.error404 .codigo-error { font-size: clamp(5rem, 16vw, 9rem); font-weight: 800; letter-spacing: -0.06em; line-height: 1; color: var(--acento); }
.error404 h1 { margin-top: .5rem; font-size: clamp(1.75rem, 4vw, 2.5rem); }
.error404 p { margin: 1rem auto 0; max-width: 28rem; color: var(--texto-2); }
.error404 .hero__acciones { justify-content: center; }

/* ───────── Responsive ───────── */
@media (max-width: 60rem) {
  .hero__rejilla, .dos-col { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  .servicios { grid-template-columns: minmax(0, 1fr); }
  .razones { grid-template-columns: minmax(0, 1fr); }
  .pie__rejilla { grid-template-columns: 1fr 1fr; }
  .pie__marca { grid-column: 1 / -1; }
}
@media (max-width: 40rem) {
  .seccion { padding: 4rem 0; }
  .hero { padding: 2rem 0 3.5rem; }
  .hero__lead { font-size: 1.0625rem; }
  .hero__acciones .boton { flex: 1 1 100%; }
  .pasos { grid-template-columns: 1fr; gap: 2rem; }
  .pasos::before { top: 1.375rem; bottom: 1.375rem; left: 1.375rem; right: auto; width: 2px; height: auto; transform-origin: top; }
  .escena.play.pasos::before { animation-name: traza-y; }
  .paso { padding-left: 4rem; }
  .paso__num { position: absolute; left: 0; top: 0; }
  .paso h3 { margin-top: .5rem; }
  .cta__caja { padding: 2.25rem 1.5rem; }
  .consola { font-size: .75rem; }
  .consola__cuerpo { min-height: 20rem; padding: 1rem; }
  .endpoint { grid-template-columns: 3.75rem minmax(0, 1fr); }
  .endpoint .modulo { grid-row: auto; grid-column: 2; justify-self: start; }
  .visual { aspect-ratio: auto; padding: 1.5rem 0; min-height: 18rem; }
  .doc { width: 92%; padding: 1rem; aspect-ratio: auto; }
  .doc__foto { align-self: start; aspect-ratio: 3 / 4; }
  .cpe { width: 70%; translate: 0 0; }
  .sello { right: -8%; font-size: .9375rem; }
  .lote { display: none; }
  .archivo { width: 4.75rem; }
  .pie__rejilla { grid-template-columns: 1fr; }
}
@keyframes traza-y { from { transform: scaleY(0); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .cta__caja::before { animation: none; }
}

/* ── Botón flotante de WhatsApp (lo arma sitio.js con los agentes del admin) ── */
.wa-boton {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 60;
  display: inline-flex; align-items: center; justify-content: center;
  width: 3.5rem; height: 3.5rem; border: 0; border-radius: 50%;
  background: #25D366; color: #FFFFFF; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  transition: transform .16s ease, filter .16s ease;
}
.wa-boton:hover { filter: brightness(1.06); transform: translateY(-1px); }
.wa-boton:focus-visible { outline: 3px solid var(--acento); outline-offset: 3px; }
.wa-panel {
  position: fixed; right: 1.25rem; bottom: 5.5rem; z-index: 60;
  width: min(22.5rem, calc(100vw - 2rem)); max-height: calc(100dvh - 7.5rem); overflow: auto;
  border: 1px solid var(--borde); border-radius: 1rem;
  background: var(--superficie); color: var(--texto);
  box-shadow: var(--sombra);
  animation: wa-entrada .2s var(--ease) both;
}
.wa-panel[hidden] { display: none; }
.wa-cabecera {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: 1.5rem 1.5rem 1.25rem; text-align: center; color: #FFFFFF;
  background: linear-gradient(135deg, #128C7E, #25D366);
}
.wa-burbuja {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3.5rem; height: 3.5rem; border-radius: 50%; background: rgba(255, 255, 255, .18);
}
.wa-titulo { margin: 0; font-size: 1.125rem; font-weight: 700; color: #FFFFFF; }
.wa-mensaje { margin: 0; font-size: .875rem; line-height: 1.5; color: rgba(255, 255, 255, .94); }
.wa-lista { display: flex; flex-direction: column; gap: .5rem; padding: 1rem; }
.wa-ayuda { margin: 0 .25rem .125rem; font-size: .8125rem; font-weight: 500; color: var(--texto-2); }
.wa-agente {
  display: flex; align-items: center; gap: .75rem; padding: .75rem .875rem;
  border-radius: .75rem; background: var(--bg-suave); color: inherit; text-decoration: none;
  transition: transform .16s ease, background .16s ease;
}
.wa-agente:hover { transform: translateY(-1px); background: var(--acento-suave); }
.wa-avatar { flex: none; width: 2.5rem; height: 2.5rem; border-radius: 50%; object-fit: cover; background: #FFFFFF; }
.wa-iniciales {
  display: inline-flex; align-items: center; justify-content: center;
  background: #128C7E; color: #FFFFFF; font-size: .875rem; font-weight: 600;
}
.wa-datos { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: 1.25; }
.wa-nombre, .wa-rol { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-nombre { font-size: .9375rem; font-weight: 600; }
.wa-rol { font-size: .75rem; color: var(--texto-2); }
.wa-estado { display: inline-flex; flex: none; align-items: center; gap: .375rem; font-size: .78rem; font-weight: 600; color: var(--texto-2); }
.wa-en-linea { color: var(--exito); }
.wa-punto { width: .5rem; height: .5rem; border-radius: 50%; background: var(--borde-fuerte); }
.wa-en-linea .wa-punto { background: #25D366; }
@keyframes wa-entrada { from { opacity: 0; transform: translateY(.75rem); } }
@media (max-width: 600px) {
  .wa-boton { right: 1rem; bottom: 1rem; }
  .wa-panel { right: 1rem; bottom: 5.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  .wa-boton, .wa-agente { transition: none; }
  .wa-panel { animation: none; }
}
