/* ========================================
   COLORES Y CONFIGURACIÓN GLOBAL
   ======================================== */
:root {
    --deep-blue: #00204A;
    --cyan: #00B7EB;
    --bright-cyan: #05D3F8;
    --white: #FFFFFF;
    --error-red: #c62828;
}

* {
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
}

body,
html {
    height: 100%;
    margin: 0;
}

/* ========================================
   PÁGINA DE LOGIN
   ======================================== */
.login-page {
    display: flex;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    /* Fondo principal (imagen proporcionada por el usuario) */
    background: url('../images/backgrounds/Fondo_Login_01.jpg') center center;
    background-size: cover;
}

/* Overlay degradado: oscurece la parte izquierda y deja la derecha más clara */
.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 32, 74, 0.88) 0%, rgba(0, 32, 74, 0.68) 35%, rgba(255, 255, 255, 0.0) 65%);
    z-index: 1;
}

/* ========================================
   SECCIÓN IZQUIERDA - FORMULARIO
   ======================================== */
.login-left {
    /* Tarjeta de login a la izquierda */
    flex: 0 0 44%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
    position: relative;
    z-index: 2;
}

/* Tarjeta blanca del formulario */
.card {
    background: rgba(255, 255, 255, 0.98);
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(5, 10, 20, 0.06);
}

.card h2 {
    margin: 0 0 30px;
    text-align: center;
    color: var(--deep-blue);
    font-size: 28px;
    font-weight: 600;
}

/* ========================================
   ALERTAS
   ======================================== */
.alert {
    background: #ffcccc;
    color: #700;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    animation: slideDown 0.3s ease-out;
}

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

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

/* ========================================
   INPUTS
   ======================================== */
.input-wrap {
    display: flex;
    align-items: center;
    background: rgba(250, 250, 250, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 22px;
    transition: all 0.18s ease;
    position: relative;
}

.input-wrap:focus-within {
    border-color: var(--cyan);
    background: white;
    box-shadow: 0 0 0 2px rgba(0, 183, 235, 0.1);
}

.input-wrap input {
    border: 0;
    outline: 0;
    padding: 12px 8px;
    flex: 1;
    background: transparent;
    font-size: 15px;
    color: var(--deep-blue);
}

.input-wrap input::placeholder {
    color: #999;
}

/* Iconos izquierdos */
.left-icon {
    margin-right: 12px;
    display: flex;
    align-items: center;
}

.left-icon img {
    width: 20px;
    height: 20px;
    opacity: 1;
    display: block;
}

/* ========================================
   TOOLTIPS DE VALIDACIÓN
   ======================================== */
.field-tooltip {
    position: absolute;
    left: 14px;
    top: calc(100% + 8px);
    transform: none;
    background: #fff8ed;
    border: 1px solid rgba(255, 152, 0, 0.25);
    color: #a65800;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 8px;
    align-items: center;
    z-index: 30;
    min-width: 180px;
}

.field-tooltip .icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff3e0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ff9800;
    font-weight: 700;
    font-size: 12px;
}

.field-tooltip.hide {
    display: none;
}

/* Check verde cuando el email es válido */
.email-ok {
    color: #0bb3e8;
    font-weight: 700;
    margin-left: 10px;
    display: none;
    background: rgba(3, 169, 244, 0.08);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 14px;
}

/* ========================================
   BOTÓN DE MOSTRAR/OCULTAR CONTRASEÑA
   ======================================== */
.eye {
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 16px;
    padding: 6px;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.eye:hover {
    opacity: 1;
}

/* ========================================
   BOTÓN DE LOGIN
   ======================================== */
.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--cyan), var(--bright-cyan));
    color: #fff;
    border-radius: 12px;
    border: 0;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 6px 20px rgba(0, 183, 235, 0.3);
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Loading state */
.btn-primary.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ========================================
   SECCIÓN DERECHA - BIENVENIDA
   ======================================== */
.login-right {
    /* Zona derecha (área clara del fondo) con logo y mensaje */
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    position: relative;
    z-index: 2;
}

/* Efecto sutil de fondo */
.login-right::before {
    content: '';
    position: absolute;
    left: -20%;
    top: -30%;
    width: 120%;
    height: 80%;
    background: linear-gradient(90deg, #022744, #00b7eb);
    transform: rotate(-18deg);
    opacity: 0.06;
    z-index: 1;
    pointer-events: none;
}

/* Contenedor de bienvenida - SIN fondo, transparente */
.welcome {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    max-width: 720px;
    padding: 0;
    text-align: center;
    position: relative;
    z-index: 2;
}

.welcome-logo {
    width: 380px;
    height: auto;
    display: block;
    margin: 0 auto 18px;
}

.welcome h1 {
    color: #07284A;
    font-size: 42px;
    margin: 8px 0 12px;
    font-weight: 700;
}

.welcome p {
    color: #0b2b3a;
    font-size: 17px;
    line-height: 1.7;
}

/* ========================================
   HINT DE FORMULARIO
   ======================================== */
.form-hint {
    margin-top: 18px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(198, 40, 40, 0.06);
    border: 1px solid rgba(198, 40, 40, 0.14);
    color: #c62828;
    font-size: 14px;
    display: none;
}

.form-hint.visible {
    display: block;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablets y móviles */
@media (max-width: 900px) {
    .login-page {
        flex-direction: column;
    }

    .login-left {
        flex: unset;
        width: 100%;
        padding: 30px;
    }

    .login-right {
        order: 2;
        padding: 30px;
        width: 100%;
    }

    .welcome-logo {
        width: 280px;
    }

    .welcome h1 {
        font-size: 32px;
    }

    .welcome p {
        font-size: 15px;
    }

    .field-tooltip {
        right: 10px;
        font-size: 12px;
        padding: 6px 8px;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .login-left {
        padding: 20px;
    }

    .card {
        padding: 30px 20px;
    }

    .card h2 {
        font-size: 24px;
    }

    .welcome-logo {
        width: 220px;
    }

    .welcome h1 {
        font-size: 26px;
    }
}

/* ========================================
   UTILIDADES
   ======================================== */
.hidden {
    display: none !important;
}