:root {
    --uap-azul: #0c289a;
    --uap-verde: #1a7d4b;
}

body {
    background: linear-gradient(135deg, #0c289a 0%, #1a1a6e 60%, #0d1b5e 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.login-wrapper {
    width: 100%;
    padding: 30px 0;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.brand-subtitle {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 2px;
}

.card-login {
    border: none;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.card-login .card-header {
    background: linear-gradient(90deg, var(--uap-azul), #051a60);
    padding: 22px 30px;
    text-align: center;
    border: none;
}

.card-login .card-body {
    padding: 32px 36px 28px;
    background-color: #f1f5f9; /* Un gris azulado muy claro y elegante */
    border-radius: 8px;
}

.form-label-custom {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--uap-azul);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.form-control-modern {
    border: 1.5px solid #d1d9f0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    background: #f7f9ff;
}

.form-control-modern:focus {
    border-color: var(--uap-azul);
    box-shadow: 0 0 0 3px rgba(12, 40, 154, 0.1);
    background: #fff;
}

.input-icon-wrap {
    position: relative;
}

.input-icon-wrap .icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa4c4;
    cursor: pointer;
    font-size: 1rem;
}

#unidadGroup {
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-ingresar {
    background: linear-gradient(90deg, var(--uap-azul), #1e40af);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    width: 100%;
}

.btn-ingresar:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(12, 40, 154, 0.35);
}

.btn-ingresar:disabled {
    opacity: 0.7;
    transform: none;
}

.spinner-btn {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.modal-icono {
    font-size: 3rem;
    margin-bottom: 10px;
}

.modal-error .modal-header {
    background: #fee2e2;
}

.modal-success .modal-header {
    background: #dcfce7;
}

.modal-warning .modal-header {
    background: #fef9c3;
}

.modal-info .modal-header {
    background: #dbeafe;
}

.modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
}

.footer-login {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    text-align: center;
    margin-top: 20px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* ── Cambiar contraseña ─────────────────────────── */
.cp-step-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .8rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1.5px solid #e2e8f0;
}
.cp-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0c289a;
    color: #fff;
    font-size: .75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cp-field-error {
    font-size: .74rem;
    color: #dc2626;
    margin-top: 4px;
    min-height: 16px;
    font-weight: 600;
}
.cp-bar {
    height: 4px;
    flex: 1;
    border-radius: 2px;
    background: #e2e8f0;
    transition: background .2s;
}
.cp-req {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .74rem;
    color: #94a3b8;
    transition: color .2s;
}
.cp-req.ok { color: #16a34a; }
.cp-req-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #cbd5e1;
    flex-shrink: 0;
    transition: background .2s;
}
.cp-req.ok .cp-req-dot { background: #16a34a; }

#linkCambiarPassword:hover { color: #0c289a !important; }

/* ═══════════════════════════════════════════════════
   SIASE Login — Fondo dinámico
═══════════════════════════════════════════════════ */

body {
    background: linear-gradient(135deg, #0d1b3e 0%, #060d1f 100%) !important;
    overflow: hidden;
}

/* ── Wrapper que da z-index al contenido existente ── */
.login-wrapper {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

/* ═══════════════════════════════════════════════════
   SIASE Login — Animación de presentación
═══════════════════════════════════════════════════ */

/* ── Pantalla de intro ── */
#siase-intro {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d1b3e 0%, #060d1f 100%);
    pointer-events: none;
}

/* Animación de salida del intro */
#siase-intro.saliendo {
    animation: introSalida .7s cubic-bezier(.4, 0, .2, 1) forwards;
}

@keyframes introSalida {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(1.04); }
}

/* ── Logo del intro ── */
.siase-intro-logo {
    width: 110px;
    height: auto;
    opacity: 0;
    animation: introLogoEntrada .6s ease .2s forwards;
    filter: drop-shadow(0 0 18px rgba(174,21,21,0.5));
}

@keyframes introLogoEntrada {
    from { opacity: 0; transform: translateY(-16px) scale(.9); }
    to   { opacity: 1; transform: translateY(0)     scale(1);  }
}

/* ── Nombre SIASE ── */
.siase-intro-nombre {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 10px;
    color: #fff;
    text-transform: uppercase;
    margin: 18px 0 6px;
    opacity: 0;
    animation: introNombreEntrada .5s ease .7s forwards;
    text-shadow: 0 0 30px rgba(174, 21, 21, 0.6);
}

@keyframes introNombreEntrada {
    from { opacity: 0; transform: scale(.94) translateY(8px); }
    to   { opacity: 1; transform: scale(1)   translateY(0);   }
}

/* ── Subtítulo ── */
.siase-intro-sub {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 3px;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    text-align: center;
    max-width: 320px;
    line-height: 1.7;
    opacity: 0;
    animation: introSubEntrada .5s ease 1.1s forwards;
}

@keyframes introSubEntrada {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0);   }
}

/* ── Línea decorativa roja ── */
.siase-intro-linea {
    width: 0;
    height: 2px;
    background: #ae1515;
    border-radius: 2px;
    margin: 14px auto;
    animation: introLineaExpand .5s ease .9s forwards;
    box-shadow: 0 0 10px rgba(174,21,21,0.7);
}

@keyframes introLineaExpand {
    from { width: 0; opacity: 0; }
    to   { width: 80px; opacity: 1; }
}

/* ── Barra de carga inferior ── */
.siase-intro-barra-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
}

.siase-intro-barra {
    height: 100%;
    width: 0%;
    background: #ae1515;
    box-shadow: 0 0 10px rgba(174,21,21,0.8);
    animation: introBarraFill 2s ease .3s forwards;
}

@keyframes introBarraFill {
    from { width: 0%; }
    to   { width: 100%; }
}

/* ── UAP badge ── */
.siase-intro-uap {
    font-size: 10px;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.25);
    text-transform: uppercase;
    opacity: 0;
    animation: introSubEntrada .5s ease 1.3s forwards;
    margin-top: 20px;
}

.siase-intro-uap span { color: #ae1515; }

/* ─────────────────────────────────────────────────
   Entrada del formulario (después del intro)
───────────────────────────────────────────────── */
.login-wrapper {
    opacity: 0;
}

.login-wrapper.visible {
    animation: loginEntrada .6s cubic-bezier(.34, 1.3, .64, 1) forwards;
}

@keyframes loginEntrada {
    from { opacity: 0; transform: translateY(20px) scale(.98); }
    to   { opacity: 1; transform: translateY(0)     scale(1);  }
}