/* Login terminal · Marca Cristian Estrada · v1.4 (12 nov 2026)
   Norma «Login terminal» del sistema de diseño. Va después de interfaz/base/base.css (usa sus tokens y fuentes).
   Excepciones de marca que solo valen en esta pantalla: Cascadia Mono en todo el texto y «[ ver ]» en lugar del ojito.
   El tamaño de letra lo escala el menú de accesibilidad (zoom del cuerpo): aquí van medidas fijas. */
.ce-login { --cel-t: 15px; --cel-error: #b42318; width: 100%; max-width: 760px; margin: 0 auto; padding: 4px 0 24px; font: 400 var(--cel-t)/1.75 var(--fuente-mono); color: var(--ink); cursor: text; text-align: left; }
html[data-tema="oscuro"] .ce-login { --cel-error: #ffbdb6; }
.ce-login p { margin: 0; overflow-wrap: anywhere; }
.ce-login ::selection { background: var(--orange); color: #26302f; }
.ce-login [hidden] { display: none !important; }
.ce-login .cel-app { margin: 0; font: 400 calc(var(--cel-t) * 2)/1.25 var(--fuente-mono); letter-spacing: .06em; color: var(--teal-deep); }
.ce-login .cel-dir { margin-bottom: calc(var(--cel-t) * 1.1); }
.cel-tenue { color: var(--muted); }
.cel-quien { color: var(--teal-deep); } .cel-ruta, .cel-app-nombre, .cel-aviso { color: var(--orange-text); }
.cel-ok { color: var(--teal-deep); } .cel-mal { color: var(--cel-error); }
.cel-hueco { height: calc(var(--cel-t) * .9); }
.ce-login p.cel-t { min-height: 1.75em; }
.cel-solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Escritura letra a letra: naranja mientras se escribe, luego su color */
.cel-tecla { transition: color .45s ease; }
.cel-escribiendo .cel-tecla { color: var(--orange-text); transition: none; }

/* Cursor bajo */
.cel-cursor { display: inline-block; width: 1ch; height: .13em; min-height: 2px; background: var(--orange); transform: translateY(.16em); opacity: .45; }
.cel-cursor--vivo { opacity: 1; }
.cel-entrada:focus-within .cel-cursor { opacity: 1; animation: cel-parpadeo 1.1s steps(1, end) infinite; }
@keyframes cel-parpadeo { 50% { opacity: 0; } }
/* En espera: parpadea al final de la última línea mientras la pantalla aguarda la huella o el teclado,
   mientras se comprueba la contraseña («Comprobando…») y tras «Sesión abierta…» si la aplicación aún carga */
.ce-login[data-pantalla="huella"]:not(.cel-tecleando) .cel-historial > p:last-child::after,
.ce-login[data-pantalla="espera"]:not(.cel-tecleando) .cel-historial > p:last-child::after,
.ce-login[data-pantalla="fin"]:not(.cel-tecleando) .cel-historial > p:last-child::after,
.ce-login[data-pantalla="cerrada"]:not(.cel-tecleando) .cel-historial > p:last-child::after { content: ""; display: inline-block; width: 1ch; height: .13em; min-height: 2px; margin-left: .5ch; background: var(--orange); transform: translateY(.16em); animation: cel-parpadeo 1.1s steps(1, end) infinite; }

/* Huella: sin botón, solo la huella, como en los teléfonos */
.cel-sensor { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 0 22px; }
.cel-huella { all: unset; box-sizing: border-box; display: grid; place-items: center; width: 144px; height: 144px; border-radius: 50%; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.cel-huella svg { width: 112px; height: 112px; display: block; overflow: visible; fill: none; stroke-width: 2; stroke-linecap: round; }
.cel-huella .cel-base { stroke: var(--teal-deep); opacity: .85; transition: stroke .2s, opacity .2s; animation: cel-respira 2.8s ease-in-out infinite; }
.cel-huella .cel-tinta { stroke: var(--orange); opacity: 0; }
.cel-huella .cel-tinta path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.cel-huella:hover .cel-base { opacity: 1; }
.cel-huella:active svg { transform: scale(.96); }
.cel-huella:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; animation: ce-foco .2s ease-out; }
@keyframes cel-respira { 50% { opacity: .5; } }
.cel-huella.cel-leyendo { cursor: progress; }
.cel-huella.cel-leyendo .cel-base { animation: none; opacity: .35; }
.cel-huella.cel-leyendo .cel-tinta, .cel-huella.cel-lista .cel-tinta { opacity: 1; }
.cel-huella.cel-leyendo .cel-tinta path { animation: cel-leer 1s cubic-bezier(.4,.1,.3,1) forwards; animation-delay: var(--d, 0s); }
@keyframes cel-leer { to { stroke-dashoffset: 0; } }
.cel-huella.cel-lista { cursor: default; }
.cel-huella.cel-lista .cel-base { animation: none; opacity: 0; }
.cel-huella.cel-lista .cel-tinta { stroke: var(--teal-deep); transition: stroke .3s; }
.cel-huella.cel-lista .cel-tinta path { stroke-dashoffset: 0; }
.cel-huella.cel-fallo .cel-base { animation: none; stroke: var(--cel-error); opacity: 1; }
.cel-huella.cel-fallo svg { animation: cel-no .35s; }
@keyframes cel-no { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.cel-sensor__texto { color: var(--muted); min-height: 1.75em; }

/* Línea de escritura: campo real invisible encima; debajo, el texto y el cursor bajo */
.cel-entrada { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 1ch; margin: 0; }
.cel-signo { color: var(--teal-deep); font: inherit; }
.cel-entrada:focus-within .cel-signo { color: var(--orange-text); }
.cel-zona { position: relative; flex: 1; min-width: 12ch; white-space: pre; overflow: hidden; }
.ce-login .cel-zona input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; font: inherit; letter-spacing: inherit;
  color: transparent; -webkit-text-fill-color: transparent; caret-color: transparent; outline: none !important; animation: none !important; box-shadow: none; }
.cel-zona input::selection { background: transparent; }
.cel-activo > * { transition: opacity .2s; }
.cel-activo.cel-pendiente > *, .cel-activo.cel-entrando > :not(.cel-entrada) { opacity: 0; transition: none; }
.cel-activo.cel-pendiente .cel-cursor, .cel-activo.cel-pendiente .cel-signo { visibility: hidden; }

/* Acciones como comandos */
.cel-cmds { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 2ch; }
.cel-cmd { all: unset; cursor: pointer; color: var(--teal-deep); border-radius: 4px; padding: 6px 0; }
.cel-cmd::before { content: "[ "; color: var(--muted); } .cel-cmd::after { content: " ]"; color: var(--muted); }
.cel-cmd:hover { color: var(--orange-text); }
.cel-cmd:active { color: var(--orange-text); background: var(--pulsado); }
.cel-cmd:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; animation: ce-foco .2s ease-out; }
.ce-login .cel-teclas { margin-top: calc(var(--cel-t) * .9); font-size: .87em; opacity: .8; }
@media (hover: none) { .ce-login .cel-teclas { display: none; } }

/* Movimiento reducido: nada parpadea ni se dibuja poco a poco */
html.ce-quieto .cel-huella .cel-base, html.ce-quieto .cel-cursor, html.ce-quieto .cel-historial > p:last-child::after { animation: none !important; }
html.ce-quieto .cel-huella.cel-leyendo .cel-tinta path { animation: none !important; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) {
  .cel-huella .cel-base, .cel-cursor, .cel-historial > p:last-child::after { animation: none !important; }
  .cel-huella.cel-leyendo .cel-tinta path { animation: none !important; stroke-dashoffset: 0; }
}
@media (max-width: 600px) { .ce-login { --cel-t: 16px; } }
