/* =============================================
   Estilos de Login - GESTIA
   ============================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('../img/fondo.jpg') center/cover no-repeat fixed;
    position: relative;
}

/* Overlay oscuro sobre la imagen de fondo */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 0;
}

/* Container principal */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 20px;
    animation: fadeInUp 0.5s ease;
}

/* Card de login */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Header del login */
.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-logo {
    width: 70px;
    height: 70px;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    animation: float 3s ease-in-out infinite;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 14px;
    color: #666;
    font-weight: 400;
}

/* Formulario */
.login-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    z-index: 2;
    transition: color 0.3s ease;
}

.form-input {
    width: 100%;
    padding: 15px 45px 15px 45px;
    font-size: 15px;
    border: 2px solid #e1e1e1;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.form-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
}

.form-input:focus ~ .input-label,
.form-input:not(:placeholder-shown) ~ .input-label {
    top: -10px;
    left: 40px;
    font-size: 12px;
    color: #4CAF50;
    background: white;
    padding: 0 5px;
}

.form-input:focus ~ .input-icon {
    color: #4CAF50;
}

.input-label {
    position: absolute;
    left: 45px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 15px;
    pointer-events: none;
    transition: all 0.3s ease;
    background: transparent;
}

/* Toggle password */
.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #4CAF50;
}

/* Checkbox personalizado */
.checkbox-group {
    margin-bottom: 25px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom {
    background: #4CAF50;
    border-color: #4CAF50;
}

.checkbox-custom::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom::after {
    opacity: 1;
}

.checkbox-text {
    font-size: 14px;
    color: #666;
}

/* Botón de login */
.btn-login {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(76, 175, 80, 0.3);
}

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

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-login:hover::before {
    width: 300px;
    height: 300px;
}

/* Loader */
.btn-loader {
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Mensaje de error */
.error-message {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #f44336;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 15px;
    animation: shake 0.5s ease;
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 20px;
}

.forgot-link {
    color: #4CAF50;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #45a049;
    text-decoration: underline;
}

/* Copyright */
.copyright {
    text-align: center;
    margin-top: 30px;
    color: white;
    font-size: 13px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .login-container {
        padding: 15px;
    }
    
    .login-card {
        padding: 30px 20px;
    }
    
    .login-title {
        font-size: 24px;
    }
    
    .login-logo {
        width: 60px;
        height: 60px;
    }
    
    .form-input {
        padding: 12px 40px 12px 40px;
        font-size: 14px;
    }
    
    .btn-login {
        padding: 12px;
        font-size: 15px;
    }
}

/* Efecto glassmorphism mejorado */
@supports (backdrop-filter: blur(10px)) {
    .login-card {
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(20px);
    }
}

/* Overlay de carga post-login */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.overlay-content {
    text-align: center;
}

.overlay-logo {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 0 20px rgba(76, 175, 80, 0.5));
    animation: pulseGlow 1.2s ease-in-out infinite;
}

.overlay-text {
    color: white;
    font-size: 16px;
    font-weight: 500;
    margin-top: 20px;
    letter-spacing: 0.5px;
}

@keyframes pulseGlow {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(76, 175, 80, 0.5));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 30px rgba(76, 175, 80, 0.8));
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Focus visible para accesibilidad */
.form-input:focus-visible,
.btn-login:focus-visible,
.toggle-password:focus-visible {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}