/* ============ SISTEMA: COGNIVUS ECOSYSTEM ============ */
/* ============ MÓDULO: Estilos Globais ================ */

/* ============ VARIÁVEIS E BASE ============ */
:root {
  --paper: #EDE3C8; --paper2: #E4D7AF; --paper3: #DCCC9E;
  --ink: #1C2333; --ink-soft: #454F6B; --ink-faint: #6B7390;
  --burgundy: #7A1F2B; --burgundy-deep: #4E141D; --burgundy-tint: #F3E1DF;
  --brass: #93691A; --brass-light: #C79A3E; --brass-tint: #F4E9CD;
  --teal: #1F5245; --teal-light: #3D7A67; --teal-tint: #DEEAE3;
  --line: #C7B686; --shadow: 0 10px 30px rgba(28,23,10,.16); --shadow-sm: 0 4px 12px rgba(28,23,10,.12);
  --primary-color: #0ea5e9; 
}
* { box-sizing: border-box; } 
html { scroll-behavior: smooth; }
body { margin: 0; background: radial-gradient(1200px 600px at 10% -10%, rgba(255,255,255,.35), transparent 60%), var(--paper); color: var(--ink); font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; line-height: 1.65; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: 'Segoe UI', sans-serif; margin: 0 0 .4em; letter-spacing: -0.01em; font-weight: 700; }
a { color: var(--burgundy); text-decoration: none; } 
img { max-width: 100%; }

