/* css/login.css - v3.3 (Correção Scroll Mobile + Z-Index Ícones) */

/* 1. RESET BÁSICO E SCROLLBAR */
*, *::before, *::after {
    box-sizing: border-box;
}

/* --- Scrollbar Personalizado --- */
::-webkit-scrollbar {
    width: 6px; 
}

::-webkit-scrollbar-track {
    background: #0b1116; 
}

::-webkit-scrollbar-thumb {
    background: #1f2933; 
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00e676; 
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    max-width: 100vw; 
    background-color: var(--bg-deep, #0b1116);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden; /* TRAVA GERAL */
}

/* --- Layout Split Screen --- */
.split-screen-container {
    display: flex;
    width: 100%;
    height: 100vh;
    flex-direction: row;
    overflow-x: hidden;
}

/* --- Lado Esquerdo (Visual) --- */
.visual-pane {
    flex: 1.2;
    height: 100%;
    background: radial-gradient(circle at center, #1a232e 0%, #0b1116 100%);
    position: relative;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden; /* Corta os efeitos que vazam */
}

.pane-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.visual-logo img { height: 50px; }
.visual-text h1 { font-size: 3.5rem; line-height: 1.1; margin-bottom: 1.5rem; color: #fff; }
.visual-text p { font-size: 1.1rem; color: #8b949e; max-width: 400px; }

/* Efeitos de Fundo */
.visual-bg-effects {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    top: -10%; right: -10%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(0, 230, 118, 0.08) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
}

.grid-lines {
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    width: 100%; height: 100%; opacity: 0.5;
}

/* --- Lado Direito (Formulário) --- */
.form-pane {
    flex: 0.8;
    background-color: #0d1117; 
    
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: center;
    
    padding: clamp(1rem, 3vh, 2rem); 
    position: relative;
    
    height: 100%;        
    overflow-y: auto;    
    overflow-x: hidden; /* Importante para não vazar animações */
}

.auth-wrapper {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    animation: slideInRight 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    z-index: 5; /* Garante que o form fique acima dos efeitos de fundo mobile */
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.mobile-logo { display: none; }

.auth-header { margin-bottom: 2rem; }
.auth-header h2 { font-size: 2rem; margin-bottom: 0.5rem; color: #fff; }
.auth-header p { color: #8b949e; }

/* --- Inputs & Correção de Ícones --- */
.modern-form .input-group { margin-bottom: 1.2rem; }
.modern-form label { display: block; margin-bottom: 0.4rem; font-size: 0.9rem; font-weight: 500; color: #fff; }

.input-wrapper { 
    position: relative; 
    isolation: isolate; /* Cria novo contexto de empilhamento */
}

.input-icon { 
    position: absolute; 
    left: 1rem; 
    top: 50%; 
    transform: translateY(-50%); 
    color: #8b949e; 
    transition: 0.3s;
    /* FIX: Z-Index alto para ficar acima do background do input (Autofill) */
    z-index: 10; 
    pointer-events: none; /* Permite clicar através do ícone */
}

.modern-form input {
    width: 100%;
    padding: 1rem 1rem 1rem 2.8rem;
    background: rgba(21, 27, 35, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
    /* Contexto relativo */
    position: relative;
    z-index: 1; 
}

/* Autofill Fix para Webkit (Chrome/Safari) */
.modern-form input:-webkit-autofill,
.modern-form input:-webkit-autofill:hover, 
.modern-form input:-webkit-autofill:focus, 
.modern-form input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(21, 27, 35, 0.9) inset !important;
    -webkit-text-fill-color: #fff !important;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: #fff;
}

.modern-form input:focus {
    outline: none; border-color: #00e676; 
    background: rgba(21, 27, 35, 0.8);
    box-shadow: 0 0 0 4px rgba(0, 230, 118, 0.1);
}

/* Selector ajustado para o foco */
.modern-form input:focus ~ .input-icon, 
.modern-form input:not(:placeholder-shown) ~ .input-icon { 
    color: #00e676; 
}

/* Como o ícone está ANTES do input no HTML (em alguns casos) ou DEPOIS, 
   o seletor ~ funciona se o ícone estiver DEPOIS. 
   Se estiver ANTES, usamos focus-within no wrapper */
.input-wrapper:focus-within .input-icon {
    color: #00e676;
}

/* Animação de Erro (Shake) */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
.shake-error {
    animation: shake 0.4s ease-in-out;
    border: 1px solid #ff5252 !important;
    border-radius: 12px;
}

.toggle-password {
    position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: #8b949e;
    cursor: pointer; font-size: 0.9rem; padding: 5px;
    z-index: 10;
}
.toggle-password:hover { color: #fff; }

.forgot-wrapper { display: flex; justify-content: flex-end; margin-top: 0.5rem; }
.forgot-link { font-size: 0.85rem; color: #8b949e; text-decoration: none; }
.forgot-link:hover { color: #00e676; text-decoration: underline; }

/* --- Botões --- */
.btn-primary {
    background-color: #00e676;
    color: #000;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s, box-shadow 0.2s;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 1rem;
}

.btn-primary:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.4); 
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.5);
}

.btn-block {
    width: 100%;
    background-color: #00e676;
    color: #000;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-block:hover { 
    transform: scale(1.02); 
    filter: brightness(1.1); 
}

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

/* --- Footer --- */
.auth-footer {
    margin-top: 2rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.5rem;
}

.auth-footer p { color: #8b949e; font-size: 0.95rem; margin-bottom: 0.8rem;}
.register-link { color: #00e676; font-weight: 600; text-decoration: none; }

.legal-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
}

.legal-links a { color: #8b949e; opacity: 0.6; transition: 0.3s; text-decoration: none; }
.legal-links a:hover { opacity: 1; color: #fff; text-decoration: underline; }
.separator { color: #8b949e; opacity: 0.3; }

/* --- SISTEMA DE NOTIFICAÇÃO --- */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #1f2933;
    color: #fff;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    border-left: 4px solid transparent;
}

.notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-message {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
}

.notification.success {
    background: rgba(20, 30, 25, 0.95);
    border-left-color: #00e676;
    border: 1px solid rgba(0, 230, 118, 0.2);
}
.notification.success .notification-icon { color: #00e676; }

.notification.error {
    background: rgba(40, 20, 20, 0.95);
    border-left-color: #ff5252;
    border: 1px solid rgba(255, 82, 82, 0.2);
}
.notification.error .notification-icon { color: #ff5252; }

/* --- Responsividade Mobile (App Style) --- */
@media (max-width: 900px) {
    html, body { 
        overflow: hidden; 
        height: 100%;
        background-color: #0b1116;
    }

    .split-screen-container {
        flex-direction: column;
        height: 100dvh; 
        overflow-x: hidden; /* Garante que não role para os lados */
    }

    .visual-pane { display: none; }

    .form-pane {
        flex: 1;
        height: 100dvh;
        min-height: 100dvh;
        padding: 1.5rem;
        
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        
        background: radial-gradient(circle at top right, #1c2530 0%, #0b1116 60%);
        position: relative;
        overflow-y: auto; 
        overflow-x: hidden; /* CORREÇÃO FUNDAMENTAL: Corta tudo que sai na horizontal */
        width: 100%; /* Garante largura exata */
    }

    /* Efeito de Glow no fundo */
    .form-pane::before {
        content: '';
        position: absolute;
        top: -100px;
        right: -50px; /* Isso estava causando o scroll horizontal */
        width: 300px;
        height: 300px;
        background: radial-gradient(circle, rgba(0, 230, 118, 0.15) 0%, transparent 70%);
        filter: blur(50px);
        pointer-events: none;
        z-index: 0;
    }

    /* Grid sutil no fundo */
    .form-pane::after {
        content: '';
        position: absolute;
        top: 0; left: 0; width: 100%; height: 100%;
        background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                          linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
        background-size: 40px 40px;
        opacity: 0.3;
        pointer-events: none;
        z-index: 0;
    }

    .auth-wrapper {
        z-index: 2; /* Acima do fundo */
        margin: auto 0;
        width: 100%;
        max-width: 100%;
    }

    .mobile-logo { 
        display: block; 
        text-align: center; 
        margin-bottom: 1rem;
        padding-top: 1rem;
    }
    
    .mobile-logo img { 
        height: 40px; 
        filter: drop-shadow(0 0 10px rgba(0, 230, 118, 0.3));
    }

    .auth-header { 
        text-align: center; 
        margin-bottom: 1.5rem;
    }
    
    .modern-form input {
        background: rgba(21, 27, 35, 0.7);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .auth-footer {
        z-index: 2;
        margin-top: 1rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
        border-top: none;
    }

    .notification {
        width: 92%;
        right: 4%;
        top: 20px;
        flex-direction: row;
        text-align: left;
        padding: 12px 16px;
        background: rgba(31, 41, 51, 0.95);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255,255,255,0.1);
    }
}

/* --- Modal de Recuperação --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(5px);
    z-index: 3000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: 0.3s;
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal-box {
    background: #151b23;
    width: 90%; max-width: 400px;
    padding: 2rem; border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: translateY(20px); transition: 0.3s;
}

.modal-overlay.open .modal-box { transform: translateY(0); }

.modal-close {
    position: absolute; top: 1rem; right: 1rem;
    background: none; border: none; color: #8b949e;
    font-size: 1.5rem; cursor: pointer;
}

.modal-header { text-align: center; margin-bottom: 1.5rem; }
.modal-header h3 { color: #fff; margin: 0 0 0.5rem 0; }
.modal-header p { color: #8b949e; font-size: 0.9rem; margin: 0; }

.recover-step { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.resend-wrapper { text-align: center; margin-top: 10px; }
.btn-text { background: none; border: none; color: #8b949e; cursor: pointer; font-size: 0.9rem; text-decoration: underline; }
.btn-text:hover { color: #fff; }