/* =========================================
   1. VARIÁVEIS & CONFIGURAÇÕES GERAIS
   ========================================= */
:root {
    /* --- CORES DARK (Padrão) --- */
    --bg-body: #0f1014;
    --bg-panel: #1a1b20;
    --text-main: #e0e0e0;
    --text-muted: #888;
    --border-color: #333;
    
    /* Cor de Destaque */
    --accent: #d4af37; 
    --accent-hover: #f9ce45;
    --accent-text: #000;

    --shadow: rgba(0,0,0,0.5);
    --input-bg: rgba(0,0,0,0.3);

    /* UI Elements */
    --radius-md: 8px;
    --transition-speed: 0.3s;

    /* NOVAS CORES PARA O SWITCH PREMIUM */
    --switch-bg-light: #ffeebb;
    --switch-knob-light: #ffc107;
    --switch-bg-dark: #1e293b;
    --switch-knob-dark: #38bdf8;
}

/* --- TEMA LIGHT --- */
body.light-mode {
    --bg-body: #f4f6f8;
    --bg-panel: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    --accent: #1e3a8a; 
    --accent-hover: #1e40af;
    --accent-text: #fff;

    --shadow: rgba(0,0,0,0.1);
    --input-bg: #f1f5f9;
}

/* --- GERAL --- */
* { box-sizing: border-box; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Lato', sans-serif;
    margin: 0;
    transition: all 0.3s ease;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-text, .profile-name {
    font-family: 'Lato', sans-serif; 
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.5px;
    margin: 0;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition-speed);
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* =========================================
   2. UI COMPONENTS (Inputs, Botões, Forms)
   ========================================= */

/* Inputs Modernos (Usados no Login) */
.input-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.input-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.modern-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    padding: 12px 0;
    color: var(--text-main);
    font-size: 1rem;
    transition: var(--transition-speed);
}

.modern-input:focus {
    outline: none;
    background: transparent;
    border-bottom-color: var(--accent);
    box-shadow: 0 4px 6px -6px rgba(212, 175, 55, 0.4);
}

.modern-input::placeholder { color: #444; }

/* Botão Gold Premium */
.btn-gold {
    display: block;
    width: 100%;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    padding: 14px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.btn-gold:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.25);
}

/* Mensagens de Erro */
.alert-error {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border-left: 3px solid #ff6b6b;
    padding: 12px 15px;
    border-radius: 0 4px 4px 0;
}

/* Checkboxes Customizados */
.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin-bottom: 2.5rem;
    color: var(--text-muted);
}

.checkbox-label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.checkbox-label input {
    accent-color: var(--accent);
    width: 16px; 
    height: 16px;
}

/* =========================================
   3. LAYOUT LOGIN (SPLIT SCREEN)
   ========================================= */

.login-split-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
    background-color: var(--bg-body);
    overflow: hidden;
}

/* LADO ESQUERDO: FORMULÁRIO */
.login-left {
    width: 450px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 60px;
    background-color: #0f1014;
    position: relative;
    z-index: 20;
    /* Sombra para profundidade sobre a animação */
    box-shadow: 15px 0 50px rgba(0,0,0,0.8);
    flex-shrink: 0;
}

.login-form-wrapper {
    width: 100%;
    max-width: 340px; /* Impede que fique muito largo em telas grandes */
}

.login-header {
    margin-bottom: 3rem;
}

.login-header h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.login-header p {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
    line-height: 1.5;
}

.login-header .subtitle {
    font-size: 0.85rem;
    opacity: 0.7;
    display: block;
    margin-top: 4px;
}

.copyright {
    margin-top: 4rem;
    color: #444;
    font-size: 0.75rem;
}

/* LADO DIREITO: ANIMAÇÃO */
.login-right {
    flex: 1;
    position: relative;
    background: radial-gradient(circle at center, #1a1b20 0%, #000 100%);
    overflow: hidden;
    z-index: 10;
}

.bg-animation {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
}

.bg-animation::after {
    content: '';
    position: absolute;
    width: 200%; height: 200%;
    top: -50%; left: -50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.05) 10%, transparent 10%),
                radial-gradient(circle, rgba(212, 175, 55, 0.05) 10%, transparent 10%);
    background-size: 50px 50px;
    background-position: 0 0, 25px 25px;
    animation: moveBackground 60s linear infinite;
    transform: rotate(20deg);
}

@keyframes moveBackground {
    0% { transform: rotate(20deg) translateY(0); }
    100% { transform: rotate(20deg) translateY(-50px); }
}

