/*
    SISTEMA: COGNIVUS Ecosystem
    MÓDULO: LexRoute (Trilha Processual & Fluxogramas)
    VERSÃO: v.1.0.0 - Fundação visual, tipografia e modais de segurança.
    STACK: CSS3
    ARQUITETO_E_DESENVOLVEDOR: Luciano P. de Moura
    RESTRIÇÃO: Uso restrito. Propriedade intelectual protegida.
*/

:root {
    --bg-color: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --primary-color: #0f172a;
    --accent-color: #0ea5e9;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

/* --- CABEÇALHO HERO --- */
.hub-hero {
    background: var(--primary-color);
    color: white;
    padding: 3rem 2rem;
    border-bottom: 4px solid var(--accent-color);
    text-align: center;
}
.hub-hero h1 { font-size: 3.5rem; font-weight: 800; line-height: 1.1; margin-bottom: 1rem; }
.hub-hero h1 span { color: var(--accent-color); }
.hub-hero p { font-size: 1.2rem; color: #cbd5e1; max-width: 800px; margin: 0 auto; }

/* --- BLOCOS DE GOVERNANÇA E IA --- */
.governance-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.disclaimer-box, .skill-group {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.disclaimer-box h3, .skill-group h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* --- CARDS DE NAVEGAÇÃO DA TRILHA --- */
.trilha-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 4rem;
}

.trilha-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 150px;
}

.trilha-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.trilha-card h3 { font-size: 1.3rem; margin-bottom: 0.5rem; color: var(--primary-color); }
.trilha-card p { font-size: 0.95rem; color: var(--text-secondary); }

/* --- OVERLAYS E SEGURANÇA --- */
.login-overlay, .disclaimer-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.4s ease; z-index: 9999;
}
.login-overlay { background-color: rgba(15, 23, 42, 0.98); }
.disclaimer-overlay { background-color: rgba(15, 23, 42, 0.85); z-index: 9998; opacity: 0; }

.login-card, .disclaimer-card {
    background: var(--card-bg); padding: 2.5rem; border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5); text-align: center;
    max-width: 400px; width: 90%;
}
.disclaimer-card { max-width: 550px; border-top: 5px solid #d97706; }

.btn-primary {
    width: 100%; padding: 12px; background-color: var(--primary-color);
    color: white; border: none; border-radius: 6px; font-weight: 700;
    cursor: pointer; margin-top: 15px; font-family: 'Segoe UI', sans-serif;
    font-size: 1.1rem; transition: background 0.3s;
}
.btn-primary:hover { background-color: #1e293b; }

.cookie-banner {
    position: fixed; bottom: -150px; left: 0; width: 100%;
    background-color: #0f172a; color: #cbd5e1; padding: 15px 2rem;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 9997; transition: bottom 0.6s ease; flex-wrap: wrap; gap: 15px;
}
.cookie-banner.show { bottom: 0; }
.cookie-banner button { background-color: var(--accent-color); color: white; border: none; padding: 10px 25px; border-radius: 6px; cursor: pointer; font-weight: 600; }

/* --- MOTOR DO FLUXOGRAMA VERTICAL (LEXROUTE) --- */
.timeline-container {
    position: relative;
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem 0;
}

/* A linha central vertical */
.timeline-container::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--border-color);
    top: 0;
    bottom: 0;
    left: 20px; /* Alinhado à esquerda para dar espaço ao texto no mobile */
    border-radius: 2px;
}

.timeline-node {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 55px; /* Espaço para a bolinha e a linha */
}

/* A bolinha indicadora na linha */
.timeline-node::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: var(--card-bg);
    border: 4px solid var(--accent-color);
    border-radius: 50%;
    left: 12px;
    top: 15px;
    z-index: 1;
}

