/*
 * =========================================
 * CSS DE AUTENTICAÇÃO - SISTEMA INDEPENDENTE
 * =========================================
 * 
 * Sistema CSS completo e independente para páginas de autenticação
 * Substitui completamente o Tailwind CSS mantendo a mesma aparência
 * 
 * Páginas atendidas:
 * - /login
 * - /forgot-password
 * - /register (futuro)
 * - /reset-password (futuro)
 * 
 * Criado em: 23/08/2025
 * Autor: Sistema Vade Mecum - Defensoria Pública MT
 */

/* ========================================= */
/* SEÇÃO: RESET E BASE */
/* ========================================= */

/* Reset básico */
.auth-page * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Variáveis CSS para consistência visual */
:root {
    /* Cores Primárias - Verde Defensoria */
    --auth-primary-600: #28a745;
    --auth-primary-700: #1e7e34;
    --auth-primary-50: #f8f9fa;
    
    /* Cores Neutras */
    --auth-white: #ffffff;
    --auth-gray-900: #212529;
    --auth-gray-800: #343a40;
    --auth-gray-600: #6c757d;
    --auth-gray-500: #adb5bd;
    --auth-gray-200: #e9ecef;
    --auth-gray-100: #f8f9fa;
    
    /* Cores de Estado */
    --auth-error-600: #dc3545;
    --auth-success-600: #28a745;
    
    /* Sombras */
    --auth-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --auth-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --auth-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --auth-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --auth-shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Raios de Borda */
    --auth-radius-sm: 6px;
    --auth-radius-md: 12px;
    --auth-radius-lg: 20px;
    
    /* Espaçamentos */
    --auth-space-1: 0.25rem;
    --auth-space-2: 0.5rem;
    --auth-space-3: 0.75rem;
    --auth-space-4: 1rem;
    --auth-space-5: 1.25rem;
    --auth-space-6: 1.5rem;
    --auth-space-8: 2rem;
    --auth-space-10: 2.5rem;
    --auth-space-12: 3rem;
    
    /* Tipografia */
    --auth-text-xs: 0.75rem;
    --auth-text-sm: 0.875rem;
    --auth-text-base: 1rem;
    --auth-text-lg: 1.125rem;
    --auth-text-xl: 1.25rem;
    --auth-text-2xl: 1.5rem;
    --auth-text-3xl: 1.875rem;
    --auth-text-4xl: 2.25rem;
}

/* ========================================= */
/* SEÇÃO: ESTRUTURA PRINCIPAL */
/* ========================================= */

/* Corpo da página de autenticação */
.auth-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--auth-gray-900);
    line-height: 1.6;
}

/* Container principal com gradiente */
.auth-container {
    background: linear-gradient(135deg, var(--auth-primary-600) 0%, var(--auth-primary-700) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--auth-space-6);
}

/* Card do formulário */
.auth-form-card {
    backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--auth-radius-lg);
    box-shadow: 
        var(--auth-shadow-2xl),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 100%;
    max-width: 420px;
    padding: var(--auth-space-10);
    position: relative;
    overflow: hidden;
}

/* Efeito de vidro no card */
.auth-form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

/* ========================================= */
/* SEÇÃO: TIPOGRAFIA */
/* ========================================= */

/* Título principal da aplicação */
.auth-title {
    color: var(--auth-primary-700);
    font-weight: 900;
    font-size: var(--auth-text-4xl);
    letter-spacing: 3px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-bottom: var(--auth-space-2);
    line-height: 1.1;
}

/* Subtítulo */
.auth-subtitle {
    color: var(--auth-gray-600);
    font-weight: 500;
    font-size: var(--auth-text-base);
    text-align: center;
    margin-bottom: var(--auth-space-6);
    line-height: 1.4;
}

/* Texto de descrição */
.auth-description {
    color: var(--auth-gray-600);
    font-size: var(--auth-text-sm);
    text-align: center;
    line-height: 1.5;
    margin-bottom: var(--auth-space-6);
}

/* ========================================= */
/* SEÇÃO: ELEMENTOS DECORATIVOS */
/* ========================================= */

/* Divisor com gradiente */
.auth-divider {
    height: 1px;
    background: linear-gradient(
        to right, 
        transparent, 
        var(--auth-primary-600), 
        transparent
    );
    margin: var(--auth-space-6) 0 var(--auth-space-8) 0;
}

/* ========================================= */
/* SEÇÃO: FORMULÁRIOS */
/* ========================================= */

