:root {
    --primary-color: #007bff;
    --secondary-color: #f8f9fa;
    --dark-bg: rgba(0, 0, 0, 0.7);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-color: #343a40;
    --link-color: #007bff;
    --button-hover: #0056b3;
    --error-color: #dc3545;
    --success-color: #28a745;
    --border-radius: 15px;
    --font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 15px 35px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: var(--text-color);
    position: relative;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Background con gradiente y overlay */
.hero-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* Gradiente MUCHO más transparente + imagen visible */
    background:
        linear-gradient(135deg, 
            rgba(0, 123, 255, 0.25) 0%,
            rgba(0, 86, 179, 0.30) 50%,
            rgba(0, 64, 133, 0.35) 100%
        ),
        url('bg_pg.jpg') center/cover no-repeat;

    z-index: -2;
    animation: subtleZoom 20s ease-in-out infinite alternate;
}


/* Overlay adicional para mejor legibilidad */
.hero-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* Animación sutil del fondo */
@keyframes subtleZoom {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.05);
    }
}

/* Partículas flotantes decorativas */
.hero-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 200px 200px, 150px 150px, 300px 300px;
    animation: float 15s ease-in-out infinite;
    z-index: 2;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Container principal mejorado */
.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 50px 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideInUp 0.8s ease-out;
    margin: 20px;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo mejorado */
.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
}

.logo::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--button-hover));
    border-radius: 50%;
    opacity: 0.1;
    z-index: -1;
}

.logo i {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--button-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-right: 15px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.logo h1 {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-color), #6c757d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -0.5px;
}

/* Título mejorado */
h2 {
    font-size: 1.6rem;
    margin-bottom: 30px;
    color: var(--text-color);
    font-weight: 600;
    opacity: 0.9;
}

/* Input groups mejorados */
.input-group {
    position: relative;
    margin-bottom: 25px;
}

.input-group i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #ced4da;
    font-size: 1.1rem;
    z-index: 2;
    transition: color 0.3s ease;
}

.input-group input {
    width: 100%;
    padding: 18px 18px 18px 55px;
    border: 2px solid rgba(206, 212, 218, 0.3);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

.input-group input:focus + i {
    color: var(--primary-color);
}

/* Placeholder mejorado */
.input-group input::placeholder {
    color: #adb5bd;
    font-weight: 400;
}

/* Forgot password */
.forgot-password {
    text-align: right;
    margin-bottom: 25px;
}

.forgot-password a {
    color: var(--link-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.forgot-password a:hover {
    text-decoration: none;
    color: var(--button-hover);
    transform: translateX(-2px);
}

/* Botón de login mejorado */
.login-button {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary-color), var(--button-hover));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.login-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

.login-button:hover:not(:disabled)::before {
    left: 100%;
}

.login-button:active:not(:disabled) {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Mensaje de error mejorado */
.error-message {
    margin-top: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8d7da, #f1aeb5);
    color: var(--error-color);
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-light);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Footer links */
.footer-links {
    margin-top: 30px;
    font-size: 0.85rem;
    color: #6c757d;
    opacity: 0.8;
}

.footer-links a {
    color: #6c757d;
    text-decoration: none;
    margin: 0 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

/* Responsive Design Mejorado */
@media (max-width: 768px) {
    .hero-bg {
        background-attachment: scroll;
    }
    
    .login-container {
        padding: 40px 30px;
        margin: 15px;
        max-width: calc(100% - 30px);
        border-radius: 12px;
    }
    
    .logo i {
        font-size: 3rem;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 35px 25px;
        margin: 10px;
        border-radius: 10px;
    }

    .logo {
        margin-bottom: 25px;
    }

    .logo i {
        font-size: 2.5rem;
        margin-right: 10px;
    }

    .logo h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.2rem;
        margin-bottom: 25px;
    }

    .input-group {
        margin-bottom: 20px;
    }

    .input-group input {
        padding: 15px 15px 15px 48px;
        font-size: 0.95rem;
    }

    .input-group i {
        left: 15px;
        font-size: 1rem;
    }

    .login-button {
        padding: 16px;
        font-size: 1rem;
    }

    .footer-links {
        margin-top: 25px;
        font-size: 0.8rem;
    }
}

@media (max-width: 360px) {
    .login-container {
        padding: 30px 20px;
    }

    .input-group input {
        padding: 12px 12px 12px 42px;
    }

    .input-group i {
        left: 12px;
    }
}

/* Mejoras para dispositivos con pantallas de alta densidad */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-bg {
        background-image: 
            linear-gradient(135deg, 
                rgba(0, 123, 255, 0.8) 0%,
                rgba(0, 86, 179, 0.9) 50%,
                rgba(0, 64, 133, 0.95) 100%
            ),
            url('bg_pg.jpg');
    }
}

/* Animación de carga para mejor UX */
.login-container.loading {
    pointer-events: none;
}

.login-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius);
    z-index: 1000;
}