/* Cuenta Blio (Blio ID) — diseño de las pantallas de acceso (25-11-2026).
   Base común de la familia -blio (TOKENS_FAMILIA_BLIO v2: Inter autoalojada, neutros, estados, escala 12-30, controles
   44 px) con una excepción pedida por el titular para el acceso: panel de marca con malla animada y tarjeta con
   profundidad. Color: el de Blio ID o, si se viene de una app, el suyo (--marca-app, desde el servidor).
   Todo autoalojado (CSP 'self'). Movimiento: solo transform y opacidad; nada se mueve con prefers-reduced-motion. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fuentes/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fuentes/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light dark;
  --fuente: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  --fondo: #ffffff; --superficie: #ffffff; --superficie-2: #f7f8fa;
  --borde: #eceef1; --borde-fuerte: #d9dde3;
  --texto: #121826; --texto-suave: #545e72;
  --error: #842029; --error-fondo: #fdf2f3; --error-barra: #dc3545;
  --ok: #0f5132; --ok-barra: #198754; --info-barra: #0dcaf0;
  /* marca: la de Blio ID (azul de la familia) o la de la app de origen */
  --m: var(--marca-app, #3046c5);
  --marca: var(--m);
  --marca-hover: color-mix(in srgb, var(--m) 80%, #000);
  --marca-tinta: #ffffff;
  --anillo: color-mix(in srgb, var(--m) 24%, transparent);
  --sombra-tarjeta: 0 1px 2px rgba(18, 24, 38, .04), 0 8px 24px -6px rgba(18, 24, 38, .10),
    0 32px 64px -24px rgba(18, 24, 38, .22);
  --curva: cubic-bezier(0.23, 1, 0.32, 1);
  --r-control: 10px; --r-tarjeta: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0e121b; --superficie: #161c28; --superficie-2: #1b2230;
    --borde: #283246; --borde-fuerte: #3a4554;
    --texto: #e6e9ee; --texto-suave: #9aa4b2;
    --error: #ea868f; --error-fondo: #2a1418; --error-barra: #ea868f;
    --ok: #75b798; --ok-barra: #75b798;
    --marca: color-mix(in srgb, var(--m) 42%, #fff);
    --marca-hover: color-mix(in srgb, var(--m) 28%, #fff);
    --marca-tinta: #0e121b;
    --anillo: color-mix(in srgb, var(--marca) 30%, transparent);
    --sombra-tarjeta: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 12px 32px -8px rgba(0, 0, 0, .5),
      0 40px 80px -24px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
html { font-size: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--fondo); color: var(--texto);
  font: 400 15px/1.5 var(--fuente); }
a { color: var(--marca); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--marca-hover); }
:focus-visible { outline: 2px solid var(--marca); outline-offset: 2px; border-radius: 4px; }
.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- armazón: panel de marca + columna del formulario --------------------------------------------------------- */
.lienzo { display: grid; min-height: 100vh; min-height: 100dvh; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .disp-partida .lienzo { grid-template-columns: minmax(420px, 46%) minmax(0, 1fr); } }

.escena { position: relative; overflow: hidden; isolation: isolate; color: #e9ecf5; background: #0b1020; }
.malla, .malla::before, .malla::after { position: absolute; pointer-events: none; }
.malla { inset: 0; z-index: -1;
  background:
    radial-gradient(60% 50% at 15% 10%, color-mix(in srgb, var(--m) 70%, transparent) 0%, transparent 70%),
    radial-gradient(50% 45% at 90% 85%, rgba(98, 80, 214, .55) 0%, transparent 70%),
    radial-gradient(40% 40% at 80% 15%, rgba(27, 175, 122, .28) 0%, transparent 70%),
    linear-gradient(160deg, #0d1430 0%, #0b1020 60%, #070a14 100%); }
.malla::before, .malla::after { content: ""; width: 70%; aspect-ratio: 1; border-radius: 50%; filter: blur(60px);
  opacity: .55; will-change: transform; }
.malla::before { left: -15%; top: 35%; background: radial-gradient(closest-side, color-mix(in srgb, var(--m) 85%, #fff 0%), transparent);
  animation: deriva-a 22s ease-in-out infinite alternate; }
.malla::after { right: -20%; top: -10%; background: radial-gradient(closest-side, rgba(120, 100, 240, .9), transparent);
  animation: deriva-b 26s ease-in-out infinite alternate; }
/* textura sutil de puntos sobre la malla */
.escena::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .35;
  background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px); background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%); mask-image: linear-gradient(180deg, #000 0%, transparent 85%); }
@keyframes deriva-a { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(18%, -12%, 0) scale(1.15); } }
@keyframes deriva-b { from { transform: translate3d(0, 0, 0) scale(1.05); } to { transform: translate3d(-14%, 16%, 0) scale(.95); } }

.escena-contenido { position: relative; display: flex; flex-direction: column; gap: 28px; height: 100%;
  padding: 40px clamp(32px, 5vw, 64px); }
.logo-blio { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 650;
  font-size: 17px; letter-spacing: -.01em; }
.logo-blio:hover { color: #fff; }
.logo-blio svg { width: 32px; height: 32px; flex: none; filter: drop-shadow(0 4px 12px rgba(48, 70, 197, .45)); }
.desde { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; padding: 6px 14px 6px 6px;
  border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); font-size: 13px; color: #d7dcea; }
.desde img { width: 26px; height: 26px; border-radius: 7px; background: #fff; padding: 2px; }
.desde strong { color: #fff; font-weight: 600; }
.lema { margin: auto 0 0; font-size: clamp(30px, 3.2vw, 42px); line-height: 1.12; font-weight: 700; letter-spacing: -.025em;
  text-wrap: balance; max-width: 15ch; color: #fff; }
.lema span { background: linear-gradient(90deg, color-mix(in srgb, var(--m) 35%, #fff), #c9c2ff);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.lema-sub { margin: -12px 0 0; color: #b9c0d4; font-size: 15px; max-width: 40ch; text-wrap: pretty; }
.apps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.apps li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 13px;
  font-weight: 500; color: #e3e7f2; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .10);
  white-space: nowrap; }
.apps li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--punto); box-shadow: 0 0 0 3px color-mix(in srgb, var(--punto) 25%, transparent); }
/* color de marca de cada app (variante para fondo oscuro, TOKENS v2 §2) */
.p-contablio { --punto: #9abef3; } .p-nomiblio { --punto: #bcb5f8; } .p-markeblio { --punto: #eba0d3; }
.p-vendiblio { --punto: #f8c297; } .p-legablio { --punto: #f0a3b0; } .p-stablio { --punto: #9cd4ba; }
.seguro { display: flex; align-items: center; gap: 8px; margin: 0; color: #aeb6cb; font-size: 13px; }
.seguro svg { width: 16px; height: 16px; flex: none; }

/* móvil y tableta: el panel de marca se queda en una banda arriba y la tarjeta se monta encima */
@media (max-width: 959.98px) {
  .escena { min-height: 196px; }
  .escena-contenido { gap: 14px; padding: 20px 16px 72px; }
  .lema, .lema-sub, .apps, .seguro { display: none; }
  .desde { font-size: 12.5px; }
  .principal { margin-top: -56px; }
}

.principal { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: 24px 16px 32px; }
@media (min-width: 960px) {
  .principal { padding: 48px 32px;
    background: radial-gradient(80% 60% at 50% 0%, color-mix(in srgb, var(--m) 6%, transparent), transparent 70%); }
}

/* ---- tarjeta -------------------------------------------------------------------------------------------------- */
.tarjeta { width: 100%; max-width: 440px; background: var(--superficie); border: 1px solid var(--borde);
  border-radius: var(--r-tarjeta); box-shadow: var(--sombra-tarjeta); padding: 32px; }
@media (max-width: 480px) { .tarjeta { padding: 24px 20px; border-radius: 16px; } }
@media (prefers-reduced-motion: no-preference) {
  .tarjeta { animation: aparecer 520ms var(--curva) both; }
  .tarjeta.con-error { animation: aparecer 520ms var(--curva) both, sacudir 380ms cubic-bezier(.36, .07, .19, .97) 120ms both; }
}
@media (prefers-reduced-motion: reduce) {
  .malla::before, .malla::after { animation: none; }
  .tarjeta { animation: aparecer-quieto 150ms ease-out both; }
}
@keyframes aparecer { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes aparecer-quieto { from { opacity: 0; } to { opacity: 1; } }
@keyframes sacudir { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

h1 { margin: 0 0 6px; font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
h2 { margin: 0 0 8px; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
p.sub { margin: 0 0 24px; color: var(--texto-suave); text-wrap: pretty; }
.cabecera-tarjeta { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.cabecera-tarjeta img { width: 36px; height: 36px; border-radius: 10px; }
.cabecera-tarjeta .marca-nombre { font-size: 13px; color: var(--texto-suave); font-weight: 500; }

/* ---- formularios ---------------------------------------------------------------------------------------------- */
form { margin: 0; }
label { display: block; margin: 16px 0 6px; font-size: 13px; font-weight: 500; color: var(--texto); }
label:has(input[type=checkbox]) { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--texto-suave); line-height: 1.45; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input:not([type]) {
  display: block; width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--borde-fuerte);
  border-radius: var(--r-control); background: var(--superficie); color: var(--texto); font: inherit; font-size: 15px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease; }
input::placeholder { color: color-mix(in srgb, var(--texto-suave) 80%, transparent); }
@media (hover: hover) { input:hover:not(:focus) { border-color: color-mix(in srgb, var(--borde-fuerte) 60%, var(--texto-suave)); } }
input:focus { outline: none; border-color: var(--marca); box-shadow: 0 0 0 4px var(--anillo); }
input[aria-invalid=true], .con-error input[type=password] { border-color: var(--error-barra); }
input[type=checkbox] { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--marca); flex: none; }
input[name=codigo][inputmode=numeric] { height: 56px; text-align: center; font-size: 24px; font-weight: 600; letter-spacing: .32em;
  font-variant-numeric: tabular-nums; padding-left: calc(14px + .32em); }

.campo-clave { position: relative; }
.campo-clave input { padding-right: 48px; }
.ver-clave { position: absolute; top: 2px; right: 2px; width: 40px; height: 40px; margin: 0; padding: 0; border: 0;
  border-radius: 8px; background: transparent; color: var(--texto-suave); display: grid; place-items: center; cursor: pointer;
  box-shadow: none; transition: color 150ms ease, background-color 150ms ease; }
.ver-clave:active { transform: none; }
.ver-clave:hover { color: var(--texto); background: var(--superficie-2); }
.ver-clave svg { width: 18px; height: 18px; }
.ver-clave .ojo-tapado { display: none; }
.ver-clave[aria-pressed=true] .ojo-abierto { display: none; }
.ver-clave[aria-pressed=true] .ojo-tapado { display: block; }

button, .boton { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 44px; margin-top: 20px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--r-control);
  background: var(--marca); color: var(--marca-tinta); font: inherit; font-size: 15px; font-weight: 600; letter-spacing: -.005em;
  cursor: pointer; text-align: center; text-decoration: none; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 2px rgba(18, 24, 38, .12), inset 0 1px 0 rgba(255, 255, 255, .14);
  transition: transform 160ms var(--curva), background-color 150ms ease, box-shadow 150ms ease, color 150ms ease; }
button:hover, .boton:hover { background: var(--marca-hover); color: var(--marca-tinta); }
button:active, .boton:active { transform: scale(.98); }
button.secundario, .boton.secundario { background: var(--superficie); color: var(--texto); border-color: var(--borde-fuerte); box-shadow: none; }
button.secundario:hover, .boton.secundario:hover { background: var(--superficie-2); color: var(--texto); }
button[disabled] { cursor: progress; }
button .giro { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor;
  border-right-color: transparent; animation: girar 700ms linear infinite; }
button[aria-busy=true] .giro { display: inline-block; }
button[aria-busy=true] { pointer-events: none; }
@keyframes girar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { button:active, .boton:active { transform: none; } button .giro { animation-duration: 1.6s; } }

.separador { display: flex; align-items: center; gap: 12px; margin: 22px 0 2px; color: var(--texto-suave); font-size: 12px; }
.separador::before, .separador::after { content: ""; height: 1px; flex: 1; background: var(--borde); }

/* errores y avisos: blancos con barra de color (TOKENS v2) */
.errorlist, .errores { margin: 8px 0 0; padding: 0; list-style: none; color: var(--error); font-size: 13px; }
.errorlist.nonfield, .errores, form > .errorlist:first-child { margin: 0 0 4px; padding: 10px 12px; border-radius: var(--r-control);
  background: var(--error-fondo); border-left: 3px solid var(--error-barra); }
.mensajes { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 8px; }
.mensajes li { padding: 10px 12px; border-radius: var(--r-control); background: var(--superficie-2); border-left: 3px solid var(--info-barra);
  font-size: 14px; }
.mensajes li.error { border-left-color: var(--error-barra); background: var(--error-fondo); color: var(--error); }
.mensajes li.success { border-left-color: var(--ok-barra); }

.ayuda { color: var(--texto-suave); font-size: 13px; margin-top: 6px; text-wrap: pretty; }
.pie { margin: 22px 0 0; color: var(--texto-suave); font-size: 14px; text-align: center; text-wrap: balance; }
.pie a { font-weight: 500; text-decoration: none; }
.pie a:hover { text-decoration: underline; }
.pie-pagina { color: var(--texto-suave); font-size: 12px; text-align: center; }
.pie-pagina a { color: inherit; }
code, .codigo { font-family: var(--mono); word-break: break-all; }
.codigos-lista { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 16px; margin: 0; list-style: none;
  border-radius: var(--r-control); background: var(--superficie-2); border: 1px dashed var(--borde-fuerte);
  font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---- panel /cuenta/ (una columna ancha, cabecera de marca fina) ------------------------------------------------ */
.disp-panel .escena { min-height: 0; }
.disp-panel .escena-contenido { flex-direction: row; align-items: center; justify-content: space-between; padding: 16px clamp(16px, 4vw, 40px) 88px; }
.disp-panel .lema, .disp-panel .lema-sub, .disp-panel .apps, .disp-panel .seguro { display: none; }
.disp-panel .principal { margin-top: -72px; justify-content: flex-start; }
.disp-panel .tarjeta { max-width: 760px; }
.disp-panel .tarjeta form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.disp-panel .tarjeta form input[type=password] { flex: 1 1 200px; width: auto; height: 40px; }
.disp-panel .tarjeta form button, .disp-panel .tarjeta td .boton { width: auto; height: 40px; margin: 0; font-size: 14px; }
section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--borde); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td { padding: 12px 8px 12px 0; border-top: 1px solid var(--borde); vertical-align: top; }
tr:first-child td { border-top: 0; }
td:first-child { font-weight: 500; }
@media (max-width: 600px) { table, tbody, tr, td { display: block; } td { padding: 6px 0; } tr { padding: 10px 0; border-top: 1px solid var(--borde); } tr:first-child { border-top: 0; } td { border: 0; } }
