/* Only Tap · Plataforma · pantalla de acceso (web/index.html)
 * -----------------------------------------------------------------------------
 * Dos composiciones, un solo formulario (el MISMO HTML y el mismo JavaScript):
 *
 *   · Móvil y tablet  → el panel de analítica es el FONDO de toda la pantalla
 *                       (violeta oscuro) y el formulario va encima, en claro
 *                       sobre oscuro. No es el escritorio encogido.
 *   · ≥ 960 px        → pantalla partida: izquierda muy clara con el formulario,
 *                       derecha el panel de analítica. Lo llamativo queda a la
 *                       derecha; el formulario, tranquilo y legible.
 *
 * Las variables --lg-* son SOLO de esta pantalla: esta hoja únicamente se carga
 * en index.html, así que no tocan Insights, Business ni el Workspace. El modo
 * oscuro global (html[data-tema]) no interviene aquí: el acceso tiene su propia
 * identidad y no cambia con esa preferencia.
 *
 * Las cifras del panel son un EJEMPLO (cada tarjeta lo rotula). No son datos de
 * ningún negocio ni prometen métricas que el producto no registre.
 */

:root {
  --lg-fondo:        #070F2B;   /* --marino-950 */
  --lg-fondo-2:      #0F1F4D;   /* --marino-800 */
  --lg-marca:        #1F5BDB;   /* --ot-azul */
  --lg-marca-vivo:   #2E6CF0;   /* --ot-azul-vivo */
  --lg-marca-alto:   #9DB7F8;   /* texto de enlace sobre oscuro */
  --lg-marca-hondo:  #1747B0;   /* --ot-azul-fuerte */
  --lg-sobre:        #FFFFFF;
  --lg-sobre-2:      rgba(255, 255, 255, .74);
  --lg-sobre-3:      rgba(255, 255, 255, .58);
  --lg-campo:        rgba(255, 255, 255, .07);
  --lg-campo-2:      rgba(255, 255, 255, .11);
  --lg-campo-borde:  rgba(255, 255, 255, .22);
  --lg-ficha:        rgba(255, 255, 255, .10);
  --lg-ficha-borde:  rgba(255, 255, 255, .16);
  --lg-mal:          #FFB4AD;
  --lg-mal-fondo:    rgba(180, 35, 24, .22);
  --lg-mal-borde:    rgba(255, 138, 128, .45);
  --lg-bien:         #86E0AC;
  --lg-bien-fondo:   rgba(11, 122, 59, .22);
  --lg-bien-borde:   rgba(134, 224, 172, .40);
  --lg-claro:        #F5F6F9;   /* --lienzo */
  --lg-foco:         0 0 0 3px rgba(46, 108, 240, .35);
  /* Iluminación del panel y relleno de las tarjetas. Están en variables para
     poder comparar paletas sin tocar la composición (ver «paleta azul» abajo). */
  --lg-luz-1:        rgba(46, 108, 240, .55);
  --lg-luz-2:        rgba(23, 44, 102, .60);
  --lg-luz-3:        rgba(167, 174, 242, .22);
  --lg-ficha-a:      rgba(46, 108, 240, .92);
  --lg-ficha-b:      rgba(23, 71, 176, .94);
  --lg-sombra-boton: rgba(31, 91, 219, .45);
  --lg-autofill:     #10265C;
  --lg-autofill-2:   #16306F;
  --lg-tinte-rgb:    31, 91, 219;    /* tinte de marca en la mitad clara */
  --lg-autofill-claro: #E7EEFD;
}


* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100dvh; background: var(--lg-fondo); color: var(--lg-sobre);
  font-family: var(--fuente); font-size: var(--t-md); line-height: var(--i-texto);
  -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: var(--foco-ancho) solid var(--lg-marca-vivo); outline-offset: var(--foco-hueco); }
.oculto { display: none !important; }
.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===================================================== apertura (splash) */
.apertura { position: fixed; inset: 0; z-index: var(--z-apertura); display: grid; place-items: center;
  background: radial-gradient(90% 70% at 50% 18%, var(--lg-fondo-2) 0%, var(--lg-fondo) 70%);
  opacity: 0; visibility: hidden; transition: opacity var(--mov-3) var(--curva), visibility 0s linear var(--mov-3); }