/* Container do formulário */
.auth-form {
    width: 100%;
}

/* Grupo de campos */
.auth-form-group {
    margin-bottom: var(--auth-space-4);
}

.auth-form-group.auth-mb-6 {
    margin-bottom: var(--auth-space-6);
}

/* Labels dos campos */
.auth-form-label {
    color: var(--auth-gray-800);
    font-weight: 600;
    font-size: var(--auth-text-base);
    margin-bottom: var(--auth-space-2);
    display: block;
}

/* Campos de entrada */
.auth-form-input {
    width: 100%;
    border: 2px solid #e5e7eb;
    border-radius: var(--auth-radius-md);
    padding: 12px 16px;
    font-size: var(--auth-text-base);
    background: var(--auth-white);
    transition: all 0.3s ease;
    font-family: inherit;
}

.auth-form-input:focus {
    border-color: var(--auth-primary-600);
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
    outline: none;
}

.auth-form-input::placeholder {
    color: var(--auth-gray-500);
    font-size: var(--auth-text-base);
}

/* Estados de erro nos inputs */
.auth-form-input.auth-error {
    border-color: var(--auth-error-600);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* ========================================= */
/* SEÇÃO: BOTÕES */
/* ========================================= */

/* Botão Égide (principal) */
.auth-btn-egide {
    background: linear-gradient(135deg, var(--auth-primary-600), var(--auth-primary-700));
    border: none;
    border-radius: var(--auth-radius-md);
    color: var(--auth-white);
    font-weight: 600;
    font-size: var(--auth-text-base);
    padding: 16px 24px;
    width: 100%;
    margin-bottom: var(--auth-space-4);
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--auth-space-3);
    box-shadow: var(--auth-shadow-md);
}

.auth-btn-egide:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(40, 167, 69, 0.3);
    color: var(--auth-white);
    text-decoration: none;
}

.auth-btn-egide:active {
    transform: translateY(0);
}

/* Ícone do botão Égide */
.auth-egide-icon {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

/* Descrição do Égide */
.auth-egide-description {
    color: var(--auth-gray-600);
    font-size: var(--auth-text-sm);
    text-align: center;
    line-height: 1.5;
    margin-top: var(--auth-space-2);
}

/* Botão principal */
.auth-btn-primary {
    background: linear-gradient(135deg, var(--auth-primary-600), var(--auth-primary-700));
    border: none;
    border-radius: var(--auth-radius-md);
    color: var(--auth-white);
    font-weight: 600;
    font-size: var(--auth-text-base);
    padding: 12px 24px;
    width: 100%;
    margin-top: var(--auth-space-4);
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(40, 167, 69, 0.3);
}

.auth-btn-primary:active {
    transform: translateY(0);
}

.auth-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Botão secundário (menor) */
.auth-btn-secondary {
    background: linear-gradient(135deg, var(--auth-primary-600), var(--auth-primary-700));
    border: none;
    border-radius: var(--auth-radius-md);
    color: var(--auth-white);
    font-weight: 600;
    font-size: var(--auth-text-sm);
    padding: 12px 20px;
    width: auto;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: inherit;
}

.auth-btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.25);
}

/* ========================================= */
/* SEÇÃO: CHECKBOX E LINKS */
/* ========================================= */

/* Container flex para elementos inline */
.auth-flex {
    display: flex;
}

.auth-items-center {
    align-items: center;
}

.auth-justify-between {
    justify-content: space-between;
}

.auth-flex-wrap {
    flex-wrap: wrap;
}

/* Checkbox customizado */
.auth-checkbox-group {
    display: flex;
    align-items: center;
    gap: var(--auth-space-2);
}

.auth-checkbox {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--auth-gray-500);
    border-radius: var(--auth-radius-sm);
    background: var(--auth-white);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.auth-checkbox:checked {
    background: var(--auth-primary-600);
    border-color: var(--auth-primary-600);
}

.auth-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--auth-white);
    font-size: 11px;
    font-weight: bold;
}

.auth-checkbox:focus {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
    outline: none;
}

/* Label do checkbox */
.auth-checkbox-label {
    color: var(--auth-gray-600);
    font-size: var(--auth-text-sm);
    cursor: pointer;
    user-select: none;
}

/* Links de navegação */
.auth-link {
    color: var(--auth-gray-600);
    text-decoration: none;
    font-size: var(--auth-text-sm);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.auth-link:hover {
    color: var(--auth-primary-700);
}

.auth-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--auth-primary-600);
    transition: width 0.3s ease;
}