/* Cores dos Atores Processuais */
.node-autor::before { border-color: #3b82f6; } /* Azul */
.node-juiz::before { border-color: #8b5cf6; } /* Roxo */
.node-reu::before { border-color: #f97316; } /* Laranja */
.node-neutro::before { border-color: #10b981; } /* Verde */

/* O Card de Conteúdo do Nó */
.node-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.node-content:hover {
    border-color: var(--accent-color);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.node-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.node-tag {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    color: white;
}
.tag-autor { background-color: #3b82f6; }
.tag-juiz { background-color: #8b5cf6; }
.tag-reu { background-color: #f97316; }
.tag-neutro { background-color: #10b981; }

/* Adaptação do Active Recall para dentro do nó */
.node-content details { margin-top: 15px; }
.node-content summary {
    font-weight: 600;
    color: var(--accent-color);
    cursor: pointer;
    list-style: none;
}
.node-content summary::-webkit-details-marker { display: none; }
.node-content .recall-resposta {
    margin-top: 10px;
    padding: 10px;
    background-color: var(--bg-color);
    border-left: 3px solid var(--accent-color);
    font-size: 0.95rem;
    border-radius: 0 4px 4px 0;
}

/* --- COMPONENTES COGNITIVOS E UI AVANÇADA (LEXROUTE) --- */
.fase-intro {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-left: 5px solid #0ea5e9;
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    margin: 1.5rem 0 2.5rem;
    color: #e2e8f0;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.15);
}
.fase-intro h2 {
    margin: 0 0 0.75rem;
    color: #38bdf8;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.fase-intro p { margin: 0.4rem 0; line-height: 1.55; color: #cbd5e1; }

.mapa-mental {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}
.mapa-chip {
    background: #1e293b;
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
}
.mapa-chip strong { color: #38bdf8; }

.case-box {
    background: #0f172a;
    border: 1px solid #334155;
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin: 1rem 0 0.5rem;
    font-size: 0.95rem;
}
.case-box .case-title {
    color: #fbbf24;
    font-weight: 700;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.case-box p { margin: 0.3rem 0; color: #cbd5e1; line-height: 1.5; }

.memo-box {
    background: linear-gradient(90deg, rgba(14,165,233,0.08), transparent);
    border: 1px dashed #0ea5e9;
    border-radius: 10px;
    padding: 0.9rem 1.15rem;
    margin: 1rem 0 0.25rem;
    color: #0369a1; /* Azul escuro (melhor legibilidade) */
    font-size: 0.92rem;
}
.memo-box strong { 
    color: #075985; /* Azul mais forte e denso no negrito */
}

.alerta-box {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-left: 4px solid #ef4444;
    border-radius: 10px;
    padding: 0.9rem 1.15rem;
    margin: 1rem 0 0.25rem;
    color: #991b1b; /* Vermelho bordô escuro para leitura */
    font-size: 0.92rem;
}

.lista-requisitos li {
    padding: 0.45rem 0 0.45rem 1.6rem;
    position: relative;
    border-bottom: 1px solid var(--border-color); /* Borda adaptada ao tema claro */
    color: var(--text-secondary); /* Cinza escuro oficial do nosso sistema */
    line-height: 1.45;
}
.lista-requisitos li:last-child { 
    border-bottom: none; 
}
.lista-requisitos li::before {
    content: "▸";
    position: absolute;
    left: 0.3rem;
    color: #0ea5e9;
    font-weight: 700;
}

.caminho-grid {
    display: grid;
    gap: 0.85rem;
    margin-top: 0.75rem;
}
.caminho-card {
    background: #1e293b;
    border-radius: 10px;
    padding: 0.9rem 1.1rem;
    border: 1px solid #334155;
}
.caminho-card.emenda { border-left: 4px solid #f59e0b; }
.caminho-card.indeferimento { border-left: 4px solid #ef4444; }
.caminho-card.recebimento { border-left: 4px solid #22c55e; }
.caminho-card h4 {
    margin: 0 0 0.35rem;
    font-size: 0.98rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.caminho-card.emenda h4 { color: #fbbf24; }
.caminho-card.indeferimento h4 { color: #f87171; }
.caminho-card.recebimento h4 { color: #4ade80; }
.caminho-card p { margin: 0; color: #94a3b8; font-size: 0.9rem; line-height: 1.45; }

.efeitos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.7rem;
    margin-top: 0.85rem;
}
.efeito-chip {
    background: #1e293b;
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
    border: 1px solid #334155;
}
.efeito-chip .icone { font-size: 1.4rem; display: block; margin-bottom: 0.25rem; }
.efeito-chip strong { color: #38bdf8; font-size: 0.88rem; display: block; }
.efeito-chip span { color: #94a3b8; font-size: 0.8rem; }

.defesa-grid {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.defesa-card {
    background: #1e293b;
    border-radius: 10px;
    padding: 0.9rem 1.1rem;
    border: 1px solid #334155;
}
.defesa-card h4 { margin: 0 0 0.35rem; color: #e2e8f0; font-size: 0.98rem; }
.defesa-card p { margin: 0; color: #94a3b8; font-size: 0.9rem; line-height: 1.45; }

.chave-resumo {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border: 1px solid #0ea5e9;
    border-radius: 14px;
    padding: 1.5rem;
    margin: 2.5rem 0 1.5rem;
}
.chave-resumo h3 {
    margin: 0 0 1rem;
    color: #38bdf8;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.chave-resumo ol {
    margin: 0;
    padding-left: 1.3rem;
    color: #cbd5e1;
    line-height: 1.7;
}
.chave-resumo li { margin-bottom: 0.35rem; }
.chave-resumo strong { color: #f8fafc; }

details summary {
    cursor: pointer;
    user-select: none;
}
details[open] summary {
    margin-bottom: 0.5rem;
}

/* --- ESTAÇÃO CENTRAL (DASHBOARD MACRO) --- */
.linha-section { margin-bottom: 3.5rem; }
.linha-header {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

/* Modificadores de Tema por Linha */
.tema-verde .linha-header { color: #16a34a; border-bottom: 3px solid #16a34a; }
.tema-azul .linha-header { color: #0284c7; border-bottom: 3px solid #0ea5e9; }
.tema-roxo .linha-header { color: #7c3aed; border-bottom: 3px solid #8b5cf6; }
.tema-laranja .linha-header { color: #d97706; border-bottom: 3px solid #f59e0b; }

/* Efeitos de Hover nos Cards por Tema */
.tema-verde .trilha-card:hover { border-color: #16a34a; box-shadow: 0 4px 12px rgba(22, 163, 74, 0.15); transform: translateY(-3px); }
.tema-azul .trilha-card:hover { border-color: #0284c7; box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15); transform: translateY(-3px); }
.tema-roxo .trilha-card:hover { border-color: #7c3aed; box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15); transform: translateY(-3px); }
.tema-laranja .trilha-card:hover { border-color: #d97706; box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15); transform: translateY(-3px); }