/* ============ FACTURATX LOGIN PAGE STYLES - CORRIGIDO ============ */

.login-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--codetx-bg-secondary);
    color: var(--codetx-text-primary);
    overflow-x: hidden; /* Apenas para evitar rolagem horizontal indesejada */
    overflow-y: auto; /* Permitir rolagem vertical de toda a página se necessário */
    min-height: 100vh;
    position: relative;
    margin: 0;
    padding: 0;
}

/* ============ ANIMATED BACKGROUND ============ */
.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(59, 130, 246, 0.15) 25%, rgba(147, 197, 253, 0.1) 50%, rgba(219, 234, 254, 0.2) 75%, rgba(37, 99, 235, 0.1) 100% );
    overflow: hidden; /* Manter hidden para o background animado */
}

[data-theme="dark"] .login-background {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 41, 59, 0.9) 25%, rgba(51, 65, 85, 0.8) 50%, rgba(71, 85, 105, 0.9) 75%, rgba(15, 23, 42, 0.8) 100% );
}

/* ... (restante do código do background permanece igual) ... */

/* ============ MAIN CONTAINER - CORRIGIDO ============ */
.login-container {
    display: flex;
    align-items: center; /* Centralizar verticalmente o wrapper */
    justify-content: center;
    min-height: 100vh; /* Garantir que o container ocupe a altura total da viewport */
    padding: 20px;
    position: relative;
    z-index: 1;
    overflow: auto; /* Permitir que o login-container role se o conteúdo do wrapper for muito grande */
}

.login-wrapper {
    display: flex;
    max-width: 1200px;
    width: 100%;
    min-height: auto; /* Removida altura mínima fixa, deixamos o conteúdo determinar */
    height: auto; /* Ajusta a altura com base no conteúdo */
    border-radius: 20px;
    overflow: hidden; /* Manter hidden para o wrapper principal */
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideInUp 0.8s ease-out;
    margin: 20px 0; /* Adicionada margem para espaçamento */
}

/* ============ LOGIN CARD - CORRIGIDO ============ */
.login-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Alinhar conteúdo ao topo */
    position: relative;
    max-height: calc(100vh - 40px); /* Ajustar max-height para caber na tela com padding */
    overflow-y: auto; /* Adicionado scroll vertical quando necessário */
    min-width: 320px; /* Evita que o card fique muito pequeno */
}

[data-theme="dark"] .login-card {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============ SIDE PANEL - CORRIGIDO ============ */
.side-panel {
    flex: 1;
    background: #020024;
    background: linear-gradient(270deg, rgba(2, 0, 36, 1) 0%, rgba(0, 109, 176, 1) 100%);
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden; /* Manter hidden para o background do side-panel */
    max-height: calc(100vh - 40px); /* Ajustar max-height para caber na tela com padding */
}

/* ============ HEADER - CORRIGIDO ============ */
.login-header {
    text-align: center;
    margin-bottom: 30px;
}

/* ============ FORM STYLES - CORRIGIDO ============ */
/* Removido o estilo do login-form-container daqui. Ele será redefinido com a nova classe form-scroll-container. */

/* Personalizar a barra de scroll */
.login-card::-webkit-scrollbar,
.form-scroll-container::-webkit-scrollbar { /* Adicionar scrollbar ao login-card e form-scroll-container */
    width: 6px;
}

.login-card::-webkit-scrollbar-thumb,
.form-scroll-container::-webkit-scrollbar-thumb { /* Adicionar scrollbar ao login-card e form-scroll-container */
    background: var(--codetx-primary);
    border-radius: 3px;
}

/* ============ RESPONSIVE DESIGN - CORRIGIDO ============ */
@media (max-width: 1024px) {
    .login-wrapper {
        flex-direction: column; /* Empilhar cards em telas menores */
        max-width: 500px; /* Limitar largura para melhor leitura */
        margin: 20px auto; /* Centralizar e adicionar margem */
    }

    .side-panel {
        display: none; /* Esconder o side-panel em telas menores para otimizar espaço */
        /* Se você quiser que ele apareça abaixo do formulário em mobile, remova esta linha e ajuste o padding do wrapper e card */
    }

    .login-card {
        max-height: none; /* Remover altura máxima para permitir rolagem de todo o conteúdo */
        overflow-y: visible; /* Deixar o conteúdo rolar naturalmente */
        padding: 30px 20px;
    }

    /* Em mobile, o login-form-container não precisa de max-height fixa, o login-card já tem overflow-y:auto */
    .form-scroll-container {
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }
}

@media (max-width: 768px) {
    .login-container {
        padding: 10px;
        align-items: flex-start; /* Alinhar ao topo em mobile */
    }

    .login-card {
        padding: 25px 15px;
    }

    .login-header {
        margin-bottom: 20px;
    }

    .form-group {
        margin-bottom: 18px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 20px 12px;
        border-radius: 15px;
    }

    /* Ajustar tamanhos de fonte e padding para inputs e botões em telas muito pequenas */
    .login-input {
        padding: 12px 14px; /* Um pouco menor para caber melhor */
        font-size: 0.875rem;
    }

    .login-btn {
        padding: 12px 18px; /* Um pouco menor para caber melhor */
        font-size: 0.875rem;
    }

    .welcome-text h2 {
        font-size: 1.3rem;
    }

    .welcome-text p {
        font-size: 0.8rem;
    }

    .login-footer p, .login-footer a {
        font-size: 0.7rem;
    }
}

/* ============ ESTILOS ADICIONAIS PARA FORMULÁRIOS LONGOS ============ */
.form-scroll-container {
    max-height: 60vh; /* Altura máxima para o conteúdo do formulário antes de rolar */
    overflow-y: auto;
    padding-right: 5px; /* Espaço para a barra de rolagem */
}

.form-section {
    margin-bottom: 25px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--codetx-text-primary);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--codetx-border-color);
}