html.esperando .apertura { opacity: 1; visibility: visible; transition: opacity var(--mov-3) var(--curva), visibility 0s; }
html.listo .apertura { opacity: 0; visibility: hidden; }
.apertura-luz { position: absolute; inset: -20%; pointer-events: none; opacity: .75;
  background: radial-gradient(38% 30% at 50% 36%, var(--lg-luz-1) 0%, transparent 70%);
  animation: deriva 9s ease-in-out infinite alternate; }
.apertura-marca { position: relative; display: flex; flex-direction: column; align-items: center; animation: brota var(--mov-4) var(--curva) both; }
.apertura-logo { width: 96px; height: 96px; border-radius: var(--r-2xl); background: var(--marca-fondo); display: grid; place-items: center;
  box-shadow: 0 24px 64px var(--lg-sombra-boton); }
.apertura-logo img { display: block; width: 60px; height: 60px; }
.apertura-nombre { margin-top: var(--e6); font-size: var(--t-3xl); font-weight: var(--p-negrita); letter-spacing: var(--k-cifra); color: var(--lg-sobre); }
.apertura-barra { position: absolute; left: 50%; bottom: calc(var(--e16) + env(safe-area-inset-bottom, 0px)); translate: -50% 0;
  width: 132px; height: 3px; border-radius: var(--r-full); background: rgba(255, 255, 255, .16); overflow: hidden; }
.apertura-barra::after { content: ""; position: absolute; inset: 0; width: 40%; border-radius: inherit;
  background: var(--lg-marca-vivo); animation: corre 1.25s var(--curva) infinite; }

