@import url('https://fonts.googleapis.com/css2?family=Bakbak+One&family=DM+Sans:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0');

/* ==========================================================================
   1. CONFIGURAÇÕES GERAIS E VARIÁVEIS
   ========================================================================== */
:root {
    --primary-color: #3a160e;
    --secondary-color: #7E4422;
    --tertiary-color: #F7F8EA;
    --text-dark: #333;
    --text-light: #666;
    --success-color: #22c55e;
    --error-color: #ef4444; /* Adicionei para padronizar erros */

    --title-font-family: 'Bakbak One', cursive;
    --body-font-family: 'DM Sans', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-image: linear-gradient(rgba(58, 22, 14, 0.85), rgba(58, 22, 14, 0.95)), url('../../images/auth-background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--body-font-family);
    overflow-x: hidden; /* Evita rolagem lateral indesejada */
}

main {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box; /* Garante que padding não estoure width */
}

/* ==========================================================================
   2. CONTAINER PRINCIPAL (WRAPPER)
   ========================================================================== */
.auth-container {
    display: flex;
    width: 900px;
    max-width: 100%;
    min-height: 600px; /* Aumentei um pouco para dar respiro vertical */
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); /* Sombra mais suave e moderna */
    position: relative;
    background-color: var(--tertiary-color); /* Fundo base */
}

/* ==========================================================================
   3. BOTÃO VOLTAR (HOME)
   ========================================================================== */
.btn-back-homepage {
    position: absolute;
    top: 25px;
    left: 25px;
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 20;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px); /* Efeito vidro */
}

.btn-back-homepage:hover {
    background-color: white;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.material-symbols-outlined {
    font-size: 24px;
    line-height: 1; /* Centraliza melhor o ícone */
}

/* ==========================================================================
   4. LADO ESQUERDO (BRANDING/LOGO)
   ========================================================================== */
.auth-left {
    flex: 1; /* Ocupa ~45% */
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 40px;
    overflow: hidden; /* Para o círculo não vazar */
}

/* Decoração de Fundo (Círculo Sutil) */
.auth-left::before {
    content: '';
    position: absolute;
    width: 120%;
    padding-bottom: 120%; /* Cria um quadrado/círculo responsivo */
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.auth-logo-box img {
    width: 180px; /* Logo um pouco maior */
    height: auto;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.2));
    transition: transform 0.5s ease;
}

/* Efeito hover na logo (opcional, mas legal) */
.auth-container:hover .auth-logo-box img {
    transform: scale(1.05);
}

/* ==========================================================================
   5. LADO DIREITO (FORMULÁRIO)
   ========================================================================== */
.auth-right {
    flex: 1.3; /* Ocupa ~55% - Mais espaço para inputs */
    background-color: var(--tertiary-color);
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-header h3 {
    font-family: var(--title-font-family);
    font-size: 2.2rem;
    color: var(--primary-color);
    margin: 0 0 10px 0;
    line-height: 1.1;
}

.form-header p {
    color: var(--text-light);
    font-size: 1rem;
    margin: 0;
    line-height: 1.5;
}

/* ==========================================================================
   6. INPUTS E CAMPOS (Estilização Unificada)
   ========================================================================== */

/* Grupo de Input Padrão */
.input-group, .form-group { /* Adicionei .form-group para compatibilidade com Crispy */
    margin-bottom: 24px;
    width: 100%;
}

/* Labels */
.input-group label, .form-label {
    display: block;
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

/* Campos de Texto (Input, Select, Textarea) */
.input-group input, 
.form-control, 
select.form-control {
    width: 100%;
    background-color: white;
    border: 2px solid transparent; /* Borda transparente para não pular no focus */
    padding: 16px;
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-dark);
    font-family: var(--body-font-family);
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02); /* Sombra interna sutil */
    box-sizing: border-box; /* Crucial */
}

/* Foco no Campo */
.input-group input:focus, 
.form-control:focus {
    outline: none;
    background-color: white;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(126, 68, 34, 0.1); /* Anel de foco suave */
}

/* Layout de Linha (Lado a Lado) */
.form-row {
    display: flex;
    gap: 20px;
    width: 100%;
}

.form-row .input-group, 
.form-row .form-group {
    flex: 1; /* Garante 50% para cada */
}

/* ==========================================================================
   7. BOTÕES E LINKS
   ========================================================================== */

/* Botão de Ação Principal (Login/Cadastro) */
.btn-login, .btn-primary {
    width: 100%;
    display: block;
    text-align: center;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--body-font-family);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* Sombra 3D Sutil */
    box-shadow: 
        inset 0px 2px 2px rgba(255, 255, 255, 0.3),
        inset 0px -2px 5px rgba(0, 0, 0, 0.1),
        0 8px 20px rgba(126, 68, 34, 0.3);
    margin-top: 10px;
}

.btn-login:hover, .btn-primary:hover {
    transform: translateY(-3px);
    background-color: color-mix(in srgb, var(--secondary-color), black 10%);
    box-shadow: 
        inset 0px 2px 2px rgba(255, 255, 255, 0.3),
        0 12px 25px rgba(126, 68, 34, 0.4);
}

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

/* Links Auxiliares (Esqueci a senha) */
.form-actions {
    display: flex;
    justify-content: flex-end; /* Alinha à direita */
    margin-bottom: 25px;
    margin-top: -10px; /* Aproxima um pouco do input de senha */
}

.forgot-link {
    font-size: 0.9rem;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Footer do Form (Link Cadastro) */
.form-footer {
    text-align: center;
    margin-top: 35px;
    font-size: 0.95rem;
    color: var(--text-light);
}

.signup-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 800;
    margin-left: 4px;
}

.signup-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* ==========================================================================
   8. FEEDBACK E ÍCONES ESPECIAIS
   ========================================================================== */

/* Alerta de Erro */
.erro-alert, .alert-danger {
    background-color: #fff1f2;
    color: var(--error-color);
    padding: 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 25px;
    border: 1px solid #fecdd3;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Ícones de Sucesso (Ex: Email Enviado) */
.mail_read, .check_circle {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.mail_read { color: var(--secondary-color); }
.check_circle { color: var(--success-color); }

/* ==========================================================================
   9. RESPONSIVIDADE (MOBILE & TABLET)
   ========================================================================== */

@media (max-width: 900px) {
    /* Tablet: Ajusta largura para não ficar muito largo */
    .auth-container {
        width: 100%;
        max-width: 600px; /* Centraliza melhor */
        flex-direction: column; /* Empilha verticalmente */
        height: auto;
        min-height: auto;
    }

    /* Lado Esquerdo (Branding) no Mobile */
    .auth-left {
        min-height: 180px; /* Altura fixa menor */
        padding: 30px;
        flex: none; /* Remove flex grow */
    }

    /* Logo menor no mobile */
    .auth-logo-box img {
        width: 140px;
    }

    /* Lado Direito (Form) no Mobile */
    .auth-right {
        padding: 40px 30px; /* Menos padding lateral */
        flex: none;
    }

    /* Ajuste de Texto */
    .form-header h3 { font-size: 1.8rem; }
    
    /* Inputs empilhados se usar .form-row no mobile */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .input-group {
        margin-bottom: 20px;
    }
}