/* ═══════════════════════════════════════════════════════════
   MYM · RRHH — PORTAL DE ACCESO CORPORATIVO (TEMA CLARO)
   Inspirado en el diseño limpio, elegante y moderno del Dashboard
   Paleta: Fondo Claro #f4f6fa, Tarjeta Blanca #ffffff, Acentos Azul Marino (#043A54) y Celeste (#0284c7)
   ═══════════════════════════════════════════════════════════ */

:root {
    /* Tipografías Oficiales */
    --font-display: 'Raleway', 'Plus Jakarta Sans', Helvetica, Arial, sans-serif;
    --font-sans: 'Inter', 'Plus Jakarta Sans', Helvetica, Arial, sans-serif;

    /* Paleta Corporativa MYM */
    --bg-canvas: #f4f6fa;
    --bg-card: #ffffff;
    --border-card: #e2e8f0;
    --border-focus: #0284c7;

    --navy-deep: #043A54;
    --navy-dark: #0f2642;
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --primary-light: #e0f2fe;
    --primary-accent: #0ea5e9;

    --text-primary: #0f2642;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --success: #10b981;
    --success-bg: #f0fdf4;
    --success-border: #bbf7d0;
    --success-text: #166534;

    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --danger-text: #991b1b;

    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --warning-text: #92400e;

    /* Sombras Suaves y Elegantes */
    --shadow-card: 0 1px 3px rgba(15, 38, 66, 0.04), 0 16px 36px -8px rgba(15, 38, 66, 0.09);
    --shadow-btn: 0 4px 14px rgba(2, 132, 199, 0.32);
    --shadow-btn-hover: 0 8px 22px rgba(2, 132, 199, 0.42);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════════════════
   1. FONDO AMBIENTAL CLARO & PATRÓN TECNOLÓGICO SUTIL
   ═══════════════════════════════════════════════════════════ */
.background-canvas {
    position: fixed;
    inset: 0;
    background: 
        linear-gradient(135deg, rgba(244, 246, 250, 0.38) 0%, rgba(224, 242, 254, 0.28) 100%),
        url('../img/login_rh.jpg?v=3') no-repeat center center fixed;
    background-size: cover;
    z-index: 1;
    overflow: hidden;
}

/* Ocultar capas difusas para que el código y algoritmos se distingan con total nitidez */
.grid-overlay,
.ambient-orb {
    display: none !important;
}

@keyframes floatPrimary {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-35px, 25px) scale(1.06); }
    100% { transform: translate(25px, 50px) scale(0.96); }
}

@keyframes floatSecondary {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -30px) scale(1.04); }
    100% { transform: translate(-25px, -50px) scale(0.94); }
}

@keyframes floatAccent {
    0% { transform: translate(0, 0) scale(0.92); }
    100% { transform: translate(50px, -25px) scale(1.1); }
}

/* ═══════════════════════════════════════════════════════════
   2. CONTENEDOR & TARJETA DE LOGIN CORPORATIVA
   ═══════════════════════════════════════════════════════════ */
.login-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 450px;
    padding: 24px 16px;
    margin: auto;
}

.glass-card-login {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 20px;
    padding: 42px 38px 32px 38px;
    box-shadow: 
        0 4px 6px -1px rgba(15, 38, 66, 0.04), 
        0 20px 45px -10px rgba(15, 38, 66, 0.15), 
        0 0 0 1px rgba(255, 255, 255, 0.9);
    position: relative;
    overflow: hidden;
    animation: cardEntrance 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Acento superior distintivo (Igual que las tarjetas KPI del Dashboard) */
.glass-card-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #043A54 0%, #0284c7 50%, #38bdf8 100%);
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ═══════════════════════════════════════════════════════════
   3. EMBLEMA Y MARCA INSTITUCIONAL
   ═══════════════════════════════════════════════════════════ */
.brand-emblem-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.brand-emblem {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1.5px solid #bae6fd;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 
        0 8px 18px -4px rgba(2, 132, 199, 0.18),
        inset 0 1px 1px #ffffff;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.brand-emblem:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 
        0 12px 24px -4px rgba(2, 132, 199, 0.28),
        inset 0 1px 1px #ffffff;
}

.brand-emblem i {
    font-size: 32px;
    color: var(--primary);
    filter: drop-shadow(0 2px 4px rgba(2, 132, 199, 0.25));
}

.brand-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.4px;
    margin: 0;
    text-align: center;
    color: var(--navy-dark);
}

.brand-title .gradient-text {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-tagline {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
    margin-bottom: 26px;
    font-weight: 500;
    letter-spacing: 0.1px;
}

/* ═══════════════════════════════════════════════════════════
   4. CAMPOS DE ENTRADA (INPUTS MODERNOS EN ENTORNO CLARO)
   ═══════════════════════════════════════════════════════════ */
.input-field-group {
    position: relative;
    margin-bottom: 18px;
}

.input-field-group .input-icon-left {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 18px;
    transition: color 0.22s ease;
    z-index: 2;
    pointer-events: none;
}

.input-modern {
    width: 100%;
    height: 50px;
    background-color: #ffffff !important;
    border: 1.5px solid var(--border-card) !important;
    border-radius: 12px !important;
    color: var(--navy-dark) !important;
    font-size: 14.5px !important;
    font-weight: 500 !important;
    padding: 0 46px 0 48px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

.input-modern::placeholder {
    color: var(--text-light);
    font-weight: 400;
}

.input-modern:focus {
    background-color: #ffffff !important;
    border-color: var(--border-focus) !important;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.14) !important;
    outline: none !important;
    color: var(--navy-dark) !important;
}

.input-field-group:focus-within .input-icon-left {
    color: var(--primary);
}

/* Botón Ojo (Mostrar / Ocultar Contraseña) */
.btn-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 18px;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-toggle-password:hover {
    color: var(--text-primary);
    background-color: #f1f5f9;
}

/* ═══════════════════════════════════════════════════════════
   5. BOTÓN DE INICIO DE SESIÓN
   ═══════════════════════════════════════════════════════════ */
.btn-submit-login {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-btn);
    margin-top: 10px;
}

