:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --primary: #8b5cf6; /* Roxo AI */
    --accent: #10b981;  /* Verde Dinheiro */
    --text: #f8fafc;
    --text-muted: #94a3b8;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body { background-color: var(--bg-color); color: var(--text); }

/* Login Page */
.login-body { display: flex; justify-content: center; align-items: center; height: 100vh; }
.login-container { background: var(--card-bg); padding: 2rem; border-radius: 12px; width: 100%; max-width: 400px; text-align: center; border: 1px solid #334155; }
.login-container input { width: 100%; padding: 12px; margin: 10px 0; background: #0f172a; border: 1px solid #334155; color: white; border-radius: 6px; }
.login-container button { width: 100%; padding: 12px; background: var(--primary); border: none; color: white; border-radius: 6px; cursor: pointer; font-weight: bold; margin-top: 10px; }
.secondary-btn { background: transparent !important; border: 1px solid var(--primary) !important; color: var(--primary) !important; }

/* Dashboard Layout */
.app-container { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: var(--card-bg); padding: 20px; display: flex; flex-direction: column; border-right: 1px solid #334155; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; color: var(--text-muted); text-decoration: none; padding: 12px; margin-bottom: 5px; border-radius: 6px; }
.sidebar nav a:hover, .sidebar nav a.active { background: var(--primary); color: white; }
.logo { font-size: 1.5rem; font-weight: bold; margin-bottom: 2rem; color: var(--accent); }
.user-info { margin-top: auto; border-top: 1px solid #334155; padding-top: 10px; }

main { flex: 1; padding: 30px; overflow-y: auto; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.gamification-badge { background: var(--accent); color: #000; padding: 5px 15px; border-radius: 20px; font-weight: bold; }

/* Cards Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 40px; }
.card { background: var(--card-bg); padding: 20px; border-radius: 10px; border: 1px solid #334155; }
.card h3 { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 10px; }
.card .value { font-size: 1.8rem; font-weight: bold; }

/* Product List */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.product-card { background: var(--card-bg); padding: 20px; border-radius: 10px; border: 1px solid #334155; display: flex; flex-direction: column; gap: 10px; }
.commission-tag { background: rgba(139, 92, 246, 0.2); color: var(--primary); padding: 5px; border-radius: 4px; font-size: 0.8rem; text-align: center; }
.actions { display: flex; gap: 10px; margin-top: auto; }
.actions input { flex: 1; background: #0f172a; border: 1px solid #334155; color: #64748b; padding: 5px; border-radius: 4px; font-size: 0.8rem; }
.actions button { background: var(--primary); border: none; color: white; padding: 8px 15px; border-radius: 4px; cursor: pointer; }

/* --- ADICIONAR NO FINAL DO STYLE.CSS --- */

/* Estilo para os Alertas */
.alert-box {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid #f59e0b;
    color: #fbbf24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

/* Área de Treinamento (Sanfona) */
.training-item {
    background: var(--card-bg);
    border: 1px solid #334155;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}
.training-summary {
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    list-style: none; /* Tira a setinha padrão feia */
}
.training-summary:hover { background: #263344; }
.training-summary::after { content: '+'; font-size: 1.2rem; color: var(--primary); }
details[open] .training-summary::after { content: '-'; }

.training-content {
    padding: 0 20px 20px 20px;
    border-top: 1px solid #334155;
    color: #cbd5e1;
    line-height: 1.6;
}
.training-content h4 { color: var(--primary); margin-top: 15px; margin-bottom: 5px; }
.training-content ul { padding-left: 20px; margin-bottom: 10px; }
.badge-product { font-size: 0.75rem; background: #334155; padding: 2px 8px; border-radius: 12px; margin-left: 10px; font-weight: normal; color: #94a3b8; }

/* --- ADICIONAR NO FINAL DO STYLE.CSS --- */

/* 1. Modal de Termos (Bloqueio) */
.terms-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.95); /* Fundo bem escuro */
    z-index: 9999;
    display: none; /* Escondido por padrão */
    justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
}
.terms-modal {
    background: var(--card-bg);
    width: 90%; max-width: 600px;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--primary);
    box-shadow: 0 0 50px rgba(139, 92, 246, 0.2);
    text-align: center;
}
.terms-scroll-area {
    background: #0f172a;
    border: 1px solid #334155;
    padding: 20px;
    height: 250px;
    overflow-y: auto;
    text-align: left;
    margin: 20px 0;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #cbd5e1;
}
.btn-agree {
    background: var(--primary); color: white; border: none;
    padding: 12px 30px; border-radius: 6px; font-weight: bold;
    cursor: pointer; font-size: 1rem; width: 100%;
    transition: background 0.2s;
}
.btn-agree:hover { background: #7c3aed; }

/* 2. Chat Flutuante IA */
.ai-fab {
    position: fixed; bottom: 30px; right: 30px;
    background: var(--primary); color: white;
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
    cursor: pointer; z-index: 1000;
    transition: transform 0.2s;
    display: none; /* Começa escondido, só aparece na aba Treinamento */
}
.ai-fab:hover { transform: scale(1.1); }

/* Janela do Chat */
.chat-window {
    position: fixed; bottom: 100px; right: 30px;
    width: 350px; height: 500px;
    background: var(--card-bg);
    border: 1px solid #334155;
    border-radius: 12px;
    display: none; flex-direction: column;
    z-index: 1000;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    overflow: hidden;
}
.chat-header {
    background: var(--primary); color: white;
    padding: 15px; font-weight: bold;
    display: flex; justify-content: space-between; align-items: center;
}
.chat-body {
    flex: 1; padding: 15px; overflow-y: auto;
    background: #0f172a; display: flex; flex-direction: column; gap: 10px;
}
.chat-input-area {
    padding: 10px; border-top: 1px solid #334155;
    display: flex; gap: 10px;
}
.chat-input-area input {
    flex: 1; padding: 10px; border-radius: 6px; border: none; background: #1e293b; color: white;
}
.chat-msg {
    padding: 10px 15px; border-radius: 10px; max-width: 80%; font-size: 0.9rem;
}
.msg-bot { background: #334155; align-self: flex-start; border-bottom-left-radius: 0; }
.msg-user { background: var(--primary); align-self: flex-end; border-bottom-right-radius: 0; }

/* --- ÁREA DE MATERIAIS --- */
.filter-pills { display: flex; gap: 10px; }
.pill { background: #1e293b; border: 1px solid #334155; color: #cbd5e1; padding: 5px 15px; border-radius: 20px; cursor: pointer; transition: 0.2s; }
.pill:hover, .pill.active { background: var(--primary); color: white; border-color: var(--primary); }

.materials-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.material-card { background: var(--card-bg); border: 1px solid #334155; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.material-preview { height: 180px; background: #0f172a; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.material-preview img { width: 100%; height: 100%; object-fit: cover; }
.material-preview video { width: 100%; height: 100%; object-fit: cover; }
.material-type-badge { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.7); color: white; padding: 4px 8px; border-radius: 4px; font-size: 0.7rem; text-transform: uppercase; }

.material-body { padding: 15px; flex: 1; display: flex; flex-direction: column; }
.material-body h4 { margin-bottom: 10px; color: white; }
.copy-box { background: #1e293b; padding: 10px; border-radius: 6px; font-size: 0.85rem; color: #94a3b8; margin-bottom: 15px; max-height: 80px; overflow-y: auto; cursor: pointer; border: 1px dashed #475569; }
.copy-box:hover { border-color: var(--primary); color: #cbd5e1; }

.material-actions { margin-top: auto; display: flex; gap: 10px; }
.btn-download { flex: 1; background: var(--primary); color: white; border: none; padding: 10px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; text-decoration: none; font-size: 0.9rem; }
.btn-copy { background: transparent; border: 1px solid #334155; color: #cbd5e1; padding: 10px; border-radius: 6px; cursor: pointer; }

/* --- ADICIONAR NO FINAL DO STYLE.CSS --- */

/* 1. Estilo do Logo (Substitui o Texto) */
.logo-img {
    max-width: 150px; /* Tamanho máximo */
    height: auto;
    display: block;
    margin-bottom: 20px;
}

/* 2. Estilo da Foto no Menu Lateral (Dashboard) */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #334155;
    margin-top: auto; /* Empurra para o final */
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.user-text-area {
    flex: 1;
    overflow: hidden;
}

.user-text-area p {
    margin: 0;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Destaque da Tela de Login --- */
.login-header-container {
    display: flex;
    align-items: center;
    justify-content: center; /* Centraliza tudo */
    gap: 15px; /* Espaço entre logo e texto */
    margin-bottom: 30px;
}

.logo-login {
    max-width: 130px; /* Um pouco menor no login */
    height: auto;
}

.highlight-badge {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary); /* Usa a cor roxa do tema */
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 5px 10px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    /* Animação de Brilho Pulsante */
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 5px rgba(139, 92, 246, 0.1); opacity: 1; }
    50% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.5), inset 0 0 10px rgba(139, 92, 246, 0.2); color: #c4b5fd; }
    100% { box-shadow: 0 0 5px rgba(139, 92, 246, 0.1); opacity: 1; }
}

/* --- RESPONSIVIDADE MOBILE (FIM DO ARQUIVO) --- */

/* Esconde o botão de menu no Desktop */
.mobile-menu-btn { display: none; }

/* REGRAS PARA CELULAR (Telas menores que 768px) */
@media (max-width: 768px) {
    
    .app-container {
        display: block; /* Remove o Grid layout */
        position: relative;
    }

    /* 1. Sidebar (Menu Lateral) Escondido por padrão */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px; /* Esconde na esquerda */
        width: 260px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 4px 0 15px rgba(0,0,0,0.5);
    }

    /* Classe que o JS vai adicionar para mostrar o menu */
    .sidebar.active {
        left: 0;
    }

    /* 2. Ajustes do Header */
    header {
        display: flex;
        align-items: center;
        gap: 15px;
        position: sticky; /* Cola o topo */
        top: 0;
        z-index: 90;
        background: #0f172a;
        padding: 15px;
        border-bottom: 1px solid #334155;
    }

    .mobile-menu-btn {
        display: flex;
        background: transparent;
        border: 1px solid #334155;
        color: white;
        padding: 8px;
        border-radius: 6px;
        cursor: pointer;
    }

    /* 3. Ajustes de Tamanho de Fonte e Espaçamento */
    h1 { font-size: 1.4rem; }
    .gamification-badge { font-size: 0.75rem; padding: 4px 8px; }

    /* Cards e Grids viram 1 coluna só */
    .stats-grid, .products-grid, .materials-grid, .leads-container {
        grid-template-columns: 1fr !important;
    }

    /* Ajuste fino nos cards */
    .card { padding: 15px; }
    
    /* Login */
    .login-box { padding: 20px; margin: 20px; width: 100%; }
}

/* --- OLHINHO DA SENHA --- */
.password-container {
    position: relative;
    width: 100%;
}

.password-container input {
    padding-right: 45px !important; /* Espaço para o ícone não ficar em cima do texto */
}

.eye-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
}

.eye-icon:hover {
    color: var(--primary);
}