* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background: 
        linear-gradient(135deg, #0464b4, #2c3e50),
        url('../css/img/fondo.jpg') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Efectos de partículas animadas en el fondo */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255,255,255,0.05) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.login-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: 1200px;
    width: 100%;
    align-items: center;
    position: relative;
    z-index: 2;
}

/* Contenedor del formulario */
.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 3rem 2.5rem;
    border-radius: 24px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    text-align: center;
    animation: slideInLeft 0.8s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.login-container h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #0464b4, #2c3e50);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-container h2 {
    color: #7f8c8d;
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    font-weight: 400;
}

/* Contenedor del GIF */
.gif-container {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: slideInRight 0.8s ease-out;
}

.login-gif {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: perspective(1000px) rotateY(-5deg);
    transition: transform 0.5s ease;
}

.login-gif:hover {
    transform: perspective(1000px) rotateY(0deg) scale(1.02);
}

/* Formulario */
.form-group {
    margin-bottom: 1.8rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.7rem;
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.form-group input:focus {
    outline: none;
    border-color: #0464b4;
    box-shadow: 0 0 0 3px rgba(4, 100, 180, 0.1);
    background: white;
    transform: translateY(-2px);
}

.password-container .input-group {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.toggle-password:hover {
    color: #0464b4;
    background: rgba(4, 100, 180, 0.1);
}

/* Botón de login */
.btn-login {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, #0464b4, #2c3e50);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(4, 100, 180, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(4, 100, 180, 0.4);
}

.btn-login:active {
    transform: translateY(-1px);
}

.btn-login::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;
}

.btn-login:hover::before {
    left: 100%;
}

/* Alertas */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    font-weight: 500;
    animation: shake 0.5s ease-in-out;
}

.alert.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

/* Animaciones */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Responsive */
@media (max-width: 968px) {
    .login-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
        max-width: 500px;
    }

    .gif-container {
        order: -1;
    }

    .login-gif {
        max-width: 300px;
        transform: none;
    }

    .login-container {
        padding: 2.5rem 2rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    .login-container {
        padding: 2rem 1.5rem;
    }

    .login-container h1 {
        font-size: 2rem;
    }

    .login-container h2 {
        font-size: 1rem;
    }

    .login-gif {
        max-width: 250px;
    }
}

/* Efectos de carga */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Decoraciones adicionales */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-elements div {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: floatElement 15s infinite linear;
}

.floating-elements div:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-elements div:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 70%;
    left: 80%;
    animation-delay: -5s;
}

.floating-elements div:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 50%;
    left: 20%;
    animation-delay: -10s;
}

@keyframes floatElement {
    0% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-40px) rotate(180deg);
        opacity: 0.3;
    }
    100% {
        transform: translateY(0px) rotate(360deg);
        opacity: 0.7;
    }
}