/* Melhorias para o tema escuro */
[data-theme="dark"] .section-title {
    color: var(--codetx-text-primary);
    border-bottom-color: var(--codetx-border-color);
}

/* Ajuste para o indicador de força de senha */
.password-strength-container {
    margin-top: 8px;
}

.password-strength {
    height: 5px;
    background: var(--codetx-border-color);
    border-radius: 3px;
    margin-bottom: 3px;
    overflow: hidden;
}

.strength-weak {
    background: #dc3545;
    width: 33%;
}

.strength-medium {
    background: #ffc107;
    width: 66%;
}

.strength-strong {
    background: #28a745;
    width: 100%;
}

.password-strength-text {
    font-size: 0.75rem;
    color: var(--codetx-text-muted);
}

/* Ajustes para o logo e texto do header */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    gap: 10px;
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: var(--codetx-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0;
    line-height: 1.2;
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--codetx-text-muted);
    margin-bottom: 0;
}

.welcome-text h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--codetx-text-primary);
}

.welcome-text p {
    font-size: 0.9rem;
    color: var(--codetx-text-secondary);
}

/* Estilos para os campos de formulário e botões */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--codetx-text-primary);
}

.input-wrapper {
    position: relative;
}

.login-input {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid var(--codetx-border-color);
    border-radius: var(--codetx-border-radius);
    background-color: var(--codetx-bg-primary);
    color: var(--codetx-text-primary);
    font-size: 0.9rem;
    transition: all 0.2s ease-in-out;
}

    .login-input:focus {
        border-color: var(--codetx-primary);
        box-shadow: 0 0 0 0.2rem rgba(var(--codetx-primary-rgb), 0.25);
        outline: none;
    }

.input-focus-border {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--codetx-primary);
    transition: all 0.2s ease-in-out;
    transform: translateX(-50%);
}

.login-input:focus + .input-focus-border {
    width: 100%;
}

.password-wrapper .login-input {
    padding-right: 50px; /* Espaço para o botão de toggle da senha */
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--codetx-text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.2s ease-in-out;
}

    .password-toggle:hover {
        color: var(--codetx-primary);
    }

    .password-toggle .hide-password {
        display: none;
    }

    .password-toggle.active .show-password {
        display: none;
    }

    .password-toggle.active .hide-password {
        display: inline-block;
    }

.validation-message {
    color: var(--codetx-danger);
    font-size: 0.75rem;
    margin-top: 5px;
    display: block;
}

.validation-summary {
    font-size: 0.875rem;
    padding: 12px 15px;
    border-radius: var(--codetx-border-radius);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--codetx-danger);
    background-color: rgba(var(--codetx-danger-rgb), 0.1);
    border: 1px solid rgba(var(--codetx-danger-rgb), 0.2);
}

    .validation-summary div {
        margin-bottom: 0;
    }

.checkbox-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.custom-checkbox .form-check-input {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1px solid var(--codetx-border-color);
    background-color: var(--codetx-bg-primary);
    margin-top: 0.15em;
    accent-color: var(--codetx-primary); /* Para mudar a cor do checkmark */
}

    .custom-checkbox .form-check-input:checked {
        background-color: var(--codetx-primary);
        border-color: var(--codetx-primary);
    }

.custom-checkbox .form-check-label {
    font-size: 0.85rem;
    color: var(--codetx-text-secondary);
    margin-left: 5px;
}

