/* ========================================
   PROTECTIONEDU - ESTILOS DE LOGIN
   Tema: Laranja (Educação)
   Versão: 1.7 (Corrigido + Debug)
   ======================================== */

/* ========================================
   RESET E VARIÁVEIS
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores principais - LARANJA */
    --primary: #f97316;
    --primary-dark: #ea580c;
    --primary-light: #ffedd5;
    --primary-gradient: linear-gradient(135deg, #f97316, #ea580c);
    
    /* Cores secundárias */
    --secondary: #0ea5e9;
    --secondary-light: #e0f2fe;
    
    /* Status */
    --success: #22c55e;
    --success-light: #dcfce7;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --warning: #eab308;
    --warning-light: #fef9c3;
    
    /* Neutros */
    --dark: #1e293b;
    --gray-900: #0f172a;
    --gray-800: #1e293b;
    --gray-700: #334155;
    --gray-600: #475569;
    --gray-500: #64748b;
    --gray-400: #94a3b8;
    --gray-300: #cbd5e1;
    --gray-200: #e2e8f0;
    --gray-100: #f1f5f9;
    --gray-50: #f8fafc;
    --white: #ffffff;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.15);
    
    /* Bordas */
    --radius: 16px;
    --radius-sm: 8px;
    --radius-lg: 24px;
    --radius-full: 9999px;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    min-height: 100vh;
    line-height: 1.5;
}

/* ========================================
   CONTAINER DE LOGIN
   ======================================== */
.login-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ========================================
   LADO ESQUERDO - BRANDING (LARANJA)
   ======================================== */
.login-branding {
    width: 50%;
    min-width: 50%;
    max-width: 50%;
    min-height: 100vh;
    
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
}

/* Padrão decorativo */
.login-branding::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.login-branding::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}

/* ========================================
   CONTEÚDO DO BRANDING
   ======================================== */
.branding-content {
    position: relative;
    z-index: 1;
    text-align: center;          /* ALINHA À ESQUERDA */
    color: white;
    width: 100%;
    max-width: 100%;           /* REMOVE O LIMITE */
}

/* ========================================
   ÍCONE LOTTIE - CONTAINER DO ÍCONE
   MUDE width E height AQUI!
   ======================================== */
.brand-icon {
    width: 670px;
    height: 350px;
    margin: 0 auto 30px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    
}

.brand-icon dotlottie-wc {
    width: 700px;
    height: 500px;
}

.branding-content h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.branding-content .tagline {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 40px;
    text-align: center;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.features-list {
    text-align: center;
    margin-bottom: 40px;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.feature-item {
    display: flex;
    align-items: center;           /* CENTRALIZA VERTICALMENTE */
    justify-content: center;       /* CENTRALIZA HORIZONTALMENTE */
    text-align: center;            /* TEXTO CENTRALIZADO */
    gap: 15px;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255,255,255,0.15);
    transform: translateX(5px);
}

.feature-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.feature-item h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.feature-item p {
    font-size: 13px;
    opacity: 0.85;
}

.back-link {
    color: white;
    text-decoration: none;
    font-size: 14px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 1;
}

/* ========================================
   LADO DIREITO - FORMULÁRIO (BRANCO)
   ======================================== */
.login-form-section {
    width: 50%;
    min-width: 50%;
    max-width: 50%;
    min-height: 100vh;
    
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px;
    background: var(--white);
    
}

.form-container {
    width: 100%;
    max-width: 420px;
}

/* ========================================
   TABS DE AUTENTICAÇÃO
   ======================================== */
.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    background: var(--gray-100);
    padding: 6px;
    border-radius: var(--radius-full);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--gray-800);
}

.tab-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ========================================
   FORMULÁRIOS
   ======================================== */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-form h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.form-subtitle {
    color: var(--gray-500);
    margin-bottom: 30px;
    font-size: 15px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    font-size: 18px;
    z-index: 1;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--gray-800);
    background: var(--white);
    transition: all 0.2s ease;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input-wrapper input::placeholder {
    color: var(--gray-400);
}

.toggle-password {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toggle-password:hover {
    opacity: 1;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--gray-600);
    cursor: pointer;
}

.checkbox-label input {
    display: none;
}

.checkbox-label .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.checkbox-label input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label.terms {
    font-size: 13px;
}

.checkbox-label.terms a {
    color: var(--primary);
    text-decoration: none;
}

.checkbox-label.terms a:hover {
    text-decoration: underline;
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Botões */
.btn-primary {
    width: 100%;
    padding: 16px 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(249, 115, 22, 0.3);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Error Message */
.error-message {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--danger-light);
    color: var(--danger);
    border-radius: var(--radius-sm);
    font-size: 14px;
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ========================================
   LOADING OVERLAY
   ======================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 15px;
    z-index: 2000;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    color: var(--gray-600);
    font-size: 15px;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 3000;
    animation: slideInToast 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.toast.success {
    background: var(--success);
    color: white;
}

.toast.error {
    background: var(--danger);
    color: white;
}

.toast.info {
    background: var(--gray-800);
    color: white;
}

@keyframes slideInToast {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ========================================
   RESPONSIVIDADE
   ======================================== */
@media (max-width: 900px) {
    .login-container {
        flex-direction: column;
    }
    
    .login-branding {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        min-height: auto;
        padding: 40px 20px;
    }
    
    .login-form-section {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        min-height: auto;
        padding: 30px 20px;
    }
    
    .branding-content h1 {
        font-size: 32px;
    }
    
    .brand-icon {
        width: 250px;
        height: 250px;
    }
    
    .features-list {
        display: none;
    }
}

@media (max-width: 480px) {
    .form-container {
        padding: 0 10px;
    }
    
    .auth-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        padding: 14px;
    }
    
    .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .branding-content h1 {
        font-size: 28px;
    }
    
    .branding-content .tagline {
        font-size: 16px;
    }
    
    .brand-icon {
        width: 180px;
        height: 180px;
    }
}

/* ========================================
   LOTTIE ICONS - PAINEL
   ======================================== */
.logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon dotlottie-wc {
    width: 100%;
    height: 100%;
}

.institution-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.institution-avatar dotlottie-wc {
    width: 100%;
    height: 100%;
}