/*
 * Consulta Fácil - Estilos para Formulários de Autenticação
 * Design System para login, cadastro, recuperação e troca de senha
 */

/* ==========================================================================
   CONFIGURAÇÃO GLOBAL DE FUNDO
   ========================================================================== */

body.authentication-background {
    background-color: #f9f9f9 !important;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

/* Remove qualquer fundo padrão do container principal */
body.authentication-background > .container {
    background: transparent !important;
}

/* ==========================================================================
   CONTAINER PRINCIPAL - CENTRALIZAÇÃO DOS FORMULÁRIOS
   ========================================================================== */

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    padding: 20px;
}

.auth-wrapper {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

/* ==========================================================================
   CARD DO FORMULÁRIO - ESTILIZAÇÃO CONSISTENTE
   ========================================================================== */

.auth-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: none;
    padding: 40px;
    width: 100%;
    border: 1px solid #f0f0f0;
}

/* Header do card */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    margin-bottom: 24px;
}

.auth-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: #333333;
    margin-bottom: 8px;
    line-height: 1.2;
}

.auth-subtitle {
    font-size: 16px;
    color: #666666;
    font-weight: 400;
    line-height: 1.5;
}

/* ==========================================================================
   FORMULÁRIOS - ESTILOS CONSISTENTES
   ========================================================================== */

.auth-form {
    width: 100%;
}

.form-group-auth {
    margin-bottom: 20px;
}

.form-label-auth {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 8px;
    text-transform: uppercase;
}

/* Asterisco para campos obrigatórios */
.form-label-auth:after {
    content: "*";
    color: #ff4444;
    margin-left: 4px;
}

.form-control-auth {
    width: 100%;
    padding: 9px;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.2s ease;
    background: #ffffff;
    font-family: inherit;
}

.form-control-auth:focus {
    outline: none;
    border: 1px solid #f0f0f0;
    background-color: #f9f9f9;
    box-shadow: none;
}

.form-control-auth::placeholder {
    color: #999999;
}

/* ==========================================================================
   WRAPPER PARA CAMPOS DE SENHA COM TOGGLE
   ========================================================================== */

.auth-password-input-wrapper {
    position: relative;
}

.auth-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #666666;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.auth-password-toggle:hover {
    color: #333333;
}

.auth-password-toggle:focus {
    outline: none;
}

/* Ajusta o padding direito do campo de senha para não sobrepor o botão */
.auth-password-input-wrapper .form-control-auth {
    padding-right: 40px;
}

/* Checkbox personalizado */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #666666;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"]:checked {
    background-color: #00D47E;
    border-color: #00D47E;
}

/* ==========================================================================
   BOTÕES - DESIGN CONSISTENTE
   ========================================================================== */

.auth-btn-primary {
    width: 100%;
    background: #00D47E;
    color: #ffffff;
    border: none;
    border-radius: 7px;
    padding: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.auth-btn-primary:hover {
    background: #00C06E;
    transform: none;
    box-shadow: none;
}

.auth-btn-primary:active {
    background: #00AC5F;
    transform: none;
}

/* ==========================================================================
   SISTEMA DE VALIDAÇÃO E FEEDBACK VISUAL
   ========================================================================== */

/* Campo com erro - borda vermelha sutil */
.form-control-auth.auth-input-error {
    border-color: #dc3545 !important;
    border-width: 1px;
}

/* Container de mensagens de erro */
.auth-field-errors {
    margin-top: 6px;
}

/* Texto de erro - vermelho discreto */
.auth-error-text {
    color: #dc3545;
    font-size: 0.85em;
    font-weight: 500;
    display: block;
    line-height: 1.4;
}

/* Tooltip de erro elegante (opcional) */
.auth-error-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    background: #dc3545;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 500;
    z-index: 1000;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.25s ease;
}

.auth-error-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 12px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #dc3545;
}

.auth-error-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* Estados de foco para campos com erro */
.form-control-auth.auth-input-error:focus {
    border-color: #dc3545 !important;
    background-color: #fffafa;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

/* ==========================================================================
   LINKS E TEXTO ADICIONAL
   ========================================================================== */

.auth-links {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

.auth-link {
    color: #00D47E;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: #00C06E;
    text-decoration: underline;
}

.auth-text {
    text-align: center;
    color: #666666;
    font-size: 14px;
    margin: 0;
}

/* ==========================================================================
   MENSAGENS DE ALERTA
   ========================================================================== */

.auth-alert {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #f0f9f0;
    border-color: #e0f0e0;
    color: #2e7d32;
}

.alert-error {
    background-color: #fef0f0;
    border-color: #fee0e0;
    color: #c62828;
}

.alert-info {
    background-color: #f0f8ff;
    border-color: #e0f0ff;
    color: #1565c0;
}

/* ==========================================================================
   RESPONSIVIDADE - ADAPTAÇÃO A DIFERENTES TELAS
   ========================================================================== */

/* Tablets (768px - 1023px) */
@media (max-width: 1023px) {
    .auth-card {
        padding: 32px;
        max-width: 400px;
    }
    
    .auth-title {
        font-size: 24px;
    }
    
    .auth-subtitle {
        font-size: 15px;
    }
}

/* Mobile (até 767px) */
@media (max-width: 767px) {
    .auth-container {
        padding: 16px;
    }
    
    .auth-card {
        padding: 24px;
        border-radius: 12px;
        box-shadow: none;
    }
    
    .auth-title {
        font-size: 22px;
        margin-bottom: 6px;
    }
    
    .auth-subtitle {
        font-size: 14px;
    }
    
    .form-control-auth {
        padding: 9px;
        font-size: 16px; /* Prevenir zoom no iOS */
    }
    
    .auth-btn-primary {
        padding: 10px;
    }
}

/* Mobile pequeno (até 375px) */
@media (max-width: 375px) {
    .auth-card {
        padding: 20px;
    }
    
    .auth-title {
        font-size: 20px;
    }
    
    .form-group-auth {
        margin-bottom: 16px;
    }
}

/* ==========================================================================
   ANIMAÇÕES - EXPERIÊNCIA DO USUÁRIO
   ========================================================================== */

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    animation: authFadeIn 0.6s ease-out;
}

/* ==========================================================================
   COMPATIBILIDADE COM TEMPLATES EXISTENTES
   ========================================================================== */

/* Mantém compatibilidade com classes existentes */
.authentication-basic {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    background: #f9f9f9 !important;
}

.custom-card {
    background: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: none !important;
    border: 1px solid #f0f0f0 !important;
}

/* Fim do auth.css */