@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

* {
    box-sizing: border-box; 
}

:root {
    --brand-grad: linear-gradient(135deg, #FF007A, #7928CA);
    --glass-bg: rgba(255, 255, 255, 0.85);
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    display: flex;
    justify-content: center;
    /* Mudamos de 'center' para 'flex-start' */
    align-items: flex-start; 
    min-height: 100vh;
    background: linear-gradient(-45deg, #FF007A, #7928CA, #00D4FF, #FFDF00);
    background-size: 400% 400%;
    animation: gradientBG 10s ease infinite;
    
    /* A MÁGICA ESTÁ AQUI: Permite o scroll na tela se ela for muito baixa */
    overflow-y: auto; 
    overflow-x: hidden;
    padding: 20px; 
}

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

.login-container {
    /* NOVA MÁGICA AQUI: O 'margin: auto' centraliza o card perfeitamente, mas destrava o scroll se a tela for muito pequena */
    margin: auto; 

    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    width: 100%;
    max-width: 450px;
    padding: 40px; /* Reduzido de 50px para o card ficar mais compacto */
    border-radius: 40px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3), inset 0 0 0 2px rgba(255,255,255,0.5);
    transform: translateY(0);
    animation: float 6s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); } /* Movimento suavizado para não vazar muito em telas pequenas */
}

.login-header {
    text-align: center;
    margin-bottom: 25px; /* Reduzido de 40px */
}

.login-header img {
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.login-header img:hover { transform: scale(1.1) rotate(-3deg); }

.form-group { margin-bottom: 20px; position: relative; } /* Reduzido de 30px */

.form-group label {
    display: block; margin-bottom: 10px; color: #1e293b;
    font-weight: 800; font-size: 1rem; text-transform: uppercase; letter-spacing: 1px;
}

.form-group input {
    width: 100%; 
    padding: 16px 50px; /* Reduzido levemente para economizar altura */
    border: none; border-radius: 20px; font-size: 1.1rem;
    font-family: 'Outfit', sans-serif; font-weight: 600; color: #334155;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05), inset 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group i.icon-left {
    position: absolute; bottom: 18px; left: 20px;
    color: #FF007A; font-size: 1.2rem; transition: all 0.3s;
}

.form-group i.toggle-password {
    position: absolute; bottom: 18px; right: 20px;
    color: #64748b; font-size: 1.2rem; cursor: pointer; transition: all 0.3s;
}

.form-group i.toggle-password:hover {
    color: #FF007A;
}

.form-group input:focus {
    outline: none; background: #ffffff;
    box-shadow: 0 0 0 4px rgba(121, 40, 202, 0.3), 0 15px 25px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.btn-primary {
    width: 100%; background: var(--brand-grad); color: white;
    padding: 18px; border: none; border-radius: 20px;
    font-size: 1.2rem; font-weight: 800; text-transform: uppercase;
    cursor: pointer; transition: all 0.3s ease;
    box-shadow: 0 15px 30px rgba(121, 40, 202, 0.4);
    display: flex; justify-content: center; align-items: center; gap: 12px;
}

.btn-primary:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(255, 0, 122, 0.5);
}

.error-msg {
    background: linear-gradient(to right, #ff416c, #ff4b2b); color: white;
    padding: 15px; border-radius: 15px; font-weight: 800; font-size: 1rem;
    margin-bottom: 20px; text-align: center; box-shadow: 0 10px 20px rgba(255, 65, 108, 0.3);
    display: none; animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-msg {
    background: linear-gradient(to right, #00F260, #0575E6); color: white;
    padding: 15px; border-radius: 15px; font-weight: 800; font-size: 1rem;
    margin-bottom: 20px; text-align: center; box-shadow: 0 10px 20px rgba(0, 242, 96, 0.3);
    display: none; animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn { 0% { opacity: 0; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1); } }

/* Formulário / Modal Invisível de Esqueci a Senha */
.forgot-password-panel {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    display: flex; flex-direction: column; justify-content: center;
    padding: 40px;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}
.forgot-password-panel.open {
    transform: translateX(0);
}

.btn-secondary {
    width: 100%; background: #e2e8f0; color: #475569;
    padding: 18px; border: none; border-radius: 20px;
    font-size: 1rem; font-weight: 800; text-transform: uppercase;
    cursor: pointer; transition: all 0.3s ease; margin-top: 15px;
}
.btn-secondary:hover { background: #cbd5e1; color: #1e293b; }

/* 📱 RESPONSIVIDADE MOBILE: LOGIN */
@media (max-width: 480px) {
    .login-container {
        padding: 30px 25px;
        border-radius: 30px;
    }
    .forgot-password-panel {
        padding: 30px 25px;
    }
    .login-header img {
        max-width: 180px !important;
    }
    .form-group input {
        padding: 15px 50px;
        font-size: 1rem;
    }
    .form-group label {
        font-size: 0.9rem;
    }
    .btn-primary, .btn-secondary {
        padding: 15px;
        font-size: 1rem;
    }
}