/* css/login.css — pantalla de acceso de SICIRE (estilo CARDATA: rojo CIRE en la marca, azul CIRE en las acciones)
   Página independiente: no usa la plantilla Davur. Mismos colores y letras que css/sicire.css. */

:root {
    --fondo: #141518;
    --panel: #1C1D22;
    --linea: #24262C;
    --linea-2: #2C2E35;
    --texto: #E4E5E9;
    --texto-2: #C9CBD1;
    --gris: #9A9DA6;
    --gris-2: #4A4D56;
    --rojo: #E1262C;
    --rojo-hover: #F03E44;
    --accion: #2F6FDB;
    --accion-hover: #4580E6;
    --peligro: #FF95A6;
    --peligro-bg: #36202A;
    --verde: #8FD0A8;
    --letra: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --titulo: 'Rajdhani', 'Barlow', system-ui, sans-serif;
    --curva: cubic-bezier(.2, .7, .2, 1);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.sl { background: var(--fondo); color: var(--texto-2); font-family: var(--letra); font-size: 14px; -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid var(--accion); outline-offset: 2px; }
::selection { background: var(--accion); color: #fff; }

.sl-pantalla { min-height: 100vh; min-height: 100dvh; display: flex; flex-wrap: wrap; }

/* ================= Marca ================= */
.sl-marca {
    flex: 999 1 520px; min-width: 0; position: relative; overflow: hidden;
    padding: 44px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
    border-right: 1px solid var(--linea);
}
.sl-marca-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; position: relative; z-index: 2; }
.sl-etiqueta { font-family: var(--titulo); font-weight: 600; font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--gris); }
.sl-estado { display: inline-flex; align-items: center; gap: 8px; letter-spacing: .16em; }
.sl-estado i { width: 6px; height: 6px; border-radius: 50%; background: var(--verde); box-shadow: 0 0 0 0 rgba(143, 208, 168, .5); animation: sl-latido 2.4s ease-out infinite; }

.sl-escena { position: relative; z-index: 1; flex: 1; min-height: 340px; display: grid; place-items: center start; }
/* globo de puntos con rutas: se dibuja en un canvas que cubre todo el panel (js/login-globo.js) */
.sl-globo { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0; animation: sl-aparece 1.4s .1s ease forwards; }
.sl-brillo {
    position: absolute; width: 300px; height: 300px; border-radius: 50%;
    background: radial-gradient(circle, rgba(225, 38, 44, .16) 0, rgba(225, 38, 44, 0) 65%);
    opacity: 0; animation: sl-aparece 1.6s .6s ease forwards;
}

