/* ============================================
   VARIABLES CSS
============================================ */
:root {
    --primary-color: #4b4366;
    --secondary-color: #6b5b95;
    --tertiary-color: #8b7bb8;
    --quaternary-color: #ab9bdb;
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* ============================================
   BODY Y FONDO ANIMADO
============================================ */
.login-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow-x: hidden;
}

.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(-45deg,
            var(--primary-color),
            var(--secondary-color),
            var(--tertiary-color),
            var(--quaternary-color));
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    overflow: hidden;
}

@keyframes gradient {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ============================================
   CONTAINER PRINCIPAL
============================================ */
.login-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* ============================================
   CARD CON EFECTO GLASSMORPHISM
============================================ */
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    box-shadow:
        0 8px 32px var(--shadow-color),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* ============================================
   HEADER DEL LOGIN
============================================ */
.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

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

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin: 0 0 0.5rem 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.login-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/* ============================================
   FORMULARIO
============================================ */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ============================================
   INPUTS CON ICONOS
============================================ */
.input-group-modern {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    z-index: 1;
    transition: color 0.3s ease;
    pointer-events: none;
}

.form-control-modern {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.form-control-modern::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-control-modern:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.input-group-modern:focus-within .input-icon {
    color: white;
}

/* ============================================
   BOTÓN DE LOGIN
============================================ */
.btn-login {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(75, 67, 102, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(75, 67, 102, 0.5);
}

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

.btn-login i {
    transition: transform 0.3s ease;
}

.btn-login:hover i {
    transform: translateX(4px);
}

/* ============================================
   ALERTAS MODERNAS
============================================ */
.alert-modern {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    animation: shake 0.5s;
    border-left: 4px solid rgba(255, 255, 255, 0.5);
}

.alert-danger.alert-modern {
    border-left-color: #ff6b6b;
}

.alert-warning.alert-modern {
    border-left-color: #ffd93d;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* ============================================
   FOOTER
============================================ */
.login-footer {
    padding: 1.5rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .login-title {
        font-size: 1.25rem;
    }

    .login-logo {
        height: 65px;
    }

    .form-control-modern {
        font-size: 16px;
        /* Evita zoom en iOS */
    }
}

/* ============================================
   AUTOCOMPLETE STYLING
============================================ */
.form-control-modern:-webkit-autofill,
.form-control-modern:-webkit-autofill:hover,
.form-control-modern:-webkit-autofill:focus {
    -webkit-text-fill-color: white;
    -webkit-box-shadow: 0 0 0px 1000px rgba(255, 255, 255, 0.15) inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* ============================================
   ACCESIBILIDAD
============================================ */
.btn-login:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

.form-control-modern:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}