/* Accesos Gerencia — inicio de sesión (mismo lenguaje visual que el panel) */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'IBM Plex Sans', system-ui, 'Segoe UI', sans-serif; color: #0F1B33; background: #F4F6FA;
       display: grid; place-items: center; padding: 16px; -webkit-font-smoothing: antialiased; }
.login { width: min(920px, 100%); display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-radius: 20px;
         box-shadow: 0 1px 3px rgba(15,27,51,.06), 0 20px 50px rgba(15,27,51,.12); overflow: hidden; min-height: 520px; }
.login-marca { position: relative; color: #fff; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
               background: radial-gradient(120% 120% at 80% 20%, #1E4FB8 0%, #0E2A63 50%, #0B1E46 100%); }
.marca { display: flex; align-items: center; gap: 12px; }
.marca .logo { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: 20px;
               background: linear-gradient(135deg, #3B82F6, #1D4ED8); }
.marca .logo:has(img) { background: none; }
.marca .logo img { width: 100%; height: 100%; display: block; }
.marca b { display: block; font-size: 17px; letter-spacing: .04em; } .marca span { color: #C9D4EA; font-size: 13.5px; }
.login-marca h2 { font-size: 26px; font-weight: 600; line-height: 1.25; margin: 0 0 10px; }
.login-marca p { color: #C9D4EA; margin: 0; line-height: 1.5; font-size: 14.5px; }
.escudo { width: 120px; height: 120px; align-self: flex-end; opacity: .95; }
.marca-pie { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.marca-pie .escudo { align-self: auto; }
.creditos { color: #93A7CC; font-size: 12.5px; letter-spacing: .02em; }
.login-form { padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.login-form h1 { font-size: 24px; font-weight: 600; margin: 0; }
.login-form .sub { color: #7A869C; margin: -10px 0 4px; font-size: 14px; }
.form-row { display: grid; gap: 6px; }
.form-row label { font-size: 13px; font-weight: 500; color: #4B5872; }
.form-row input { height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid #E5E9F0; background: #fff; font: inherit; font-size: 15px;
                  color: #0F1B33; outline: none; transition: border-color .15s, box-shadow .15s; }
.form-row input:focus { border-color: #2563EB; box-shadow: 0 0 0 4px #E8F0FE; }
.btn-login { height: 46px; border: 0; border-radius: 10px; background: #2563EB; color: #fff; font: inherit; font-weight: 600; font-size: 15px;
             cursor: pointer; transition: background .15s; margin-top: 4px; }
.btn-login:hover { background: #1D4FD8; }
.btn-login:focus-visible { outline: 2px solid #2563EB; outline-offset: 2px; }
.error { display: none; background: #FDECEC; color: #DC2626; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.error.show { display: block; }
.pie { color: #7A869C; font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.pie svg { width: 15px; height: 15px; flex: none; }
@media (max-width: 760px) {
  body { padding: 0; place-items: stretch; background: #fff; }
  .login { grid-template-columns: 1fr; border-radius: 0; box-shadow: none; min-height: 100vh; }
  .login-marca { padding: 24px 22px; } .login-marca h2 { font-size: 20px; } .escudo, .login-marca p { display: none; }
  .login-form { padding: 28px 22px 40px; justify-content: flex-start; }
}
/* Recordar usuario / recuperar contraseña */
.panel-login { display: flex; flex-direction: column; gap: 18px; }
.panel-login[hidden] { display: none; }
.fila-opciones { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: -4px; }
.recordar { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: #4B5872; cursor: pointer; }
.recordar input { width: 16px; height: 16px; accent-color: #2563EB; }
.enlace { background: none; border: 0; padding: 0; font: inherit; font-size: 13.5px; color: #2563EB; cursor: pointer; }
.enlace:hover { text-decoration: underline; } .enlace.centrado { align-self: center; }
.btn-login:disabled { opacity: .6; cursor: default; }
.ok { display: none; background: #E8F7EE; color: #15803D; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; line-height: 1.45; }
.ok.show { display: block; }

/* ══ Pantalla de inicio animada: panel azul que se desliza (Iniciar sesión ↔ Recuperar contraseña) ══ */
.login.deslizante { display: block; position: relative; overflow: hidden; min-height: 540px;
                    animation: entrar-tarjeta .8s cubic-bezier(.2,.8,.2,1) both; }
@keyframes entrar-tarjeta { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
.deslizante .lado-form { position: absolute; top: 0; left: 50%; width: 50%; height: 100%; background: #fff;
                         transition: transform .75s cubic-bezier(.65,0,.35,1), opacity .45s ease; }
.deslizante .lado-form .login-form { height: 100%; }
.deslizante .lado-ingresar { z-index: 2; }
.deslizante .lado-recuperar { z-index: 1; opacity: 0; }
.deslizante.recuperando .lado-ingresar { transform: translateX(-100%); opacity: 0; }
.deslizante.recuperando .lado-recuperar { transform: translateX(-100%); opacity: 1; z-index: 5; animation: mostrar-lado .75s; }
@keyframes mostrar-lado { 0%, 49.9% { opacity: 0; z-index: 1; } 50%, 100% { opacity: 1; z-index: 5; } }

/* Cortina: el contenedor viaja de izquierda a derecha; su interior (doble de ancho) muestra la cara de cada estado */
.deslizante .cortina { position: absolute; top: 0; left: 0; width: 50%; height: 100%; overflow: hidden; z-index: 10;
                       transition: transform .75s cubic-bezier(.65,0,.35,1); }
.deslizante.recuperando .cortina { transform: translateX(100%); }
.deslizante .cortina-int { position: relative; left: 0; width: 200%; height: 100%; color: #fff;
                           background: radial-gradient(120% 120% at 80% 20%, #1E4FB8 0%, #0E2A63 50%, #0B1E46 100%);
                           transition: transform .75s cubic-bezier(.65,0,.35,1); }
.deslizante.recuperando .cortina-int { transform: translateX(-50%); }
.deslizante .cara { position: absolute; top: 0; width: 50%; height: 100%; transition: transform .75s cubic-bezier(.65,0,.35,1), opacity .5s; }
.deslizante .cara-ingresar { left: 0; }
.deslizante .cara-recuperar { left: 50%; transform: translateX(20%); opacity: 0; }
.deslizante.recuperando .cara-ingresar { transform: translateX(-20%); opacity: 0; }
.deslizante.recuperando .cara-recuperar { transform: none; opacity: 1; }

/* Luces que se mueven despacio dentro del panel azul */
.deslizante .luz { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .55; pointer-events: none; }
.deslizante .luz-1 { width: 260px; height: 260px; background: #3B82F6; top: -60px; left: 30%; animation: flotar 14s ease-in-out infinite; }
.deslizante .luz-2 { width: 200px; height: 200px; background: #06B6D4; bottom: -40px; left: 5%; opacity: .35; animation: flotar 18s ease-in-out infinite reverse; }
.deslizante .luz-3 { width: 220px; height: 220px; background: #6366F1; top: 35%; left: 70%; opacity: .35; animation: flotar 16s ease-in-out infinite; }
@keyframes flotar { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(40px, 30px) scale(1.1); } 66% { transform: translate(-30px, 20px) scale(.95); } }
.deslizante .login-marca { background: none; z-index: 1; }

/* Escudo: brillo suave y el candado se cierra al cargar */
.deslizante .escudo { filter: drop-shadow(0 0 14px rgba(96,165,250,.45)); animation: latir 3.2s ease-in-out infinite; }
.deslizante .escudo-arco { animation: cerrar-candado 1s .5s cubic-bezier(.3,1.6,.5,1) both; }
.deslizante .escudo-red path { stroke-dasharray: 160; animation: trazar 1.6s .2s ease-out both; }
@keyframes latir { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(96,165,250,.35)); }
                   50% { transform: scale(1.04); filter: drop-shadow(0 0 22px rgba(96,165,250,.7)); } }
@keyframes cerrar-candado { from { transform: translateY(-7px); } to { transform: none; } }
@keyframes trazar { from { stroke-dashoffset: 160; } to { stroke-dashoffset: 0; } }

/* Botones */
.deslizante .btn-login { position: relative; overflow: hidden; transition: background .15s, transform .15s, box-shadow .2s; }
.deslizante .btn-login:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(37,99,235,.35); }
.deslizante .btn-login::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
                                background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-20deg); }
.deslizante .btn-login:hover::after { animation: brillo .8s ease; }
@keyframes brillo { to { left: 130%; } }
.btn-fantasma { margin-top: 18px; height: 42px; padding: 0 22px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,.85);
                background: transparent; color: #fff; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; transition: background .2s, color .2s; }
.btn-fantasma:hover { background: #fff; color: #1D4ED8; }

/* Entrada escalonada del formulario y temblor si la clave es incorrecta */
.deslizante .aparece { animation: subir .6s cubic-bezier(.2,.8,.2,1) both; }
.deslizante .aparece:nth-child(1) { animation-delay: .25s; } .deslizante .aparece:nth-child(2) { animation-delay: .32s; }
.deslizante .aparece:nth-child(4) { animation-delay: .39s; } .deslizante .aparece:nth-child(5) { animation-delay: .46s; }
.deslizante .aparece:nth-child(6) { animation-delay: .53s; } .deslizante .aparece:nth-child(7) { animation-delay: .6s; }
.deslizante .pie.aparece { animation-delay: .7s; }
@keyframes subir { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.temblar { animation: temblar .45s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes temblar { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }

/* Celular: sin deslizamiento; el panel azul queda arriba y se ve solo el formulario activo */
@media (max-width: 760px) {
  .login.deslizante { display: flex; flex-direction: column; min-height: 100vh; }
  .deslizante .cortina { position: relative; order: -1; width: 100%; height: auto; transform: none !important; }
  .deslizante .cortina-int { width: 100%; transform: none !important; }
  .deslizante .cara { position: relative; width: 100%; height: auto; left: 0; transform: none !important; }
  .deslizante .cara-recuperar, .deslizante.recuperando .cara-ingresar { display: none; }
  .deslizante.recuperando .cara-recuperar { display: flex; opacity: 1; }
  .deslizante .lado-form { position: relative; left: 0; width: 100%; height: auto; transform: none !important; animation: none; }
  .deslizante .lado-recuperar, .deslizante.recuperando .lado-ingresar { display: none; }
  .deslizante.recuperando .lado-recuperar { display: block; opacity: 1; }
  .deslizante .btn-fantasma { display: none; }
}

/* Quien prefiere menos movimiento (opción del sistema): cambios instantáneos */
@media (prefers-reduced-motion: reduce) {
  .login.deslizante, .deslizante *, .deslizante *::before, .deslizante *::after { animation: none !important; transition: none !important; }
}

/* ══ Ingreso con Microsoft 365 + segundo factor ══ */
a.btn-login { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.btn-microsoft { gap: 12px; background: #fff; color: #0F1B33; border: 1px solid #C9D2E0; }
.btn-microsoft:hover { background: #F4F6FA; }
.btn-microsoft svg { width: 20px; height: 20px; flex: none; }
.pasos-ingreso { margin: 0; padding-left: 20px; color: #4B5872; font-size: 13.5px; line-height: 1.7; }
.qr { align-self: center; width: 200px; height: 200px; padding: 6px; background: #fff; border: 1px solid #E5E9F0; border-radius: 12px; }
.qr svg { width: 100%; height: 100%; display: block; }
.clave-manual { font-size: 13px; color: #4B5872; }
.clave-manual summary { cursor: pointer; color: #2563EB; }
.clave-manual code { display: block; margin: 8px 0 4px; padding: 8px 10px; background: #F4F6FA; border-radius: 8px;
                     font-family: 'IBM Plex Mono', monospace; font-size: 14px; letter-spacing: .05em; word-break: break-all; }
.form-row input.codigo { font-family: 'IBM Plex Mono', monospace; font-size: 24px; letter-spacing: .4em; text-align: center; }
.entrando { font-size: 15px; color: #4B5872; }