/* public_html/assets/css/auth.css */
/* VERSÃO SEM ROLAGEM - ALTURA DIMINUÍDA - ESPAÇO OTIMIZADO */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

/* RESET RADICAL - ZERO ROLAGEM */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    background: #ffffff;
    color: #1a1a2e;
    line-height: 1.4;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

/* CONTAINER PRINCIPAL - FIXO NA TELA */
.auth-container {
    width: 100%;
    max-width: 500px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    position: relative;
}

/* LOGO COMPACTÍSSIMA */
.auth-logo {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
}

.auth-logo img {
    height: 38px;
    margin-bottom: 10px;
}

.auth-logo h1 {
    font-size: 20px;
    color: #1a1a2e;
    margin: 0 0 4px 0;
    font-weight: 700;
}

.auth-logo p {
    color: #64748b;
    font-size: 12px;
    margin: 0;
}

/* FORMULÁRIO ULTRA COMPACTO */
.auth-form {
    margin-top: 0;
}

/* GRUPO DE FORMULÁRIO MINIMAL */
.form-group {
    margin-bottom: 12px;
    position: relative;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    color: #2d3748;
    font-size: 12px;
    font-weight: 600;
}

.form-group label i {
    color: #4a5568;
    font-size: 12px;
    width: 14px;
}

/* INPUTS COMPACTOS */
.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 13px;
    color: #2d3748;
    background: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    height: 38px;
    line-height: 1.3;
}

.form-input:focus {
    outline: none;
    border-color: #1e40af;
}

.form-input::placeholder {
    color: #94a3b8;
    font-size: 12px;
}

/* LINHA COM 2 COLUNAS MUITO COMPACTA */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.form-row .form-group {
    margin-bottom: 0;
}

/* OPÇÕES MINIMAL */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0 18px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #4a5568;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    border: 1px solid #cbd5e0;
    border-radius: 3px;
    cursor: pointer;
    appearance: none;
    position: relative;
}