/* Destello de brillo ligero */
.btn-submit-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    transition: transform 0.6s ease;
}

.btn-submit-login:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    transform: translateY(-1.5px);
    box-shadow: var(--shadow-btn-hover);
    color: #ffffff;
}

.btn-submit-login:hover::before {
    transform: translateX(200%);
}

.btn-submit-login:active {
    transform: translateY(0.5px);
    box-shadow: var(--shadow-btn);
}

.btn-submit-login:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none !important;
}

/* ═══════════════════════════════════════════════════════════
   6. ALERTAS Y TOASTS
   ═══════════════════════════════════════════════════════════ */
.custom-alert {
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 13.5px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: alertSlide 0.3s ease forwards;
}

@keyframes alertSlide {
    0% { opacity: 0; transform: translateY(-6px); }
    100% { opacity: 1; transform: translateY(0); }
}

.custom-alert-danger {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger-text);
}

.custom-alert-danger i {
    color: var(--danger);
    font-size: 18px;
    margin-top: 1px;
    flex-shrink: 0;
}

.custom-alert-success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}

.custom-alert-success i {
    color: var(--success);
    font-size: 18px;
    margin-top: 1px;
    flex-shrink: 0;
}

/* Toast de Sesión Expirada */
.timeout-toast {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: var(--warning-text);
    padding: 9px 18px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.12);
    animation: toastPop 0.35s ease forwards;
}

.timeout-toast i {
    color: #d97706;
}

@keyframes toastPop {
    0% { opacity: 0; transform: scale(0.92); }
    100% { opacity: 1; transform: scale(1); }
}

/* ═══════════════════════════════════════════════════════════
   7. FOOTER DE SEGURIDAD Y CRÉDITOS
   ═══════════════════════════════════════════════════════════ */
.login-card-footer {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.2px;
}

.pulse-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
    position: relative;
}

.pulse-indicator::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1.5px solid var(--success);
    animation: pulseRing 2s infinite ease-out;
}

@keyframes pulseRing {
    0% { transform: scale(0.6); opacity: 1; }
    100% { transform: scale(2.2); opacity: 0; }
}

.designer-badge {
    font-size: 12px;
    color: var(--text-light);
}

.designer-badge .designer-name {
    color: var(--primary);
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════
   8. ADAPTACIONES MÓVILES
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .glass-card-login {
        padding: 32px 22px 26px 22px;
        border-radius: 18px;
    }
    
    .brand-title {
        font-size: 23px;
    }

    .brand-emblem {
        width: 60px;
        height: 60px;
        border-radius: 16px;
    }

    .brand-emblem i {
        font-size: 28px;
    }
}

/* ═══════════════════════════════════════════════════════════
   9. EFECTO FÍSICO DE SACUDIDA & ALERTA DE ERROR (SHAKE)
   ═══════════════════════════════════════════════════════════ */
@keyframes shakeCardPhysics {
    0%, 100% {
        transform: translateX(0) scale(1);
    }
    12% {
        transform: translateX(-14px) rotate(-0.8deg);
    }
    24% {
        transform: translateX(12px) rotate(0.6deg);
    }
    36% {
        transform: translateX(-8px) rotate(-0.4deg);
    }
    48% {
        transform: translateX(6px) rotate(0.2deg);
    }
    60% {
        transform: translateX(-4px);
    }
    72% {
        transform: translateX(2px);
    }
    84% {
        transform: translateX(-1px);
    }
}

@keyframes errorHaloPulseLight {
    0% {
        border-color: #fca5a5;
        box-shadow: 
            0 1px 3px rgba(15, 38, 66, 0.04),
            0 16px 36px -8px rgba(15, 38, 66, 0.09),
            0 0 24px rgba(239, 68, 68, 0.22);
    }
    50% {
        border-color: #f87171;
        box-shadow: 
            0 1px 3px rgba(15, 38, 66, 0.04),
            0 16px 36px -8px rgba(15, 38, 66, 0.09),
            0 0 12px rgba(239, 68, 68, 0.12);
    }
    100% {
        border-color: #fca5a5;
        box-shadow: 
            0 1px 3px rgba(15, 38, 66, 0.04),
            0 16px 36px -8px rgba(15, 38, 66, 0.09),
            0 0 24px rgba(239, 68, 68, 0.22);
    }
}

.shake-card {
    animation: 
        shakeCardPhysics 0.72s cubic-bezier(0.36, 0.07, 0.19, 0.97) both,
        errorHaloPulseLight 2s ease-in-out infinite alternate !important;
}

.shake-card .input-modern {
    border-color: #fca5a5 !important;
    background-color: #fffbfb !important;
}

.shake-card .input-modern:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14) !important;
}

.shake-card .brand-emblem {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
    border-color: #fca5a5 !important;
    box-shadow: 0 8px 18px -4px rgba(239, 68, 68, 0.25) !important;
}

.shake-card .brand-emblem i {
    color: #ef4444 !important;
    filter: drop-shadow(0 2px 4px rgba(239, 68, 68, 0.35)) !important;
}

.shake-card .custom-alert-danger {
    animation: alertPopBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes alertPopBounce {
    0% { transform: scale(0.92) translateY(-6px); opacity: 0; }
    50% { transform: scale(1.02) translateY(1px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}
