/* ============================================
   RESET E VARIÁVEIS
   ============================================ */
:root {
    --maple-red: #B31B1B;
    --maple-gold: #FFD700;
    --maple-white: #FFFFFF;
    --maple-gray: #F5F5F5;
    --maple-dark-gray: #333333;
    --maple-light-gray: #E0E0E0;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--maple-gray);
    color: var(--maple-dark-gray);
    line-height: 1.6;
}

/* ============================================
   TELA DE LOGIN
   ============================================ */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #B31B1B 0%, #8B0000 50%, #6B0000 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 960px;
    position: relative;
    z-index: 1;
}

.login-box {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    min-height: 540px;
}

.login-left {
    flex: 0 0 45%;
    background: linear-gradient(135deg, #f8f8f8 0%, #ffffff 100%);
    padding: 60px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #e0e0e0;
}

.logo-section {
    text-align: center;
}

.logo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.logo-bear {
    position: relative;
}

.bear-icon {
    font-size: 120px;
    filter: drop-shadow(0 4px 8px rgba(179, 27, 27, 0.2));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.logo-text-wrapper {
    text-align: center;
}

.brand-name {
    font-size: 2.8rem;
    font-weight: 700;
    color: #B31B1B;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: #666;
    font-weight: 600;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-right {
    flex: 1;
    padding: 60px 50px;
    display: flex;
    align-items: center;
}

.login-content {
    width: 100%;
}

.login-title {
    font-size: 1.6rem;
    color: #333;
    margin-bottom: 40px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

.login-form .form-group,
.forgot-form .form-group,
.reset-form .form-group {
    margin-bottom: 25px;
}

.login-form label,
.forgot-form label,
.reset-form label {
    display: block;
    margin-bottom: 10px;
    color: #555;
    font-weight: 500;
    font-size: 0.9rem;
}

.login-form label i,
.forgot-form label i,
.reset-form label i {
    margin-right: 6px;
    color: #B31B1B;
}

.input-wrapper {
    position: relative;
}

.login-form input,
.forgot-form input,
.reset-form input {
    width: 100%;
    padding: 14px 45px 14px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    background: #fafafa;
}

.login-form input:focus,
.forgot-form input:focus,
.reset-form input:focus {
    outline: none;
    border-color: #B31B1B;
    background: white;
    box-shadow: 0 0 0 4px rgba(179, 27, 27, 0.1);
}

.login-form input::placeholder,
.forgot-form input::placeholder,
.reset-form input::placeholder {
    color: #999;
}

.login-form input.error,
.forgot-form input.error,
.reset-form input.error {
    border-color: var(--danger);
    background: #fff5f5;
}

.input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
    z-index: 10;
}

.toggle-password:hover {
    color: #B31B1B;
}

.error-message {
    display: block;
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 6px;
    min-height: 18px;
    font-weight: 500;
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    margin-top: 10px;
}

.btn-login:hover {
    background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

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

.btn-login:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.login-footer {
    margin-top: 30px;
    text-align: center;
}

.login-footer p {
    color: #888;
    font-size: 0.85rem;
}

.login-footer i {
    color: #B31B1B;
    margin-right: 5px;
}

/* ============================================
   MODAIS
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--maple-white);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    color: var(--maple-red);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
}

.lgpd-modal {
    max-width: 720px;
    border-radius: 22px;
    padding: 34px 40px 30px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
}

.lgpd-modal-icon {
    display: none;
}

.lgpd-modal h3 {
    justify-content: flex-start;
    text-align: left;
    font-size: 2rem;
    font-weight: 800;
    color: #b91c1c;
    line-height: 1.2;
    margin-bottom: 20px;
}

.lgpd-modal h3 i {
    color: #b91c1c;
    font-size: 1.7rem;
}

.lgpd-modal .lgpd-content {
    margin-bottom: 20px;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

.lgpd-modal .lgpd-content p {
    margin: 0 0 14px;
    color: #4b5563;
    line-height: 1.45;
    font-size: 1.1rem;
}

.lgpd-modal .lgpd-content ul {
    margin: 0 0 16px;
    padding-left: 24px;
}

.lgpd-modal .lgpd-content li {
    margin-bottom: 8px;
    color: #5b5b5b;
    line-height: 1.45;
    font-size: 0.98rem;
}

.lgpd-modal .lgpd-content .lgpd-owner {
    margin-top: 8px;
    color: #4b5563;
    font-size: 0.98rem;
}

.lgpd-error {
    min-height: 20px;
    margin-bottom: 10px;
    text-align: left;
}

.lgpd-actions {
    justify-content: center;
}

.lgpd-actions .btn-login {
    width: auto;
    min-width: 220px;
    margin-top: 0;
    padding: 12px 26px;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 800;
    font-size: 1.02rem;
    border-radius: 10px;
    border: none;
    background: linear-gradient(180deg, #fcd34d 0%, #facc15 100%);
    color: #1f2937;
    box-shadow: 0 10px 22px rgba(250, 204, 21, 0.35);
}

.lgpd-actions .btn-login:hover {
    background: linear-gradient(180deg, #fde047 0%, #facc15 100%);
    box-shadow: 0 12px 24px rgba(250, 204, 21, 0.42);
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    padding: 12px 30px;
    background: var(--maple-gold);
    color: var(--maple-dark-gray);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: #E6C200;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Modal de Alerta */
.modal-alert {
    text-align: center;
    max-width: 400px;
}

.alert-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.alert-icon.success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.alert-icon.error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.alert-icon.warning {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning);
}

.alert-icon.info {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info);
}

.modal-alert h3 {
    margin-bottom: 15px;
    color: var(--maple-dark-gray);
}

.modal-alert p {
    margin-bottom: 25px;
    color: #666;
    line-height: 1.6;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #e5e5e5;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: #B31B1B;
    border-color: #B31B1B;
}

.forgot-modal {
    position: relative;
    max-width: 520px;
    border-radius: 18px;
    padding: 34px 34px 30px;
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfc 100%);
}

.forgot-modal-header h3 {
    margin-bottom: 10px;
    color: #B31B1B;
    font-size: 2rem;
}

.forgot-modal-header p {
    color: #626262;
    margin-bottom: 22px;
    font-size: 1.03rem;
    line-height: 1.5;
}

.forgot-form .input-wrapper {
    width: 100%;
}

.forgot-form .input-icon {
    color: #8b8b8b;
}

.forgot-form .form-group {
    margin-bottom: 18px;
}

.forgot-form .btn-login {
    margin-top: 10px;
    letter-spacing: 0.6px;
}

.forgot-general-error {
    text-align: center;
    margin: 4px 0 10px;
}

.forgot-success {
    text-align: center;
    padding-top: 6px;
}

.forgot-success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: rgba(40, 167, 69, 0.12);
    color: #28a745;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.forgot-success h4 {
    color: #1f7c34;
    margin-bottom: 10px;
}

