/* ==================== FONDO ANIMADO ==================== */
body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==================== CONTAINER ==================== */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ==================== LOGIN BOX CON GLASSMORPHISM ==================== */
.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 45px 40px;
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37),
                0 20px 60px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    animation: fadeInScale 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==================== LOGO ==================== */
.logo {
    max-width: 180px;
    height: auto;
    margin: 0 auto;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

/* ==================== TIPOGRAFÍA ==================== */
h2 {
    color: #2d3748;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.text-muted {
    color: #718096 !important;
    font-size: 0.95rem;
}

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

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 1.1rem;
    z-index: 2;
    transition: color 0.3s ease;
}

.form-control {
    border-radius: 12px;
    padding: 14px 20px 14px 48px;
    border: 2px solid #e2e8f0;
    background-color: #f7fafc;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: #667eea;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* Icono izquierdo: se resalta cuando el input tiene foco (selector correcto vía padre) */
.input-group-custom:focus-within .input-icon {
    color: #667eea;
}

/* Espacio a la derecha cuando hay toggle (ojo de contraseña) */
.input-group-password .form-control,
.input-group-custom:has(.toggle-password) .form-control {
    padding-right: 48px;
}

/* ==================== TOGGLE PASSWORD ==================== */
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    cursor: pointer;
    font-size: 1.1rem;
    z-index: 2;
    transition: color 0.3s ease;
    background: none;
    border: none;
    padding: 8px;
    line-height: 1;
}

.toggle-password:hover {
    color: #667eea;
}

.toggle-password i {
    display: block;
}

/* ==================== CHECKBOX PERSONALIZADO ==================== */
.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.form-check-label {
    font-size: 0.9rem;
    color: #4a5568;
    cursor: pointer;
    user-select: none;
}

/* ==================== BOTÓN PRIMARY ==================== */
.btn-primary {
    border-radius: 12px;
    padding: 14px 24px;
    font-weight: 600;
    font-size: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

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

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-primary:disabled:hover {
    transform: none;
}

/* ==================== OPCIONES (Recordarme / Olvidé contraseña) ==================== */
.login-options-row {
    margin-top: 0.25rem;
}

/* ==================== SEPARADOR ==================== */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #a0aec0;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.divider span {
    padding: 0 15px;
    font-weight: 500;
}

/* ==================== MENSAJE DE ERROR ==================== */
.error-message {
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border-left: 4px solid #f56565;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== GOOGLE BUTTON ==================== */
.g_id_signin {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
    min-height: 44px;
}

/* ==================== LINKS ==================== */
a {
    transition: color 0.3s ease;
    font-weight: 500;
}

a:hover {
    color: #764ba2 !important;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 576px) {
    .login-box {
        padding: 30px 25px;
        border-radius: 15px;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .logo {
        max-width: 150px;
    }
    
    .form-control {
        padding: 12px 16px 12px 44px;
        font-size: 0.9rem;
    }
    
    .btn-primary {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}