/* ==========================================================================
   CRESCERE - Folha de Estilos de Autenticação (Login, Register, Forgot)
   Foco: Mobile-First & Fully Responsive
   ========================================================================== */

/* --- 1. VARIÁVEIS GLOBAIS (Cores e Padrões) --- */
:root {
    /* Tons de Verde (Fundo) */
    --crescere-green-top: #a565fe;
    --crescere-green-bottom: #081c0e;
    
    /* Tons de Dourado (Destaque e Botões) */
    --crescere-gold-main: #f2c94c;
    --crescere-gold-dark: #cca42b;
    --crescere-gold-light: #fce488;
    
    /* Textos e Neutros */
    --crescere-text-dark: #333333;
    --crescere-text-light: #ffffff;
    --crescere-gray: #999999;
    --crescere-bg-card: #ffffff;
    
    /* Alertas */
    --color-error: #e74c3c;
    --color-success: #2ecc71;
}

/* --- 2. RESET E CONFIGURAÇÕES BÁSICAS --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(180deg, var(--crescere-green-top) 0%, var(--crescere-green-bottom) 100%);
    background-attachment: fixed;
    color: #a565fe;
    /* Usa dvh (dynamic viewport height) para ignorar a barra do navegador mobile */
    min-height: 100vh;
    min-height: 100dvh; 
    display: flex;
    flex-direction: column;
    align-items: center;
    /* justify-content: center aqui corta o topo em telas pequenas. Usamos padding e margin auto em vez disso. */
    padding: 40px 15px; 
    overflow-x: hidden;
    overflow-y: auto;
}

/* --- 3. TIPOGRAFIA (Títulos e Textos) --- */
h1, h2, h3, h4 {
    margin-bottom: 10px;
    font-weight: 600;
}

p {
    line-height: 1.5;
    margin-bottom: 15px;
}

a {
    color: var(--crescere-gold-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--crescere-gold-main);
}

/* --- 4. CABEÇALHO E LOGO --- */
.header {
    text-align: center;
    margin-bottom: 25px;
    width: 100%;
    margin-top: auto; /* Empurra pro centro junto com o card */
}

.logo {
    width: 130px;
    margin-bottom: 10px;
    mix-blend-mode: screen; 
}

.header h1 {
    font-size: 24px;
    letter-spacing: 0.5px;
}

.header p {
    color: var(--crescere-gold-main);
    font-size: 18px;
    margin-top: 5px;
    font-weight: 400;
}

/* --- 5. CARTÃO PRINCIPAL (Container Branco) --- */
.login-card {
    background-color: var(--crescere-bg-card);
    width: 100%; 
    max-width: 420px; /* Um pouco mais largo para acomodar bem em tablets */
    border-radius: 20px;
    padding: 30px 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    color: var(--crescere-text-dark);
    margin-bottom: auto; /* Trabalha com o margin-top do header para centralizar verticalmente sem cortar */
}

/* --- 6. ABAS (Tabs) --- */
.tabs {
    display: flex;
    border-bottom: 1px solid #eeeeee;
    margin-bottom: 25px;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 12px 5px;
    color: var(--crescere-gray);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: 0.3s ease;
    white-space: nowrap; /* Evita que o texto quebre em duas linhas no mobile */
}

.tab.active {
    color: var(--crescere-gold-dark);
    border-bottom: 3px solid var(--crescere-gold-dark);
}

/* --- 7. FORMULÁRIOS E INPUTS --- */
.form-box {
    display: none;
    animation: fadeIn 0.3s ease;
}

.form-box.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.input-group {
    position: relative;
    margin-bottom: 16px;
}

.input-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--crescere-gold-dark);
    font-size: 18px;
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 1px solid #dddddd;
    border-radius: 12px;
    font-size: 15px;
    color: var(--crescere-text-dark);
    background-color: #fafafa;
    outline: none;
    transition: all 0.3s;
}

.input-group input:focus {
    border-color: var(--crescere-gold-dark);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.2);
}

.input-group input::placeholder {
    color: var(--crescere-gray);
}

.code-input {
    text-align: center;
    font-size: 20px !important;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding-left: 15px !important; 
    font-weight: bold;
}

/* --- 8. BOTÕES --- */
.btn {
    width: 100%;
    background-color: var(--crescere-gold-main);
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    border: none;
    border-radius: 30px;
    padding: 15px;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 8px 20px rgba(242, 201, 76, 0.4);
    transition: transform 0.2s, background-color 0.2s;
}

.btn:active {
    transform: scale(0.98);
    background-color: var(--crescere-gold-dark);
}

.btn-outline {
    background-color: transparent;
    color: var(--crescere-gold-dark);
    border: 2px solid var(--crescere-gold-main);
    box-shadow: none;
}

/* --- 9. LINKS E RODAPÉ --- */
.links-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.links-container a {
    font-size: 14px;
}

/* --- 10. MENSAGENS E ALERTAS --- */
#msg, .alert {
    text-align: center;
    margin-top: 15px;
    font-weight: 600;
    font-size: 14px;
    padding: 10px;
    border-radius: 8px;
}

.alert-error {
    color: var(--color-error);
    background-color: rgba(231, 76, 60, 0.1);
}

.alert-success {
    color: var(--color-success);
    background-color: rgba(46, 204, 113, 0.1);
}

/* --- 11. TABELAS --- */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 15px;
    margin-bottom: 15px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

table th {
    background-color: var(--crescere-gold-light);
    color: var(--crescere-text-dark);
    padding: 12px;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #eeeeee;
    color: var(--crescere-text-dark);
}

table tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   12. RESPONSIVIDADE (MEDIA QUERIES)
   ========================================================================== */

/* Telas muito pequenas (ex: iPhone SE, Galaxy Fold dobrado) */
@media (max-width: 375px) {
    body {
        padding: 20px 10px; /* Reduz padding lateral e vertical */
    }
    
    .login-card {
        padding: 25px 15px; /* Ganha espaço interno */
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .tab {
        font-size: 14px;
        padding: 10px 0;
    }
    
    .input-group input {
        padding: 12px 12px 12px 40px; /* Inputs ligeiramente menores */
        font-size: 14px;
    }
    
    .btn {
        padding: 14px;
        font-size: 15px;
    }
}

/* Tablets (iPad, Galaxy Tab) */
@media (min-width: 768px) {
    body {
        padding: 50px 20px;
    }

    .login-card {
        padding: 40px 35px; /* Respira mais no tablet */
        max-width: 450px;
    }
    
    .logo {
        width: 160px;
    }
    
    .header h1 {
        font-size: 28px;
    }
}