.checkbox-label input[type="checkbox"]:checked {
    background-color: #1e40af;
    border-color: #1e40af;
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 10px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.forgot-link {
    color: #1e40af;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.forgot-link:hover {
    color: #1e3a8a;
    text-decoration: underline;
}

/* TERMOS MINIMAL */
.form-terms {
    margin: 15px 0 18px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 7px;
    line-height: 1.4;
}

/* BOTÕES COMPACTOS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 20px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    height: 38px;
    width: 100%;
}

.btn-primary {
    background: #1e40af;
    color: white;
}

.btn-primary:hover {
    background: #1e3a8a;
}

/* ALERTAS MINIMAL */
.alert {
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.alert i {
    font-size: 12px;
}

/* DIVISOR COMPACTO */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 18px 0;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.auth-divider span {
    padding: 0 10px;
    background: white;
}

/* LINKS COMPACTOS */
.auth-links {
    text-align: center;
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

.auth-links p {
    color: #4a5568;
    font-size: 12px;
    margin: 0;
}

.link {
    color: #1e40af;
    text-decoration: none;
    font-weight: 600;
    margin-left: 3px;
}

.link:hover {
    color: #1e3a8a;
    text-decoration: underline;
}

/* FOOTER MÍNIMO */
.auth-footer {
    margin-top: 20px;
    text-align: center;
    color: #64748b;
    font-size: 10px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

.auth-footer p {
    margin: 3px 0;
    line-height: 1.3;
}

.auth-footer a {
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    color: #1e40af;
}

/* ============================================= */
/* DIFERENÇA ENTRE LOGIN E REGISTER */
/* ============================================= */

/* LOGIN - SEM ROLAGEM (PERFEITO COMO ESTAVA) */
.login-page .auth-container {
    max-height: 420px; /* Altura fixa que cabe tudo */
    overflow: hidden; /* NUNCA rola */
}

/* REGISTER - COM ROLAGEM DA PÁGINA */
.register-page {
    padding: 15px 0; /* Margem vertical */
    display: block; /* Permite scroll da página */
    height: auto; /* Altura automática */
    min-height: 100vh; /* Mínimo da tela */
    align-items: flex-start; /* Alinha no topo */
}

.register-page .auth-container {
    max-height: none; /* Remove altura máxima */
    margin: 20px auto; /* Centraliza com margem */
    overflow: visible; /* Conteúdo visível */
}

/* ============================================= */
/* LAYOUT ESPECÍFICO DO REGISTER */
/* ============================================= */

.register-page .form-group:nth-child(1),
.register-page .form-group:nth-child(2),
.register-page .form-group:nth-child(5),
.register-page .form-group:nth-child(6) {
    display: inline-block;
    width: calc(50% - 6px);
    margin-right: 12px;
}

.register-page .form-group:nth-child(1),
.register-page .form-group:nth-child(5) {
    margin-right: 12px;
}

.register-page .form-group:nth-child(2),
.register-page .form-group:nth-child(6) {
    margin-right: 0;
}

.register-page .form-group:nth-child(3),
.register-page .form-group:nth-child(4) {
    width: 100%;
}

/* ============================================= */
/* ANIMAÇÕES E EXTRAS */
/* ============================================= */

.auth-container {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* TOGGLE PASSWORD */
.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
    z-index: 2;
}

.password-wrapper {
    position: relative;
}

/* VALIDAÇÃO MÍNIMA */
.field-error {
    color: #dc2626;
    font-size: 10px;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.field-error i {
    font-size: 10px;
}

/* ============================================= */
/* RESPONSIVIDADE */
/* ============================================= */

@media (max-width: 520px) {
    body {
        padding: 10px;
        align-items: flex-start;
        padding-top: 10px;
    }
    
    .auth-container {
        max-width: 100%;
        padding: 20px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
    }
    
    .auth-logo {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    .auth-logo img {
        height: 32px;
        margin-bottom: 8px;
    }
    
    .auth-logo h1 {
        font-size: 18px;
        margin-bottom: 3px;
    }
    
    .auth-logo p {
        font-size: 11px;
    }
    
    .form-group {
        margin-bottom: 10px;
    }
    
    .form-input {
        padding: 9px 10px;
        font-size: 12px;
        height: 36px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 12px;
        height: 36px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 10px;
    }
    
    /* FORÇA TUDO A CABER */
    .login-page .auth-container {
        max-height: 380px;
    }
    
    .register-page {
        padding: 10px 0;
    }
    
    .register-page .auth-container {
        margin: 15px auto;
    }
    
    .form-group:nth-child(1),
    .form-group:nth-child(2),
    .form-group:nth-child(5),
    .form-group:nth-child(6) {
        width: 100% !important;
        margin-right: 0 !important;
    }
}

@media (max-height: 600px) {
    .auth-container {
        padding: 15px;
    }
    
    .auth-logo {
        margin-bottom: 12px;
        padding-bottom: 8px;
    }
    
    .auth-logo img {
        height: 28px;
        margin-bottom: 6px;
    }
    
    .auth-logo h1 {
        font-size: 16px;
        margin-bottom: 2px;
    }
    
    .form-group {
        margin-bottom: 8px;
    }
    
    .form-input {
        padding: 8px 10px;
        height: 34px;
        font-size: 11px;
    }
    
    .btn {
        padding: 9px 14px;
        height: 34px;
        font-size: 11px;
    }
    
    .form-options {
        margin: 12px 0 14px;
    }
    
    .form-terms {
        margin: 12px 0 14px;
        padding: 10px;
        font-size: 10px;
    }
    
    .alert {
        padding: 8px 10px;
        margin-bottom: 12px;
        font-size: 11px;
    }
    
    .auth-divider {
        margin: 14px 0;
    }
    
    .auth-links {
        margin-top: 14px;
        padding-top: 12px;
    }
    
    .auth-footer {
        margin-top: 15px;
        padding-top: 12px;
    }
    
    /* Ajuste para telas baixas */
    .login-page .auth-container {
        max-height: 350px;
    }
}

/* Para telas muito baixas */
@media (max-height: 500px) {
    .login-page .auth-container {
        max-height: 320px;
    }
    
    .auth-logo {
        margin-bottom: 8px;
        padding-bottom: 6px;
    }
    
    .auth-logo img {
        height: 24px;
        margin-bottom: 4px;
    }
    
    .auth-logo h1 {
        font-size: 14px;
    }
    
    .form-group {
        margin-bottom: 6px;
    }
    
    .form-input {
        padding: 6px 8px;
        height: 32px;
        font-size: 10px;
    }
    
    .btn {
        padding: 7px 12px;
        height: 32px;
        font-size: 10px;
    }
}

/* ============================================= */
/* REMOVER CONFLITOS */
/* ============================================= */

/* REMOVE overflow: hidden do container geral */
.auth-container {
    overflow: visible;
}

/* Remove regras que bloqueavam scroll */
.auth-container::-webkit-scrollbar {
    display: auto;
}

.auth-container {
    -ms-overflow-style: auto;
    scrollbar-width: auto;
}

/* Garante que o footer fica visível */
.register-page .auth-footer {
    margin-top: 25px;
    padding-top: 18px;
}

/* Garante que tudo fica dentro */
.auth-form > *:last-child {
    margin-bottom: 0 !important;
}