/* --- RESPONSIVIDADE (MOBILE) --- */
@media (max-width: 900px) {
    .login-split-wrapper {
        flex-direction: column;
    }

    .login-left {
        width: 100%;
        height: 100%;
        padding: 30px 25px; /* Padding menor no mobile */
        align-items: center;
        justify-content: center;
        box-shadow: none;
        background: radial-gradient(circle at center, #1a1b20 0%, #000 100%);
    }

    .login-form-wrapper {
        max-width: 100%;
        width: 100%;
    }
    
    .login-header {
        text-align: center;
        margin-bottom: 2.5rem;
    }

    .login-header h1 { font-size: 1.8rem; }

    .copyright {
        text-align: center;
        margin-top: 2rem;
        position: absolute;
        bottom: 20px;
        left: 0; 
        width: 100%;
    }

    .login-right {
        display: none; /* Remove background pesado no mobile */
    }
}

/* =========================================
   4. LAYOUT SIDEBAR & DASHBOARD (Mantido)
   ========================================= */
.wrapper { display: flex; min-height: 100vh; }

.sidebar {
    position: relative;
    width: 260px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    z-index: 50;
}

.toggle-btn {
    position: absolute;
    top: 25px;
    right: -15px;
    width: 30px; height: 30px;
    background-color: var(--accent);
    color: var(--accent-text);
    border: 2px solid var(--bg-body);
    border-radius: 6px; 
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}
.toggle-btn:hover { transform: scale(1.1); }

.sidebar.collapsed { width: 80px; }
.sidebar.collapsed .profile-info, 
.sidebar.collapsed .nav-text, 
.sidebar.collapsed .theme-switch-wrapper .nav-text { display: none; opacity: 0; }
.sidebar.collapsed .sidebar-header { padding-left: 0; justify-content: center; margin-top: 10px; }
.sidebar.collapsed .profile-avatar { width: 40px; height: 40px; margin: 0 auto; }
.sidebar.collapsed .toggle-btn { right: -15px; transform: rotate(180deg); }
.sidebar.collapsed .nav-link { justify-content: center; }
.sidebar.collapsed .nav-link i { margin-right: 0; font-size: 1.3rem; }
.sidebar.collapsed .theme-switch-wrapper { justify-content: center; }

.sidebar-header {
    display: flex; align-items: center; gap: 15px;
    margin-bottom: 2rem; padding-top: 5px; min-height: 60px;
}
.profile-avatar {
    min-width: 50px; height: 50px;
    background: var(--accent); color: var(--accent-text);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.user-name { font-weight: bold; color: var(--accent); }

.nav-list { list-style: none; padding: 0; margin: 0; }
.nav-link {
    display: flex; align-items: center; padding: 12px 15px;
    color: var(--text-muted); text-decoration: none;
    border-radius: 8px; margin-bottom: 5px; transition: 0.2s;
    white-space: nowrap; overflow: hidden;
}
.nav-link i { margin-right: 15px; min-width: 20px; text-align: center; }
.nav-link:hover, .nav-link.active {
    background: rgba(128, 128, 128, 0.1); color: var(--accent);
}

.sidebar-footer { 
    margin-top: auto; padding-top: 15px; border-top: 1px solid var(--border-color); 
}

/* Switch Dark/Light Premium */
.theme-switch-wrapper {
    display: flex; align-items: center; justify-content: center;
    margin-top: auto; padding: 15px 0;
}
.theme-switch {
    position: relative; display: inline-block; width: 64px; height: 32px;
}
.theme-switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--switch-bg-dark);
    transition: .4s; border-radius: 34px; overflow: hidden;
}
.slider:before {
    position: absolute; content: "";
    height: 24px; width: 24px; left: 4px; bottom: 4px;
    background-color: var(--switch-knob-dark);
    transition: .4s; border-radius: 50%; z-index: 1;
}
.slider .fas {
    position: absolute; top: 50%; transform: translateY(-50%);
    font-size: 14px; color: white; transition: all 0.4s; z-index: 2;
}
.moon-icon { left: 10px; opacity: 1; transform: translateY(-50%) rotate(0deg); }
.sun-icon { left: -20px; opacity: 0; transform: translateY(-50%) rotate(-90deg); }

input:checked + .slider { background-color: var(--switch-bg-light); }
input:checked + .slider:before { transform: translateX(32px); background-color: var(--switch-knob-light); }
input:checked + .slider .moon-icon { left: 60px; opacity: 0; transform: translateY(-50%) rotate(90deg); }
input:checked + .slider .sun-icon { left: 42px; opacity: 1; transform: translateY(-50%) rotate(0deg); }

.content { flex: 1; padding: 40px; }

@media (max-width: 768px) {
    .sidebar { position: fixed; left: -260px; height: 100%; }
    .sidebar.open { left: 0; }
    .toggle-btn { display: none; }
}