.forgot-success p {
    color: #666;
    margin-bottom: 20px;
}

.mfa-prompt-modal {
    max-width: 500px;
}

.mfa-prompt-form .form-group {
    margin-bottom: 16px;
}

.mfa-prompt-actions {
    justify-content: flex-end;
    gap: 12px;
}

.mfa-prompt-actions .btn-primary {
    min-width: 120px;
}

.mfa-prompt-actions .btn-login {
    width: auto;
    min-width: 160px;
    margin-top: 0;
    padding: 12px 20px;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

/* ============================================
   REDEFINIÇÃO DE SENHA
   ============================================ */
.reset-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #B31B1B 0%, #8B0000 50%, #6B0000 100%);
    padding: 20px;
}

.reset-card {
    width: 100%;
    max-width: 560px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 42px 36px;
}

.reset-header {
    text-align: center;
    margin-bottom: 26px;
}

.reset-header h2 {
    color: #333;
    margin-bottom: 8px;
}

.reset-header p {
    color: #666;
}

.reset-form .form-group {
    margin-bottom: 18px;
}

.password-requirements {
    background: #fff8dd;
    border: 1px solid #ffe69c;
    border-radius: 10px;
    padding: 14px 16px;
    color: #7d5a00;
    margin: 16px 0 20px;
    font-size: 0.88rem;
}

.reset-state {
    text-align: center;
}

.reset-state-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.reset-state-icon.success {
    background: rgba(40, 167, 69, 0.12);
    color: #28a745;
}

.reset-state-icon.error {
    background: rgba(220, 53, 69, 0.12);
    color: #dc3545;
}

.reset-state h3 {
    color: #333;
    margin-bottom: 8px;
}

.reset-state p {
    color: #666;
    margin-bottom: 18px;
}

.reset-back-link {
    display: inline-block;
    margin-top: 18px;
    color: #B31B1B;
    font-weight: 600;
    text-decoration: none;
}

.reset-back-link:hover {
    text-decoration: underline;
}

/* Responsividade */
@media (max-width: 768px) {
    .login-box {
        flex-direction: column;
        min-height: auto;
    }
    
    .login-left {
        flex: none;
        padding: 40px 20px;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .bear-icon {
        font-size: 80px;
    }
    
    .brand-name {
        font-size: 2rem;
    }
    
    .brand-subtitle {
        font-size: 0.65rem;
    }
    
    .login-right {
        padding: 40px 30px;
    }
    
    .login-title {
        font-size: 1.3rem;
        margin-bottom: 30px;
    }

    .modal-content {
        padding: 30px 20px;
    }

    .forgot-modal {
        padding: 30px 22px 24px;
    }

    .lgpd-modal {
        padding: 24px 20px;
    }

    .lgpd-modal h3 {
        font-size: 1.45rem;
    }

    .lgpd-modal .lgpd-content p {
        font-size: 1rem;
    }

    .lgpd-modal .lgpd-content li {
        font-size: 0.93rem;
    }

    .lgpd-actions .btn-login {
        min-width: 0;
        width: 100%;
    }

    .forgot-modal-header h3 {
        font-size: 1.75rem;
    }

    .reset-card {
        padding: 30px 24px;
    }
}

/* Smartphones (até 480px) */
@media (max-width: 480px) {
    .login-right {
        padding: 30px 20px;
    }
    
    .login-left {
        padding: 30px 15px;
    }
    
    .bear-icon {
        font-size: 60px;
    }
    
    .brand-name {
        font-size: 1.6rem;
    }
    
    .login-title {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }
    
    .form-group input {
        font-size: 16px; /* Evita zoom automático no iOS */
        padding: 14px 16px;
    }
    
    .btn-login {
        padding: 14px;
        font-size: 1rem;
    }

    .forgot-modal {
        width: 92%;
        border-radius: 14px;
        padding: 24px 14px 20px;
    }

    .forgot-modal-header h3 {
        font-size: 1.55rem;
    }

    .forgot-modal-header p {
        font-size: 0.96rem;
    }

    .forgot-form .btn-login {
        font-size: 0.94rem;
        letter-spacing: 0.3px;
    }

    .mfa-prompt-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .mfa-prompt-actions .btn-login,
    .mfa-prompt-actions .btn-primary {
        width: 100%;
        min-width: 0;
    }
    
    .brand-subtitle {
        font-size: 0.6rem;
    }

    .reset-card {
        padding: 24px 18px;
    }
}