/* ----- logo animado ----- */
.sl-logo { position: relative; width: clamp(120px, 13vw, 200px); height: auto; overflow: visible; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .45)); }
.sl-hex { fill: none; stroke: var(--rojo); stroke-width: 4.6; stroke-linejoin: round; stroke-dasharray: 116; stroke-dashoffset: 116; animation: sl-traza 1.3s .2s cubic-bezier(.65, 0, .35, 1) forwards; }
/* destello que recorre el contorno cada pocos segundos */
.sl-hex-luz { fill: none; stroke: #FFC2C4; stroke-width: 4.6; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 9 105; stroke-dashoffset: 114; opacity: 0; animation: sl-recorre 5s 2.2s linear infinite; }
.sl-cara { transform-box: view-box; opacity: 0; }
.sl-top { fill: #F1F2F4; animation: sl-cae 0.7s 0.95s var(--curva) forwards; }
.sl-izq { fill: #B9BCC4; animation: sl-izquierda 0.7s 0.8s var(--curva) forwards; }
.sl-der { fill: #7D818B; animation: sl-derecha 0.7s 0.8s var(--curva) forwards; }
.sl-cubo { animation: sl-flota 4.5s 2s ease-in-out infinite; transform-box: view-box; }

/* ----- título ----- */
.sl-titulo { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 10px; }
.sl-titulo h1 { margin: 0; font-family: var(--titulo); font-weight: 600; font-size: clamp(34px, 4vw, 54px); line-height: 1; letter-spacing: .32em; color: var(--texto); }
.sl-titulo h1 span, .sl-titulo h1 b { display: inline-block; font-weight: inherit; opacity: 0; transform: translateY(12px); animation: sl-sube .6s var(--curva) forwards; }
.sl-titulo h1 b { color: var(--rojo); }
.sl-titulo h1 :nth-child(1) { animation-delay: 1.30s; }
.sl-titulo h1 :nth-child(2) { animation-delay: 1.36s; }
.sl-titulo h1 :nth-child(3) { animation-delay: 1.42s; }
.sl-titulo h1 :nth-child(4) { animation-delay: 1.48s; }
.sl-titulo h1 :nth-child(5) { animation-delay: 1.54s; }
.sl-titulo h1 :nth-child(6) { animation-delay: 1.60s; }
.sl-titulo p { margin: 0; color: var(--gris); letter-spacing: .04em; opacity: 0; animation: sl-aparece .8s 1.75s ease forwards; }
.sl-linea { width: 56px; height: 1px; margin-top: 8px; background: var(--rojo); transform: scaleX(0); transform-origin: left; animation: sl-crece .8s 1.85s var(--curva) forwards; }

/* ================= Formulario ================= */
.sl-acceso { flex: 1 1 380px; padding: 48px; display: flex; align-items: center; justify-content: center; }
.sl-form { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 26px; opacity: 0; animation: sl-sube .8s .5s var(--curva) forwards; }
.sl-form h2 { margin: 0 0 10px; font-family: var(--titulo); font-weight: 600; font-size: 14px; letter-spacing: .22em; text-transform: uppercase; color: var(--texto); }
.sl-form h2::after { content: ''; display: block; width: 28px; height: 1px; background: var(--rojo); margin-top: 12px; }
.sl-ayuda { margin: 0; color: var(--gris); font-size: 13px; line-height: 1.5; }
.sl-movil-logo { display: none; align-items: center; gap: 10px; }

.sl-campo { display: flex; flex-direction: column; gap: 8px; }
.sl-campo label { font-size: 12px; color: var(--gris); letter-spacing: .02em; }
.sl-campo input {
    width: 100%; background: var(--panel); border: 1px solid var(--linea-2); border-radius: 2px; color: var(--texto);
    font: 400 14px var(--letra); padding: 12px 14px; transition: border-color .2s, box-shadow .2s, background .2s;
}
.sl-campo input::placeholder { color: #5C5F68; }
.sl-campo input:hover { border-color: #3A3D45; }
.sl-campo input:focus { outline: none; border-color: var(--accion); box-shadow: 0 0 0 3px rgba(47, 111, 219, .18); background: #1F2026; }
.sl-campo input:-webkit-autofill { -webkit-text-fill-color: var(--texto); -webkit-box-shadow: 0 0 0 40px var(--panel) inset; caret-color: var(--texto); }
.sl-clave { position: relative; }
.sl-clave input { padding-right: 46px; }
.sl-ver { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; background: none; border: 0; color: var(--gris); cursor: pointer; border-radius: 2px; }
.sl-ver:hover { color: var(--texto); }
.sl-ver .sl-tache { opacity: 0; transition: opacity .15s; }
.sl-ver[aria-pressed="true"] .sl-tache { opacity: 1; }

.sl-boton {
    position: relative; overflow: hidden; min-height: 46px; border: 0; border-radius: 2px; cursor: pointer;
    background: var(--accion); color: #fff; font: 700 13px var(--titulo); letter-spacing: .22em; text-transform: uppercase;
    transition: background .2s, transform .1s;
}
.sl-boton:hover { background: var(--accion-hover); }
.sl-boton:active { transform: translateY(1px); }
/* reflejo que cruza el botón al pasar el cursor */
.sl-boton::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-100%); }
.sl-boton:hover::before { transition: transform .7s var(--curva); transform: translateX(100%); }
.sl-boton.cargando { cursor: progress; background: var(--accion-hover); }
.sl-boton.cargando span::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: sl-puntos 1s steps(4) infinite; }

.sl-error { background: var(--peligro-bg); color: var(--peligro); border-left: 2px solid var(--peligro); padding: 10px 12px; font-size: 13px; animation: sl-sacude .4s ease; }
.sl-pie { margin: 6px 0 0; font-size: 11px; color: #6B6E77; letter-spacing: .04em; text-align: center; }

/* ================= Animaciones ================= */
@keyframes sl-aparece { to { opacity: 1; } }
@keyframes sl-sube { to { opacity: 1; transform: none; } }
@keyframes sl-crece { to { transform: scaleX(1); } }
@keyframes sl-traza { to { stroke-dashoffset: 0; } }
@keyframes sl-cae { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes sl-izquierda { from { opacity: 0; transform: translate(-6px, 4px); } to { opacity: 1; transform: none; } }
@keyframes sl-derecha { from { opacity: 0; transform: translate(6px, 4px); } to { opacity: 1; transform: none; } }
@keyframes sl-flota { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.4px); } }
@keyframes sl-recorre { 0% { stroke-dashoffset: 114; opacity: 0; } 6% { opacity: .6; } 40% { opacity: .6; } 50%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes sl-respira { 0%, 100% { opacity: 1; } 50% { opacity: .7; } }
@keyframes sl-latido { 0% { box-shadow: 0 0 0 0 rgba(143, 208, 168, .5); } 70%, 100% { box-shadow: 0 0 0 7px rgba(143, 208, 168, 0); } }
@keyframes sl-puntos { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
@keyframes sl-sacude { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ================= Pantallas chicas ================= */
@media (max-width: 920px) {
    .sl-marca { flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--linea); padding: 28px 24px; gap: 18px; }
    .sl-escena { min-height: 220px; }
    .sl-titulo h1 { font-size: 30px; }
}
@media (max-width: 600px) {
    .sl-marca { display: none; }
    .sl-acceso { padding: 32px 20px; align-items: flex-start; }
    .sl-form { padding-top: 6vh; }
    .sl-movil-logo { display: flex; }
}

/* Quien prefiere menos movimiento ve todo en su lugar, sin animar */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition: none !important; }
    .sl-hex-luz { display: none; }
}
