/* ==========================================================================
   VARIÁVEIS DE DESIGN SYSTEM (ALINHADO COM A DASHBOARD)
   ========================================================================== */
:root {
    --primary-color: #10b981;    /* Esmeralda */
    --primary-hover: #059669;
    --bg-body: #0f172a;          /* Cinza azulado bem escuro */
    --bg-card: #1e293b;          /* Fundo do Container */
    --text-main: #f8fafc;        /* Azul ardósia claro */
    --text-label: #94a3b8;
    --border-color: #334155;
    --error-color: #f87171;      /* Vermelho de validação */
}

/* Base da Página de Login */
.login-body {
    background-color: var(--bg-body);
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    box-sizing: border-box;
}

/* Container do Card Principal */
.login-container {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 440px;
    padding: 2.5rem 2rem;
    border-radius: 24px;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    animation: loginCardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Cabeçalho / Identidade */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

/* ==========================================================================
   AJUSTE DA NOVA LOGO OFICIAL (FIDELIDADE A MONETO.PNG)
   ========================================================================== */
.login-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-brand-img {
    width: 180px;
    height: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 4px 20px rgb(254, 250, 250)); 
}

.login-title {
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.01em;
}

.login-subtitle {
    color: var(--text-label);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

/* Formulário e Inputs */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-label {
    color: var(--text-label);
    font-size: 0.85rem;
    font-weight: 600;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-label);
    width: 18px;
    height: 18px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.input-field {
    width: 100%;
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.8rem 1rem 0.8rem 42px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* Estados de Foco */
.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
    background-color: rgba(15, 23, 42, 0.6);
}

.input-field:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary-color);
}

/* Botão de Mostrar Senha */
.toggle-password-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-label);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.toggle-password-btn:hover {
    color: var(--text-main);
}

.toggle-password-btn svg {
    width: 18px;
    height: 18px;
}

/* Links */
.forgot-password-link, 
.signup-link {
    color: var(--text-label);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-password-link:hover, 
.signup-link:hover {
    color: var(--primary-color);
}

/* Botão de Submit Principal */
.login-btn-submit {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 0.9rem 1.2rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 0.5rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.login-btn-submit:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.login-btn-submit:active {
    transform: scale(0.98);
}

.login-btn-submit svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.login-btn-submit:hover svg {
    transform: translateX(2px);
}

/* Mensagens e Alertas de Validação */
.error-message {
    color: var(--error-color);
    font-size: 0.75rem;
    font-weight: 500;
    display: none;
    margin-top: 2px;
}

.input-group.has-error .input-field {
    border-color: var(--error-color);
}

.input-group.has-error .error-message {
    display: block;
}

.form-alert-global {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--error-color);
    font-size: 0.85rem;
    font-weight: 500;
}

.form-alert-global svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.hidden {
    display: none !important;
}

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

.login-footer p {
    color: var(--text-label);
    font-size: 0.85rem;
    margin: 0;
}

/* Animações */
@keyframes loginCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsividade Mobile */
@media (max-width: 480px) {
    .login-body {
        padding: 1rem;
    }
    .login-container {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }
}

/* ==========================================================================
   SISTEMA DE NOTIFICAÇÕES (TOAST NOTIFICATIONS)
   ========================================================================== */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999; /* Z-Index altíssimo para sobrepor modais e overlays */
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none; /* Não bloqueia cliques na tela de fundo */
}

.moneto-toast {
    pointer-events: auto; /* Permite interações diretas com o toast */
    min-width: 300px;
    max-width: 400px;
    padding: 14px 18px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.85); /* Efeito glassmorphism escuro */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    animation: toast-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: all 0.3s ease;
}

/* Variações Visuais de Acordo com o Tipo */
.moneto-toast.success {
    border-left: 4px solid #10b981; /* Verde esmeralda */
}

.moneto-toast.error {
    border-left: 4px solid #f43f5e; /* Rosa/Vermelho vibrante */
}

.moneto-toast.warning {
    border-left: 4px solid #f59e0b; /* Âmbar */
}

/* Animações de Entrada e Saída */
@keyframes toast-slide-in {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.moneto-toast.fade-out {
    transform: translateX(120%);
    opacity: 0;
}


/* ==========================================================================
   MODAL DE CADASTRO INTERATIVO (DESIGN SYSTEM MONETO)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.75); /* Fundo escuro com opacidade */
    backdrop-filter: blur(6px); /* Efeito blur moderno na tela de fundo */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1.5rem;
    box-sizing: border-box;
    
    /* Estado Inicial Oculto */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estado Ativo do Modal */
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    padding: 2.2rem;
    box-sizing: border-box;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);

    /* Animação Elástica de Entrada */
    transform: scale(0.9) translateY(-15px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-card {
    transform: scale(1) translateY(0);
}

/* Botão Fechar (X) */
.modal-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-label);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.modal-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.modal-close-btn svg {
    width: 20px;
    height: 20px;
}

/* Cabeçalho */
.modal-header {
    margin-bottom: 1.8rem;
}

.modal-title {
    color: var(--text-main);
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.modal-subtitle {
    color: var(--text-label);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

/* Formulário e Inputs */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 480px) {
    .form-row-grid {
        grid-template-columns: 1fr; /* Responsividade para celulares */
        gap: 1.25rem;
    }
    .modal-card {
        padding: 1.5rem;
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-label {
    color: var(--text-label);
    font-size: 0.85rem;
    font-weight: 500;
}

.form-input {
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Feedbacks Visuais Interativos dos Campos */
.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Classes utilitárias preparadas para futuras validações JS */
.form-input.is-valid {
    border-color: var(--primary-color);
}
.form-input.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Botão de Criação de Conta */
.btn-submit-register {
    background-color: var(--primary-color);
    color: var(--text-main);
    border: none;
    border-radius: 10px;
    padding: 0.85rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-submit-register:hover {
    background-color: var(--primary-hover);
}

.btn-submit-register:active {
    transform: scale(0.98);
}

/* ==========================================================================
   BOTÃO DE VISUALIZAR SENHA NO CADASTRO
   ========================================================================== */
.input-password-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

/* Garante que o input ocupe todo o espaço e dê respiro para o ícone no final */
.input-password-wrapper .form-input {
    width: 100%;
    padding-right: 2.8rem; /* Abre espaço para o olho não cobrir os pontos da senha */
}

.toggle-reg-password {
    position: absolute;
    right: 0.8rem;
    background: transparent;
    border: none;
    color: var(--text-label);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}

.toggle-reg-password:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.toggle-reg-password:active {
    transform: scale(0.92);
}

.toggle-reg-password svg {
    width: 18px;
    height: 18px;
    pointer-events: none; /* Impede que o clique pegue na tag SVG interna */
}

/* Rodapé do Modal */
.modal-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.footer-text {
    color: var(--text-label);
    font-size: 0.85rem;
    margin: 0;
}

.link-return-login {
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease;
}

.link-return-login:hover {
    color: var(--primary-hover);
}