/* ===================================================== escena */
.escena { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* ===================================================== panel de analítica
   En móvil es el fondo (fijo, detrás del formulario). En escritorio pasa a ser
   la columna derecha. */
.panel { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(120% 80% at 50% -10%, var(--lg-fondo-2) 0%, var(--lg-fondo) 62%); }
.panel-luz { position: absolute; border-radius: 50%; pointer-events: none; filter: blur(60px); }
.panel-luz-1 { top: -18%; right: -14%; width: 78%; aspect-ratio: 1; background: var(--lg-luz-1); }
.panel-luz-2 { top: 22%; left: -28%; width: 70%; aspect-ratio: 1; background: var(--lg-luz-2); }
.panel-luz-3 { bottom: -22%; right: 4%; width: 66%; aspect-ratio: 1; background: var(--lg-luz-3); }
.panel-grano { position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background: radial-gradient(60% 40% at 50% 120%, rgba(13, 7, 34, .95) 0%, transparent 70%); }

.tablero { position: absolute; left: 50%; bottom: 0; translate: -50% 0; width: min(420px, 112%); aspect-ratio: 1 / 1;
  opacity: .5; }
.ficha { position: absolute; display: flex; flex-direction: column; gap: var(--e2); padding: var(--e4);
  border-radius: var(--r-lg); border: 1px solid var(--lg-ficha-borde); color: var(--lg-sobre);
  background: linear-gradient(145deg, var(--lg-ficha-a) 0%, var(--lg-ficha-b) 100%);
  box-shadow: 0 20px 48px rgba(10, 4, 32, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: sube var(--mov-4) var(--curva) both; }
.ficha-cabeza { display: flex; align-items: center; justify-content: space-between; gap: var(--e2); }
.ficha-titulo { font-size: var(--t-sm); font-weight: var(--p-semi); color: var(--lg-sobre); }
.ficha-chip { font-size: var(--t-2xs); font-weight: var(--p-semi); letter-spacing: var(--k-rotulo); text-transform: uppercase;
  color: rgba(255, 255, 255, .82); background: rgba(255, 255, 255, .18); border-radius: var(--r-full); padding: 2px 7px; }
.ficha-cifra { font-size: var(--t-xl); font-weight: var(--p-negrita); letter-spacing: var(--k-cifra); line-height: var(--i-cifra); }
.ficha-cifra.grande { font-size: var(--t-2xl); }
.ficha-cifra span { font-size: var(--t-sm); font-weight: var(--p-medio); letter-spacing: 0; color: rgba(255, 255, 255, .82); }
.ficha-pie { font-size: var(--t-xs); color: rgba(255, 255, 255, .80); }
.ficha-grafica { width: 100%; height: 72px; }
.ficha-onda { width: 100%; height: 34px; }
.lg-area { fill: url(#lg-area); }
.lg-linea { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.lg-linea.fina { stroke-width: 2.4; }
/* La base nunca se borra: así el bucle no deja ninguna tarjeta vacía. La viva se
   dibuja encima durante la etapa de su tarjeta y se desvanece antes de reiniciar. */
.lg-linea.base { stroke-opacity: .42; }
.lg-linea.viva { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
.ficha-nodo { position: absolute; right: var(--e5); top: 42%; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .28); }
.barra { display: block; height: 8px; border-radius: var(--r-full); background: rgba(255, 255, 255, .24); overflow: hidden; }
.barra-relleno { display: block; height: 100%; width: 65.5%; border-radius: inherit;
  background: linear-gradient(90deg, #8FE9D0 0%, #74D7F5 100%); }

.ficha-tendencia { top: 4%; right: 0; width: 72%; }
/* La cifra va a la derecha: ahí nunca la tapa la tarjeta que se superpone. */
.ficha-tendencia .ficha-cifra { align-self: flex-end; text-align: right; }
.ficha-inter { top: 30%; left: 0; width: 52%; }
.ficha-avance { top: 58%; left: 14%; width: 78%; }

.burbuja { position: absolute; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .14));
  border: 1.5px solid rgba(255, 255, 255, .75); color: #fff; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); box-shadow: 0 12px 28px rgba(10, 4, 32, .5);
  animation: flota 7s ease-in-out infinite alternate; }
.burbuja svg { width: 22px; height: 22px; }
.burbuja-estrella { fill: #FFD36B; stroke: none; }
.burbuja-1 { top: -3%; right: 8%; }
.burbuja-2 { top: 72%; left: -2%; animation-delay: -3s; }


/* En la composición vertical (móvil y tablet) el panel es SOLO fondo: degradado e
   iluminación. Ni tarjetas, ni gráficas, ni insignias. Como el tablero está fuera
   del flujo, ocultarlo no deja ningún hueco reservado. */
@media (max-width: 959px) {
  .tablero { display: none; }
}

/* ===================================================== animación del panel (solo escritorio)
   Un ciclo de 10.8 s con tres etapas de 3.6 s: Tendencia, Interacciones y
   Comparación. Cada tarjeta toma el protagonismo por turnos; las otras siguen
   visibles, atenuadas. Nada se borra de golpe y el salto de fin a inicio es
   continuo, así que no hay pantalla vacía entre ciclos.
   Solo se animan «opacity», «translate» y «scale» (y el trazo del SVG): nada que
   obligue al navegador a recalcular el diseño. */
@keyframes lg-etapa {
  0%, 28%  { opacity: 1; translate: 0 -5px; }
  36%, 94% { opacity: .72; translate: 0 0; }
  100%     { opacity: 1; translate: 0 -5px; }
}
@keyframes lg-trazo {
  0%   { stroke-dashoffset: 1; opacity: 0; }
  4%   { opacity: 1; }
  26%  { stroke-dashoffset: 0; opacity: 1; }
  34%  { stroke-dashoffset: 0; opacity: .9; }
  90%  { stroke-dashoffset: 0; opacity: 0; }
  100% { stroke-dashoffset: 1; opacity: 0; }
}
@keyframes lg-cifra {
  0%       { opacity: .55; translate: 0 5px; }
  12%, 92% { opacity: 1; translate: 0 0; }
  100%     { opacity: .55; translate: 0 5px; }
}
@keyframes lg-nodo {
  0%       { scale: .3; opacity: 0; }
  26%, 92% { scale: 1; opacity: 1; }
  100%     { scale: .3; opacity: 0; }
}
@keyframes lg-barra {
  0%       { scale: .3 1; }
  26%, 88% { scale: 1 1; }
  100%     { scale: .3 1; }
}
/* Movimiento ambiental del resplandor: lento, continuo y sin tocar el contraste. */
@keyframes lg-entra { from { opacity: 0; } to { opacity: 1; } }
@keyframes lg-aura-1 { from { translate: -3% 2%;  scale: 1;    } to { translate: 4% -3%; scale: 1.14; } }
@keyframes lg-aura-2 { from { translate: 2% -2%;  scale: 1.08; } to { translate: -4% 3%; scale: 1;    } }
@keyframes lg-aura-3 { from { translate: 1% 3%;   scale: 1;    } to { translate: -3% -2%; scale: 1.1; } }

.panel-luz-1 { animation: lg-aura-1 19s ease-in-out infinite alternate; }
.panel-luz-2 { animation: lg-aura-2 23s ease-in-out infinite alternate; }
.panel-luz-3 { animation: lg-aura-3 27s ease-in-out infinite alternate; }

@media (min-width: 960px) {
  /* La entrada la hace el tablero una sola vez; las tarjetas solo llevan el ciclo
     (si una tarjeta llevara las dos, la segunda pisaría a la primera). */
  /* OJO: el tablero se centra con translate(-50%,-50%), así que su entrada NO puede
     animar «translate» (lo sobrescribiría y lo descolocaría). Solo opacidad. */
  .tablero { animation: lg-entra var(--mov-4) var(--curva) both; }
  .ficha { animation: lg-etapa 10.8s var(--curva) infinite; }
  .ficha-inter  { animation-delay: -7.2s; }
  .ficha-avance { animation-delay: -3.6s; }

  .lg-linea.viva { animation: lg-trazo 10.8s var(--curva) infinite; }
  .ficha-tendencia .lg-linea.viva { animation-delay: 0s; }
  .ficha-inter .lg-linea.viva { animation-delay: -7.2s; }

  .ficha-cifra { animation: lg-cifra 10.8s var(--curva) infinite; }
  .ficha-tendencia .ficha-cifra { animation-delay: 0s; }
  .ficha-inter .ficha-cifra { animation-delay: -7.2s; }
  .ficha-avance .ficha-cifra { animation-delay: -3.6s; }

  .ficha-nodo { animation: lg-nodo 10.8s var(--curva) infinite; }
  .barra-relleno { transform-origin: left center; animation: lg-barra 10.8s var(--curva) infinite -3.6s; }
}

/* Pestaña en segundo plano: se detiene todo lo decorativo. */
html.pausa .panel, html.pausa .panel * { animation-play-state: paused !important; }

/* ===================================================== formulario (móvil: claro sobre oscuro) */
.hoja { position: relative; z-index: 1; flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0;
  padding: calc(var(--e8) + env(safe-area-inset-top, 0px)) var(--e6) calc(var(--e6) + env(safe-area-inset-bottom, 0px)); }
.tarjeta { width: 100%; max-width: 400px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--e5); }

.sello { display: inline-flex; align-items: center; gap: var(--e3); color: var(--lg-sobre); }
.sello .logo { width: var(--e10); height: var(--e10); border-radius: var(--r-md); background: var(--marca-fondo);
  display: grid; place-items: center; box-shadow: 0 8px 20px rgba(10, 4, 32, .45); }
.sello .logo img { width: 28px; height: 28px; }
.sello b { font-size: var(--t-lg); font-weight: var(--p-fuerte); letter-spacing: var(--k-titulo); }

.encabezado h1 { margin-top: var(--e8); color: var(--lg-sobre); font-size: var(--t-3xl); font-weight: var(--p-negrita);
  line-height: var(--i-titulo); letter-spacing: var(--k-cifra); text-wrap: balance;
  animation: aparece var(--mov-3) var(--curva) both; }
.encabezado h1:focus { outline: none; }
.encabezado p { margin-top: var(--e2); font-size: var(--t-lg); color: var(--lg-sobre-2); text-wrap: pretty; overflow-wrap: anywhere;
  animation: aparece var(--mov-3) var(--curva) 40ms both; }
.encabezado p strong { color: var(--lg-sobre); font-weight: var(--p-semi); }


/* ---- vistas */
.vista { display: flex; flex-direction: column; gap: var(--e4); animation: aparece var(--mov-3) var(--curva) 80ms both; }
.nota { font-size: var(--t-md); color: var(--lg-sobre-2); }
.nota code { font-size: .92em; background: var(--lg-campo-2); border-radius: var(--r-xs); padding: 1px 5px; }
.emblema { width: var(--e12); height: var(--e12); border-radius: var(--r-md); display: grid; place-items: center;
  background: var(--lg-campo-2); color: var(--lg-marca-alto); border: 1px solid var(--lg-campo-borde); }
.emblema svg { width: var(--e6); height: var(--e6); }

/* ---- campos */
.campo { display: flex; flex-direction: column; gap: var(--e-6); }
.campo label { font-size: var(--t-md); font-weight: var(--p-semi); color: var(--lg-sobre); }
.caja { position: relative; display: flex; }
.caja input { width: 100%; min-width: 0; height: var(--control-lg); padding: 0 var(--e4);
  font-size: var(--t-lg); color: var(--lg-sobre); background: var(--lg-campo);
  border: 1px solid var(--lg-campo-borde); border-radius: var(--r-md);
  appearance: none; -webkit-appearance: none;
  transition: border-color var(--mov-1) var(--curva), box-shadow var(--mov-1) var(--curva), background-color var(--mov-1) var(--curva); }
.caja.con-icono input { padding-left: calc(var(--e10) + var(--e1)); }
.caja .adorno { position: absolute; top: 50%; left: var(--e3); width: var(--e5); height: var(--e5); margin-top: calc(var(--e5) / -2);
  color: var(--lg-sobre-3); pointer-events: none; transition: color var(--mov-1) var(--curva); }
.caja:focus-within .adorno { color: var(--lg-marca-alto); }
.caja input::placeholder { color: rgba(255, 255, 255, .50); opacity: 1; }
.caja input:hover { border-color: rgba(255, 255, 255, .34); }
.caja input:focus { outline: none; border-color: var(--lg-marca-vivo); background: var(--lg-campo-2); box-shadow: var(--lg-foco); }
.caja input[aria-invalid="true"] { border-color: var(--lg-mal); }
.caja input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(255, 180, 173, .25); }
.caja input:read-only { opacity: .7; cursor: progress; }
.caja input:has(+ .ver) { padding-right: var(--control-lg); }
.caja input:-webkit-autofill { -webkit-text-fill-color: var(--lg-sobre); box-shadow: 0 0 0 100px var(--lg-autofill) inset; caret-color: #fff; }
.caja input:-webkit-autofill:focus { box-shadow: 0 0 0 100px var(--lg-autofill-2) inset, var(--lg-foco); }

.ver { position: absolute; top: 50%; right: var(--e-2); translate: 0 -50%;
  width: var(--toque); height: var(--toque); display: grid; place-items: center;
  background: none; border: 0; border-radius: var(--r-sm); color: var(--lg-sobre-3); cursor: pointer;
  transition: color var(--mov-1) var(--curva), background-color var(--mov-1) var(--curva); }
.ver:hover { color: var(--lg-sobre); background: var(--lg-campo-2); }
.ver[aria-pressed="true"] { color: var(--lg-marca-alto); }
.ver svg { width: var(--e5); height: var(--e5); }

.campo-error, .campo-pista { font-size: var(--t-sm); }
.campo-error { color: var(--lg-mal); font-weight: var(--p-medio); animation: aparece var(--mov-2) var(--curva) both; }
.campo-pista { color: var(--lg-sobre-3); transition: color var(--mov-2) var(--curva); }
.campo-pista.cumple { color: var(--lg-bien); }

/* ---- recordar sesión y recuperación, en una línea */
.opciones { display: flex; align-items: center; justify-content: space-between; gap: var(--e2); flex-wrap: wrap;
  margin: calc(var(--e2) * -1) 0; }
.casilla { position: relative; display: inline-flex; align-items: center; gap: var(--e2); min-height: var(--toque);
  font-size: var(--t-md); color: var(--lg-sobre-2); cursor: pointer; user-select: none; }
.casilla input { position: absolute; opacity: 0; width: var(--toque); height: var(--toque); left: calc(var(--e3) * -1); margin: 0; cursor: pointer; }
.marca-casilla { width: var(--e5); height: var(--e5); flex: none; border-radius: var(--r-xs); border: 1.5px solid var(--lg-campo-borde);
  background: var(--lg-campo); display: grid; place-items: center;
  transition: background-color var(--mov-1) var(--curva), border-color var(--mov-1) var(--curva); }
.marca-casilla::after { content: ""; width: 10px; height: 6px; margin-top: -2px; border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  rotate: -45deg; scale: 0; transition: scale var(--mov-1) var(--curva); }
.casilla input:checked + .marca-casilla { background: var(--lg-marca); border-color: var(--lg-marca); }
.casilla input:checked + .marca-casilla::after { scale: 1; }
.casilla input:focus-visible + .marca-casilla { outline: var(--foco-ancho) solid var(--lg-marca-vivo); outline-offset: var(--foco-hueco); }

/* ---- botones */
.boton { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--e2);
  width: 100%; min-height: var(--control-lg); margin-top: var(--e1); padding: 0 var(--e5);
  font-size: var(--t-lg); font-weight: var(--p-semi); color: #fff;
  background: linear-gradient(180deg, var(--lg-marca-vivo) 0%, var(--lg-marca) 100%);
  border: 1px solid var(--lg-marca-vivo); border-radius: var(--r-md);
  box-shadow: 0 10px 28px var(--lg-sombra-boton); cursor: pointer; text-decoration: none;
  transition: filter var(--mov-1) var(--curva), box-shadow var(--mov-1) var(--curva), scale var(--mov-1) var(--curva); }
.boton:hover { filter: brightness(1.07); }
.boton:active { scale: .985; box-shadow: none; }
.boton .flecha { width: var(--icono); height: var(--icono); transition: translate var(--mov-2) var(--curva); }
.boton:hover .flecha { translate: var(--e-2) 0; }
.boton[aria-busy="true"] { cursor: progress; filter: saturate(.8) brightness(.94); scale: 1; }
.boton .giro, .boton[aria-busy="true"] .flecha { display: none; }
.boton[aria-busy="true"] .giro { display: block; }
.boton-secundario { color: var(--lg-sobre); background: var(--lg-campo); border-color: var(--lg-campo-borde); box-shadow: none; }
.boton-secundario:hover { background: var(--lg-campo-2); filter: none; }

.enlace { display: inline-flex; align-items: center; justify-content: center; gap: var(--e2); align-self: center;
  min-height: var(--toque); padding: 0 var(--e2); background: none; border: 0; border-radius: var(--r-sm);
  font-size: var(--t-md); font-weight: var(--p-semi); color: var(--lg-marca-alto); cursor: pointer;
  text-decoration: none; text-underline-offset: 3px; text-align: center;
  transition: color var(--mov-1) var(--curva); }
.enlace:hover { color: #fff; text-decoration: underline; }
.enlace[disabled] { color: var(--lg-sobre-3); cursor: default; text-decoration: none; }
.enlace svg { width: var(--icono); height: var(--icono); flex: none; }
.opciones .enlace { padding: 0; margin-left: auto; }

/* ---- aviso general */
.aviso { display: flex; align-items: flex-start; gap: var(--e-10); padding: var(--e3) var(--e4);
  border-radius: var(--r-md); border: 1px solid var(--lg-mal-borde); background: var(--lg-mal-fondo); color: var(--lg-mal);
  font-size: var(--t-md); animation: aparece var(--mov-2) var(--curva) both; }
.aviso svg { width: var(--e5); height: var(--e5); flex: none; margin-top: 1px; color: currentColor; }
.aviso.ok { border-color: var(--lg-bien-borde); background: var(--lg-bien-fondo); color: var(--lg-bien); }
.aviso.info { border-color: rgba(var(--lg-tinte-rgb), .55); background: rgba(var(--lg-tinte-rgb), .22); color: var(--lg-marca-alto); }
.aviso.agita { animation: agita var(--mov-3) var(--curva); }

/* ---- indicador de carga */
.giro { width: var(--icono); height: var(--icono); border-radius: var(--r-full); flex: none;
  border: 2px solid rgba(255, 255, 255, .40); border-top-color: #fff; animation: gira .7s linear infinite; }
.giro-grande { width: var(--e10); height: var(--e10); border-width: 3px; border-color: rgba(255, 255, 255, .25); border-top-color: var(--lg-marca-vivo); }

/* ===================================================== tránsito tras iniciar sesión */
.transito { position: fixed; inset: 0; z-index: var(--z-transito); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--e4); background: rgba(13, 7, 34, .86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  color: var(--lg-sobre); font-size: var(--t-lg); font-weight: var(--p-semi); animation: funde var(--mov-3) var(--curva) both; }

@keyframes gira { to { rotate: 360deg; } }
@keyframes aparece { from { opacity: 0; translate: 0 var(--e-6); } to { opacity: 1; translate: 0 0; } }
@keyframes sube { from { opacity: 0; translate: 0 var(--e4); } to { opacity: 1; translate: 0 0; } }
@keyframes funde { from { opacity: 0; } to { opacity: 1; } }
@keyframes brota { from { opacity: 0; scale: .9; } to { opacity: 1; scale: 1; } }
@keyframes agita { 0%, 100% { translate: 0 0; } 25% { translate: calc(var(--e1) * -1) 0; } 75% { translate: var(--e1) 0; } }
@keyframes deriva { from { translate: -3% -2%; } to { translate: 3% 2%; } }
@keyframes corre { from { translate: -110% 0; } to { translate: 260% 0; } }
@keyframes flota { from { translate: 0 -6px; } to { translate: 0 6px; } }

/* El formulario nunca se mueve: solo entra. El panel sí flota, y con movimiento
   reducido también se queda quieto. */
@media (prefers-reduced-motion: reduce) {
  .ficha, .burbuja, .apertura-luz, .apertura-marca, .vista, .encabezado h1, .encabezado p, .aviso, .campo-error,
  .panel-luz, .ficha-cifra, .ficha-nodo, .barra-relleno, .lg-linea.viva { animation: none !important; }
  /* Sin animación, cada pieza se queda en su estado legible, no a medio camino. */
  .ficha { opacity: 1 !important; translate: 0 !important; }
  .ficha-cifra, .ficha-nodo { opacity: 1 !important; translate: 0 !important; scale: 1 !important; }
  .barra-relleno { scale: 1 1 !important; }
  .lg-linea.viva { stroke-dashoffset: 0 !important; opacity: 1 !important; }
  .burbuja { translate: 0 0; }
  .giro, .apertura-barra::after { animation-duration: 2.4s !important; animation-iteration-count: infinite !important; }
}

/* ===================================================== pantallas muy estrechas (≤ 359 px)
   Se quitan las tarjetas decorativas: mandan el formulario y su legibilidad. */
@media (max-width: 359px) {
  .hoja { padding-left: var(--e5); padding-right: var(--e5); }
  .tablero { display: none; }
  .casilla, .opciones .enlace { font-size: var(--t-sm); }
  .encabezado h1 { font-size: var(--t-2xl); }
  .encabezado p { font-size: var(--t-md); }
}

/* ===================================================== pantallas bajas (teclado abierto, apaisado) */
@media (max-height: 700px) and (max-width: 959px) {
  .hoja { padding-top: var(--e6); }
  .tarjeta { gap: var(--e4); }
  .encabezado h1 { margin-top: var(--e5); }
  .tablero { opacity: .32; }
}

/* ===================================================== tablet 600–959: el mismo fondo, más aire */
@media (min-width: 600px) and (max-width: 959px) {
  .hoja { padding: var(--e12) var(--e8) var(--e8); }
  .tarjeta { max-width: 440px; }
  .tablero { width: min(520px, 76%); opacity: .55; }
}

/* ===================================================== ≥ 960: pantalla partida (composición de escritorio)
   Izquierda clara con el formulario; derecha, el panel de analítica. */
@media (min-width: 960px) {
  body { background: var(--lg-claro); color: var(--tinta); }
  .escena { display: grid; grid-template-columns: minmax(440px, 1fr) 1fr; align-items: stretch; }

  /* --- el panel deja de ser el fondo y pasa a ser la columna derecha */
  .panel { position: relative; inset: auto; grid-column: 2; z-index: 0; border-radius: 0; }
  .tablero { top: 50%; bottom: auto; left: 50%; translate: -50% -50%; width: min(560px, 82%); opacity: 1; }

  /* --- formulario en claro */
  .hoja { grid-column: 1; grid-row: 1; justify-content: center; background: var(--lg-claro);
    padding: var(--e10) clamp(var(--e10), 7vw, 88px); }
  .tarjeta { margin: 0 auto; max-width: 384px; }

  .sello { color: var(--tinta); }
  .sello .logo { box-shadow: var(--sombra-2); }
  .encabezado h1 { margin-top: var(--e8); color: var(--tinta); }
  .encabezado p { color: var(--tinta-2); }
  .encabezado p strong { color: var(--tinta); }

  .nota { color: var(--tinta-2); }
  .nota code { background: var(--suave); }
  .emblema { background: rgba(var(--lg-tinte-rgb), .10); color: var(--lg-marca-hondo); border-color: rgba(var(--lg-tinte-rgb), .28); }

  .campo label { color: var(--tinta); }
  .caja input { color: var(--tinta); background: #fff; border-color: var(--borde-fuerte); box-shadow: var(--sombra); }
  .caja input::placeholder { color: var(--tinta-3); }
  .caja input:hover { border-color: var(--borde-control); }
  .caja input:focus { border-color: var(--lg-marca); background: #fff; box-shadow: var(--lg-foco); }
  .caja input[aria-invalid="true"] { border-color: var(--mal); }
  .caja input[aria-invalid="true"]:focus { box-shadow: var(--foco-error); }
  .caja input:read-only { background: var(--suave); color: var(--tinta-2); opacity: 1; }
  .caja .adorno { color: var(--tinta-3); }
  .caja:focus-within .adorno { color: var(--lg-marca); }
  .caja input:-webkit-autofill { -webkit-text-fill-color: var(--tinta); box-shadow: 0 0 0 100px var(--lg-autofill-claro) inset; caret-color: var(--tinta); }
  .caja input:-webkit-autofill:focus { box-shadow: 0 0 0 100px var(--lg-autofill-claro) inset, var(--lg-foco); }

  .ver { color: var(--tinta-3); }
  .ver:hover { color: var(--tinta); background: var(--suave); }
  .ver[aria-pressed="true"] { color: var(--lg-marca); }

  .campo-error { color: var(--mal); }
  .campo-pista { color: var(--tinta-3); }
  .campo-pista.cumple { color: var(--bien); }

  .casilla { color: var(--tinta-2); }
  .marca-casilla { background: #fff; border-color: var(--borde-control); }
  .casilla input:checked + .marca-casilla { background: var(--lg-marca); border-color: var(--lg-marca); }
  .casilla input:focus-visible + .marca-casilla { outline-color: var(--lg-marca); }

  .boton { background: linear-gradient(180deg, var(--lg-marca-vivo) 0%, var(--lg-marca-hondo) 100%);
    border-color: var(--lg-marca-hondo); box-shadow: 0 10px 24px rgba(var(--lg-tinte-rgb), .32); }
  .boton-secundario { color: var(--tinta); background: #fff; border-color: var(--borde-fuerte); box-shadow: var(--sombra); }
  .boton-secundario:hover { background: var(--suave); }

  .enlace { color: var(--lg-marca-hondo); }
  .enlace:hover { color: var(--lg-marca); }
  .enlace[disabled] { color: var(--tinta-3); }

  .aviso { border-color: var(--mal-borde); background: var(--mal-suave); color: var(--mal-tinta); }
  .aviso.ok { border-color: var(--bien-borde); background: var(--bien-suave); color: var(--bien); }
  .aviso.info { border-color: rgba(var(--lg-tinte-rgb), .30); background: rgba(var(--lg-tinte-rgb), .08); color: var(--lg-marca-hondo); }

  .giro-grande { border-color: rgba(var(--lg-tinte-rgb), .25); border-top-color: var(--lg-marca); }
  :focus-visible { outline-color: var(--lg-marca); }
}

/* Escritorio con poca altura: el formulario manda y el tablero se encoge. */
@media (min-width: 960px) and (max-height: 760px) {
  .hoja { padding-top: var(--e8); padding-bottom: var(--e8); }
  .encabezado h1 { margin-top: var(--e5); font-size: var(--t-2xl); }
  .tablero { width: min(440px, 80%); }
}

/* Móvil y tablet: el formulario se centra verticalmente. Sin pie, el reparto es
   simétrico y aguanta pantallas altas y bajas. */
@media (max-width: 959px) {
  .hoja { justify-content: center; }
  .hoja .tarjeta { margin-block: auto; }
}
/* Muy estrecho: «Recordar sesión» y el enlace se apilan alineados a la izquierda. */
@media (max-width: 359px) {
  .opciones { flex-direction: column; align-items: flex-start; gap: 0; }
  .opciones .enlace { margin-left: 0; align-self: flex-start; justify-content: flex-start; }
}

/* Pantallas anchas: la composición no se estira sin límite. */
@media (min-width: 1600px) {
  .tarjeta { max-width: 420px; }
  .tablero { width: min(600px, 68%); }
}