.auth-link:hover::after {
    width: 100%;
}

/* ========================================= */
/* SEÇÃO: MENSAGENS DE ERRO */
/* ========================================= */

/* Lista de erros */
.auth-error-list {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-top: var(--auth-space-2);
}

.auth-error-list li + li {
    margin-top: var(--auth-space-1);
}

/* Container de erro */
.auth-error-message {
    color: var(--auth-error-600);
    font-size: var(--auth-text-sm);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--auth-space-2);
}

.auth-error-message::before {
    content: '⚠';
    font-size: var(--auth-text-base);
}

/* Mensagens de sucesso */
.auth-success-message {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid var(--auth-success-600);
    border-radius: var(--auth-radius-md);
    color: var(--auth-success-600);
    padding: var(--auth-space-3) var(--auth-space-4);
    margin-bottom: var(--auth-space-4);
    font-size: var(--auth-text-sm);
    font-weight: 500;
    text-align: center;
}

/* ========================================= */
/* SEÇÃO: UTILITÁRIOS */
/* ========================================= */

/* Utilitários de margem */
.auth-mt-2 {
    margin-top: var(--auth-space-2);
}

.auth-mb-4 {
    margin-bottom: var(--auth-space-4);
}

.auth-mb-6 {
    margin-bottom: var(--auth-space-6);
}

.auth-ml-2 {
    margin-left: var(--auth-space-2);
}

/* Utilitários de texto */
.auth-text-center {
    text-align: center;
}

.auth-text-sm {
    font-size: var(--auth-text-sm);
}

.auth-text-gray-600 {
    color: var(--auth-gray-600);
}

.auth-leading-relaxed {
    line-height: 1.625;
}

/* Utilitários de largura */
.auth-w-full {
    width: 100%;
}

/* ========================================= */
/* SEÇÃO: RESPONSIVIDADE */
/* ========================================= */

/* Tablets (max 768px) */
@media (max-width: 768px) {
    .auth-container {
        padding: var(--auth-space-4);
    }
    
    .auth-form-card {
        padding: var(--auth-space-8);
        max-width: 100%;
    }
    
    .auth-title {
        font-size: var(--auth-text-3xl);
        letter-spacing: 2px;
    }
    
    .auth-subtitle,
    .auth-description {
        font-size: var(--auth-text-sm);
    }
    
    /* Botões em mobile */
    .auth-flex.auth-justify-between {
        flex-direction: column;
        gap: var(--auth-space-3);
        align-items: stretch;
    }
    
    .auth-btn-secondary {
        width: 100%;
        text-align: center;
    }
}

/* Dispositivos móveis (max 480px) */
@media (max-width: 480px) {
    .auth-container {
        padding: var(--auth-space-3);
    }
    
    .auth-form-card {
        padding: var(--auth-space-6);
        border-radius: var(--auth-radius-md);
    }
    
    .auth-title {
        font-size: var(--auth-text-2xl);
        letter-spacing: 1px;
    }
    
    .auth-form-input,
    .auth-btn-primary,
    .auth-btn-secondary {
        font-size: var(--auth-text-sm);
    }
    
    .auth-checkbox-group {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--auth-space-1);
    }
}

/* ========================================= */
/* SEÇÃO: ANIMAÇÕES */
/* ========================================= */

/* Animação de entrada do card */
@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

/* Animação de loading no botão */
.auth-btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid var(--auth-white);
    border-radius: 50%;
    animation: authSpin 1s linear infinite;
}

@keyframes authSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ========================================= */
/* SEÇÃO: ACESSIBILIDADE */
/* ========================================= */

/* Foco visível para navegação por teclado */
.auth-form-input:focus,
.auth-checkbox:focus,
.auth-btn-primary:focus,
.auth-btn-secondary:focus,
.auth-link:focus {
    outline: 2px solid var(--auth-primary-600);
    outline-offset: 2px;
}

/* Reduzir animações se solicitado pelo usuário */
@media (prefers-reduced-motion: reduce) {
    .auth-form-card {
        animation: none;
    }
    
    .auth-form-input,
    .auth-btn-primary,
    .auth-btn-secondary,
    .auth-link,
    .auth-checkbox {
        transition: none;
    }
    
    .auth-btn-loading::after {
        animation: none;
    }
}

/* Alto contraste */
@media (prefers-contrast: high) {
    .auth-form-input {
        border-width: 3px;
    }
    
    .auth-link {
        text-decoration: underline;
    }
    
    .auth-checkbox {
        border-width: 3px;
    }
}