/* ═══════════════════════════════════════════════════════════════════
   LOGIN - Estilos específicos
   Depende de: insalud.css
   ═══════════════════════════════════════════════════════════════════ */

.login-page {
    min-height: 100vh;
    min-height: 100dvh;            /* ← Dynamic viewport height (móviles modernos) */
    height: 100vh;
    height: 100dvh;                /* ← Fija la altura exacta del viewport */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
    overflow: hidden;              /* ← Evita cualquier scroll */
    overscroll-behavior: none;     /* ← Bloquea el rebote en iOS */
}

/* ─────────────────────────────────────────────────────────────────
   FONDO - Personaliza aquí
   ───────────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────
   FONDO DEL LOGIN
   Dos imágenes: una horizontal (desktop) y una vertical (móvil)
   ───────────────────────────────────────────────────────────────── */
.login-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 0;

    /* Desktop por defecto */
    background-color: var(--insalud-blue);
    background-image: url('../images/login-bg.jpg');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

/* Móviles: usamos la versión vertical */
@media (max-width: 768px) {
    .login-bg {
        background-image: url('../assets/images/login-bg-mobile.jpg');
    }
}

/* Tablets en vertical: también versión vertical */
@media (max-width: 1024px) and (orientation: portrait) {
    .login-bg {
        background-image: url('../assets/images/login-bg-mobile.jpg');
    }
}

/* Overlay para mejorar contraste (útil cuando usas imagen de fondo) */
.login-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: rgba(39, 51, 118, 0);
    /* Si usas imagen, sube la opacidad: rgba(39, 51, 118, 0.4) */
}

/* ─────────────────────────────────────────────────────────────────
   CONTENEDOR
   ───────────────────────────────────────────────────────────────── */
.login-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
}

/* ─────────────────────────────────────────────────────────────────
   TARJETA
   ───────────────────────────────────────────────────────────────── */
.login-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    /*padding: 40px 36px;*/
    padding: 32px 28px;
    position: relative;
    overflow: hidden;
}

/* Barra superior con colores institucionales */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg,
        var(--insalud-yellow) 0%,
        var(--insalud-yellow) 33%,
        var(--insalud-blue) 33%,
        var(--insalud-blue) 66%,
        var(--insalud-red) 66%,
        var(--insalud-red) 100%);
}

/* ─────────────────────────────────────────────────────────────────
   LOGO
   ───────────────────────────────────────────────────────────────── */
.login-logo {
    display: flex;
    justify-content: center;
    /*margin-bottom: 24px;*/
    margin-bottom: 16px;
}

.login-logo img {
    max-height: 100px;
    width: auto;
}

/* ─────────────────────────────────────────────────────────────────
   TÍTULOS
   ───────────────────────────────────────────────────────────────── */
.login-title {
    text-align: center;
    /* margin-bottom: 6px; */
    margin-bottom: 4px;
}

.login-title h1 {
    font-family: var(--font-display);
    /* font-size: 24px; */
    font-size: 20px;
    font-weight: 800;
    color: var(--insalud-blue);
    margin: 0;
    letter-spacing: -0.02em;
}

.login-subtitle {
    text-align: center;
    /* font-size: 13px; */
    font-size: 12px;
    color: var(--insalud-text-muted);
    /* margin-bottom: 28px; */
    margin-bottom: 18px; 
    font-family: var(--font-body);
}

/* Separador decorativo */
.login-divider {
    height: 4px;
    width: 100px;                /* ← un poco más ancho para que se aprecien los 3 colores */
    background: linear-gradient(90deg,
        var(--insalud-yellow) 0%,
        var(--insalud-yellow) 33.33%,
        var(--insalud-blue) 33.33%,
        var(--insalud-blue) 66.66%,
        var(--insalud-red) 66.66%,
        var(--insalud-red) 100%);
    border-radius: 2px;
    margin: 0 auto 20px;
}

/* ─────────────────────────────────────────────────────────────────
   FOOTER DE LA TARJETA
   ───────────────────────────────────────────────────────────────── */
.login-footer {
    /* margin-top: 24px;
    padding-top: 20px; */
    margin-top: 16px;
    padding-top: 14px;    
    border-top: 1px solid var(--insalud-border);
    text-align: center;
}

.login-footer p {
    font-size: 11px;
    color: var(--insalud-text-soft);
    line-height: 1.5;
    margin: 0;
}

/* ─────────────────────────────────────────────────────────────────
   FOOTER INSTITUCIONAL (fuera de la tarjeta)
   ───────────────────────────────────────────────────────────────── */
.login-page-footer {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 2;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-family: var(--font-body);
    padding: 0 20px;
}

/* ─────────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────────── */

/* Móviles pequeños */
@media (max-width: 480px) {
    .login-page {
        padding: 12px;
        align-items: center;       /* ← Centrado vertical siempre */
        overflow: hidden;
    }

    .login-card {
        padding: 26px 20px;
        border-radius: 14px;
        max-height: calc(100dvh - 24px);   /* ← No excede el viewport */
        overflow-y: auto;         
    }

    /*.login-logo img {
        max-height: 70px;
    }*/

    .login-title h1 {
        font-size: 18px;
    }

    .login-subtitle {
        font-size: 12px;
        margin-bottom: 16px;
    }

    .login-divider {
        margin-bottom: 18px;
    }

    .login-page {
        padding: 12px;
    }

    .login-page-footer {
        font-size: 10px;
        bottom: 12px;
    }
}

/* Tablets y desktop */
@media (min-width: 768px) {
    .login-card {
        padding: 48px 44px;
    }

    .login-logo img {
        /*max-height: 80px;*/
        max-height: 100px;
    }
}

/* Pantallas con poca altura */
@media (max-height: 700px) {
    .login-page {
        /*align-items: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;*/
        align-items: center;
        padding: 12px;        
    }

    .login-card {
        padding: 24px 20px;
        max-height: calc(100dvh - 24px);
        overflow-y: auto;
    }
    
    .login-logo img {
        max-height: 100px;
    }
    
    .login-title h1 {
        font-size: 18px;
    }
    
    .login-subtitle {
        margin-bottom: 14px;
    }
    
    .login-divider {
        margin-bottom: 16px;
    }    

    .login-page-footer {
        /*position: relative;
        margin-top: 30px;*/

        position: absolute;
        bottom: 6px;
        font-size: 9px;        
    }
}