/* ============ HERO SECTION ============ */
.hero { position: relative; background: linear-gradient(180deg, rgba(28,35,51,.06), rgba(28,35,51,0) 40%), repeating-linear-gradient(90deg, transparent 0 78px, rgba(28,35,51,.035) 78px 79px), var(--paper2); border-bottom: 3px double var(--brass); padding: 64px 24px 44px; overflow: hidden; }
.hero-inner { max-width: 1080px; margin: 0 auto; position: relative; }
.protocolo { display: inline-flex; align-items: center; gap: 10px; font-family: 'Segoe UI', monospace; font-size: 12.5px; font-weight: 600; letter-spacing: .06em; color: var(--ink-soft); background: rgba(255,255,255,.5); border: 1px solid var(--line); padding: 6px 12px; border-radius: 3px; margin-bottom: 22px; }
.protocolo .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--burgundy); display: inline-block; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); color: var(--ink); max-width: 16ch; } 
.hero h1 em { font-style: normal; color: var(--burgundy); }
.hero p.lead { font-size: 1.18rem; max-width: 62ch; color: var(--ink-soft); margin-top: 14px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.chip { font-family: 'Segoe UI', monospace; font-size: 11.5px; font-weight: 600; color: var(--ink-soft); border: 1px solid var(--line); padding: 5px 11px; border-radius: 20px; background: rgba(255,255,255,.4); }
.chip-case { background: var(--burgundy-tint); color: var(--burgundy-deep); border-color: var(--burgundy); }

/* ============ ÍNDICE / NAV ============ */
.indice-wrap { background: var(--ink); position: sticky; top: 0; z-index: 50; box-shadow: 0 3px 12px rgba(0,0,0,.25); }
.indice { max-width: 1200px; margin: 0 auto; display: flex; gap: 2px; overflow-x: auto; padding: 0 10px; scrollbar-width: thin; }
.indice a { flex: 0 0 auto; color: #D8D2C0; font-family: 'Segoe UI', sans-serif; font-size: 12px; font-weight: 600; padding: 13px 14px; border-bottom: 3px solid transparent; white-space: nowrap; transition: .15s; }
.indice a:hover { color: #fff; border-bottom-color: var(--brass-light); background: rgba(255,255,255,.05); }
.indice a b { color: var(--brass-light); margin-right: 6px; }

/* ============ ESTRUTURA DO HUB (INDEX) ============ */
.governance-section { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 20px; margin-bottom: 40px; }
.disclaimer-box { background: #fff; border-radius: 8px; padding: 20px; box-shadow: var(--shadow-sm); text-align: left; }
.disclaimer-box h3 { margin-top: 0; margin-bottom: 15px; font-size: 1.2rem; color: var(--ink); }
.macro-title { text-align: center; color: var(--burgundy-deep); font-size: 2rem; margin: 60px 0 30px; letter-spacing: 2px; text-transform: uppercase; border-bottom: 2px solid var(--burgundy-tint); padding-bottom: 10px; }
.linha-section { margin-bottom: 40px; background: #fff; border-radius: 12px; padding: 30px; box-shadow: var(--shadow-sm); border-left: 6px solid var(--teal); }
.linha-section.crime { border-left-color: var(--burgundy); }
.linha-section.pena { border-left-color: var(--brass); }
.linha-section.especial { border-left-color: var(--brass); }
.linha-header { font-size: 1.5rem; margin-top: 0; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid var(--line); color: var(--ink); }

.trilha-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.trilha-card { display: block; text-decoration: none; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 20px; transition: all 0.2s ease; color: inherit; position: relative; }
.trilha-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); border-color: var(--primary-color); }
.trilha-card h3 { margin-top: 0; color: var(--ink); font-size: 1.15rem; margin-bottom: 10px; }
.trilha-card p { margin: 0 0 12px; font-size: 0.95rem; color: var(--ink-soft); }

.progress-bar-container { background-color: #e2e8f0; border-radius: 10px; height: 8px; margin-top: 15px; overflow: hidden; }
.progress-bar { background-color: var(--primary-color); height: 100%; width: 0%; border-radius: 10px; }
.status-badge { display: inline-block; padding: 3px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 700; margin-top: 10px; }
.status-pendente { background: #fef08a; color: #854d0e; }
.status-concluido { background: #dcfce7; color: #166534; }

/* ============ LAYOUT E FASES (AULAS) ============ */
main { max-width: 1080px; margin: 0 auto; padding: 10px 24px 40px; }
section { padding: 52px 0; border-bottom: 1px solid var(--line); } 
section:last-of-type { border-bottom: none; }
.eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--burgundy); margin-bottom: 10px; display: block; font-weight: 700; }
.section-title { font-size: clamp(1.5rem, 3.2vw, 2.1rem); } 
.section-intro { color: var(--ink-soft); font-size: 1.05rem; max-width: 70ch; }

.fase { position: relative; margin: 34px 0 0; padding: 0 0 0 30px; }
.fase::before { content: ""; position: absolute; left: 9px; top: 0; bottom: -34px; width: 2px; background: repeating-linear-gradient(180deg, var(--brass-light) 0 6px, transparent 6px 12px); }
.fase:last-child::before { display: none; }
.fase::after { content: ""; position: absolute; left: 3px; top: 8px; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2.5px solid var(--brass); }
.fase-card { background: #FBF7EA; border: 1px solid var(--line); border-radius: 4px 12px 12px 4px; box-shadow: var(--shadow-sm); padding: 26px 28px 30px; position: relative; }
.fase-tab { position: absolute; top: -14px; left: 20px; background: var(--burgundy); color: #F6E9DE; font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 5px 12px; border-radius: 3px; box-shadow: var(--shadow-sm); }
.fase-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.fase-num { font-size: 2rem; color: var(--brass); opacity: .55; line-height: 1; font-weight: 700; } 
.fase-head h3 { font-size: 1.5rem; margin: 0; }
.fase-arts { font-size: 12px; font-weight: 600; color: var(--burgundy); background: var(--burgundy-tint); padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.fase-body { margin-top: 14px; } 
.fase-body p { margin: 0 0 12px; color: var(--ink); } 
.fase-body strong { color: var(--burgundy-deep); } 
.fase-body ul { margin-top: 5px; margin-bottom: 12px; padding-left: 20px; color: var(--ink); } 
.fase-body li { margin-bottom: 6px; }
.fase-folio { position: absolute; top: -13px; right: 20px; background: var(--paper); color: var(--ink-faint); font-family: 'Segoe UI', monospace; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; padding: 3px 10px; border: 1px solid var(--line); border-radius: 3px; }

/* ============ MÓDULOS ESPECIAIS (METÁFORAS E TABELAS) ============ */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 18px 0; } 
@media(max-width:720px) { .duo { grid-template-columns: 1fr; } }
.box-metaphor, .box-alerta { border-radius: 8px; padding: 16px 18px; font-size: .95rem; } 
.box-metaphor { background: var(--teal-tint); border-left: 4px solid var(--teal); } 
.box-metaphor .lbl { color: var(--teal); } 
.box-alerta { background: #FBE9E2; border-left: 4px solid var(--brass); } 
.box-alerta .lbl { color: var(--brass); }
.lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; display: block; margin-bottom: 6px; }
.case-study { border-left: 4px solid var(--burgundy); background: var(--burgundy-tint); border-radius: 8px; padding: 16px 18px; margin-top: 20px; }
.case-study .lbl { color: var(--burgundy-deep); }

table.comp { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: .92rem; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-sm); }
table.comp th { background: var(--ink); color: #EDE3C8; text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
table.comp td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; } 
table.comp tr:last-child td { border-bottom: none; } 
table.comp td.tag { font-size: 13px; color: var(--burgundy); white-space: nowrap; font-weight: 700; }

/* ============ QUIZ (ACTIVE RECALL) ============ */
.quiz { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; } 
details.qz { background: #fff; border: 1px solid var(--line); border-radius: 6px; } 
details.qz summary { padding: 14px 18px; cursor: pointer; font-weight: 700; font-size: .98rem; list-style: none; display: flex; gap: 10px; align-items: center;} 
details.qz summary::-webkit-details-marker { display: none; } 
details.qz summary::before { content: "?"; color: #fff; background: var(--burgundy); width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: 0 0 auto; } 
details.qz .qz-a { padding: 0 18px 16px 50px; color: var(--teal); font-size: .94rem; font-weight: 600; }

/* ============ RODAPÉ E GOVERNANÇA ============ */
footer.site-footer { 
  background: var(--ink); 
  color: #94a3b8; 
  text-align: center; 
  padding: 2rem; 
  margin-top: 40px; 
  border-top: 4px solid var(--primary-color); 
  font-size: 0.95rem; 
}
footer.site-footer .container {
  max-width: 1080px;
  margin: 0 auto;
}
footer.site-footer p {
  margin: 0.5rem 0;
}

/* ============ CASO (ESTUDO DE CASO COLAPSÁVEL) ============ */
details.caso { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--burgundy); border-radius: 0 6px 6px 0; margin-top: 18px; }
details.caso summary { padding: 13px 18px; cursor: pointer; font-weight: 700; font-size: .95rem; color: var(--burgundy-deep); list-style: none; display: flex; gap: 10px; align-items: center; }
details.caso summary::-webkit-details-marker { display: none; }
details.caso summary::before { content: "⚖"; color: #fff; background: var(--burgundy); width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: 0 0 auto; }
details.caso .caso-content { padding: 0 18px 16px 50px; color: var(--ink-soft); font-size: .94rem; }
details.caso .caso-content p { margin: 0 0 10px; }
details.caso .caso-content p:last-child { margin-bottom: 0; }

/* ============ ARTIGO DE LEI (CITAÇÃO NORMATIVA) ============ */
.lei-cita { background: var(--brass-tint); border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; margin: 14px 0; font-size: .88rem; color: var(--ink-soft); font-family: 'Segoe UI', monospace; }
.lei-cita b { color: var(--brass); font-family: 'Segoe UI', sans-serif; }

/* ============ NAV PREV/PRÓXIMO ENTRE ETAPAS ============ */
.etapa-nav { display: flex; justify-content: space-between; gap: 16px; margin: 10px 0 40px; flex-wrap: wrap; }
.etapa-nav a { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 20px; box-shadow: var(--shadow-sm); color: var(--ink); font-weight: 700; font-size: .92rem; transition: .15s; flex: 1 1 260px; }
.etapa-nav a:hover { border-color: var(--burgundy); transform: translateY(-2px); }
.etapa-nav a.nav-next { justify-content: flex-end; text-align: right; }
.etapa-nav a span.nav-lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); font-weight: 600; }