.forgot-password,
.terms-link {
    font-size: 0.85rem;
    color: var(--codetx-primary);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

    .forgot-password:hover,
    .terms-link:hover {
        color: color-mix(in srgb, var(--codetx-primary) 80%, black);
        text-decoration: underline;
    }

.login-btn {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--codetx-border-radius);
    background-color: var(--codetx-primary);
    color: white;
    border: none;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .login-btn:hover {
        background-color: color-mix(in srgb, var(--codetx-primary) 85%, black);
        transform: translateY(-2px);
        box-shadow: var(--codetx-shadow-md);
    }

    .login-btn:active {
        background-color: color-mix(in srgb, var(--codetx-primary) 80%, black);
        transform: translateY(0);
        box-shadow: none;
    }

.btn-loading {
    display: none;
}

.additional-options {
    text-align: center;
    margin-top: 30px;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0;
    color: var(--codetx-text-muted);
    font-size: 0.8rem;
}

    .divider::before,
    .divider::after {
        content: '';
        flex: 1;
        border-bottom: 1px solid var(--codetx-border-color);
    }

    .divider:not(:empty)::before {
        margin-right: 0.5em;
    }

    .divider:not(:empty)::after {
        margin-left: 0.5em;
    }

.register-link p {
    font-size: 0.9rem;
    color: var(--codetx-text-secondary);
    margin-bottom: 0;
}

.register-btn {
    color: var(--codetx-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease-in-out;
}

    .register-btn:hover {
        color: color-mix(in srgb, var(--codetx-primary) 80%, black);
        text-decoration: underline;
    }

.login-footer {
    margin-top: auto; /* Empurra o footer para o final do card */
    padding-top: 20px;
    border-top: 1px solid var(--codetx-border-color);
    text-align: center;
    font-size: 0.75rem;
    color: var(--codetx-text-muted);
}

    .login-footer p {
        margin-bottom: 10px;
    }

    .login-footer .footer-links a {
        color: var(--codetx-text-muted);
        text-decoration: none;
        margin: 0 8px;
        transition: color 0.2s ease-in-out;
    }

        .login-footer .footer-links a:hover {
            color: var(--codetx-primary);
            text-decoration: underline;
        }

/* Side Panel Info Styles */
.side-panel {
    color: white; /* Cor do texto no painel lateral */
}

.side-content {
    text-align: center;
    max-width: 300px;
}

.side-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.side-content h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.side-content p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.features-list {
    margin-bottom: 30px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.9;
}

    .feature-item i {
        color: #4ade80; /* Um verde vibrante para os ícones de check */
        font-size: 1.1rem;
    }

.company-info {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.company-stats {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.stat-item {
    text-align: center;
}

    .stat-item h4 {
        font-size: 1.8rem;
        font-weight: 700;
        margin-bottom: 5px;
    }

    .stat-item p {
        font-size: 0.8rem;
        opacity: 0.7;
        margin-bottom: 0;
    }

/* Theme Toggle Button */
.theme-toggle-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-toggle-btn {
    background: var(--codetx-bg-primary);
    color: var(--codetx-text-primary);
    border: 1px solid var(--codetx-border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--codetx-shadow-sm);
    transition: all 0.3s ease;
}

    .theme-toggle-btn:hover {
        transform: rotate(30deg) scale(1.05);
        box-shadow: var(--codetx-shadow-md);
    }

    .theme-toggle-btn .light-icon {
        display: block;
    }

    .theme-toggle-btn .dark-icon {
        display: none;
    }

[data-theme="dark"] .theme-toggle-btn .light-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle-btn .dark-icon {
    display: block;
    color: var(--codetx-primary);
}

/* Animações */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes moveParticles {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    25% {
        transform: translate(20px, 30px) scale(0.9);
        opacity: 0.8;
    }

    50% {
        transform: translate(-15px, 50px) scale(1.1);
        opacity: 0.6;
    }

    75% {
        transform: translate(30px, -20px) scale(0.8);
        opacity: 0.7;
    }

    100% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
}

.floating-particles .particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: moveParticles 15s infinite ease-in-out alternate;
    opacity: 0.5;
}

    .floating-particles .particle:nth-child(1) {
        width: 30px;
        height: 30px;
        left: 10%;
        top: 20%;
        animation-delay: 0s;
    }

    .floating-particles .particle:nth-child(2) {
        width: 40px;
        height: 40px;
        left: 70%;
        top: 50%;
        animation-delay: 2s;
    }

    .floating-particles .particle:nth-child(3) {
        width: 25px;
        height: 25px;
        left: 30%;
        top: 80%;
        animation-delay: 4s;
    }

    .floating-particles .particle:nth-child(4) {
        width: 35px;
        height: 35px;
        left: 85%;
        top: 10%;
        animation-delay: 6s;
    }

    .floating-particles .particle:nth-child(5) {
        width: 50px;
        height: 50px;
        left: 5%;
        top: 60%;
        animation-delay: 8s;
    }

    .floating-particles .particle:nth-child(6) {
        width: 20px;
        height: 20px;
        left: 90%;
        top: 70%;
        animation-delay: 10s;
    }

.bg-shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 20px;
    animation: float 10s ease-in-out infinite alternate;
}

    .bg-shape.shape-1 {
        width: 200px;
        height: 200px;
        top: 10%;
        left: 15%;
        transform: rotate(45deg);
        animation-delay: 0s;
    }

    .bg-shape.shape-2 {
        width: 150px;
        height: 150px;
        bottom: 20%;
        right: 10%;
        transform: rotate( -30deg);
        animation-delay: 2s;
    }

    .bg-shape.shape-3 {
        width: 250px;
        height: 250px;
        top: 40%;
        right: 20%;
        transform: rotate(60deg);
        animation-delay: 4s;
    }

    .bg-shape.shape-4 {
        width: 180px;
        height: 180px;
        bottom: 5%;
        left: 25%;
        transform: rotate(15deg);
        animation-delay: 6s;
    }
