/* ============================================================
   Central Jurídica — CIApp
   Mesmo sistema visual da Central Financeira (dark premium,
   fiel à identidade black & white do CIApp), otimizado para
   leitura de documentos longos. Ver web/central-financeira.
   ============================================================ */

:root {
  --bg: #0a0a0b;
  --bg-elevated: #131315;
  --bg-card: #141416;
  --bg-inset: #0f0f11;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: rgba(255, 255, 255, 0.92);
  --text-muted: rgba(255, 255, 255, 0.6);
  --text-faint: rgba(255, 255, 255, 0.56);
  --accent: #ffffff;
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.12);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --content-max: 1200px;
  --sidebar-w: 300px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  scroll-padding-top: 96px;
}
a { color: inherit; text-decoration: none; }
::selection { background: rgba(255, 255, 255, 0.18); }

body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 80% -8%, rgba(255,255,255,0.05), transparent 60%),
    radial-gradient(700px 400px at -5% 10%, rgba(255,255,255,0.035), transparent 55%);
}

/* ---------- Progresso de leitura ---------- */
.lg-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: var(--accent); z-index: 200; pointer-events: none;
  transition: width .05s linear;
}

/* ---------- Cabeçalho ---------- */
.lg-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,11,0.72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.lg-header__inner {
  max-width: var(--content-max); margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.lg-brand { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.lg-brand__mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0;
}
.lg-brand__mark img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.16); }
.lg-brand__text { display: flex; flex-direction: column; gap: 1px; }
.lg-brand__eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-faint); }
.lg-brand__title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.lg-header__actions { display: flex; align-items: center; gap: 10px; }
.lg-header__link { font-size: 13.5px; font-weight: 500; color: var(--text-muted); padding: 8px 12px; border-radius: 999px; transition: color .15s, background .15s; }
.lg-header__link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.lg-nav-toggle {
  display: none; background: var(--bg-elevated); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 9px 13px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}

/* ---------- Navegação de portal (unificada entre Ajuda/Financeira/Jurídica) ---------- */
.lg-portal { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.lg-portal a {
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  padding: 7px 11px; border-radius: 999px; white-space: nowrap;
  transition: color .15s, background .15s;
}
.lg-portal a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.lg-portal a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, 0.08); }
@media (max-width: 720px) {
  .lg-header__inner { flex-wrap: wrap; row-gap: 8px; }
  .lg-portal { order: 3; width: 100%; justify-content: center; }
}

/* ---------- Layout ---------- */
.lg-shell {
  max-width: var(--content-max); margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); gap: 48px; align-items: start;
}

/* ---------- Sidebar / índice ---------- */
.lg-sidebar {
  position: sticky; top: 78px; align-self: start;
  max-height: calc(100vh - 96px); overflow-y: auto; padding: 28px 0 40px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.14) transparent;
}
.lg-sidebar::-webkit-scrollbar { width: 6px; }
.lg-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 6px; }
.lg-breadcrumb { font-size: 12.5px; color: var(--text-faint); margin-bottom: 14px; padding: 0 12px; }
.lg-breadcrumb a:hover { color: var(--text); }
.lg-sidebar__label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); padding: 0 12px 10px; }
.lg-toc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.lg-toc a {
  display: block; padding: 7px 12px; border-radius: 9px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  border-left: 2px solid transparent; line-height: 1.4; transition: color .14s, background .14s;
}
.lg-toc a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.lg-toc a.is-active { color: var(--text); background: rgba(255,255,255,0.06); border-left-color: var(--accent); }

/* ---------- Conteúdo ---------- */
.lg-main { padding: 0 0 120px; min-width: 0; }

.lg-doc-head { padding: 56px 0 8px; }
.lg-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--text-muted);
  background: var(--bg-elevated); border: 1px solid var(--border); padding: 6px 13px; border-radius: 999px;
}
.lg-doc-head h1 {
  font-size: clamp(28px, 4vw, 40px); line-height: 1.1; letter-spacing: -0.025em;
  margin: 18px 0 0; font-weight: 800;
}
.lg-updated {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
  font-size: 13px; color: var(--text-muted);
  background: var(--bg-elevated); border: 1px solid var(--border); padding: 8px 14px; border-radius: 999px;
}
.lg-updated strong { color: var(--text); font-weight: 600; }

/* ---------- Corpo do documento (leitura longa) ---------- */
.lg-doc { max-width: 760px; margin-top: 12px; }
.lg-doc h2 {
  font-size: clamp(19px, 2.4vw, 23px); font-weight: 700; letter-spacing: -0.015em;
  margin: 46px 0 4px; padding-top: 26px; border-top: 1px solid var(--border);
  scroll-margin-top: 90px; line-height: 1.25;
}
.lg-doc h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 20px; }
.lg-doc h3 { font-size: 16px; font-weight: 650; margin: 26px 0 4px; scroll-margin-top: 90px; }
.lg-doc p {
  font-size: 15.5px; line-height: 1.75; color: rgba(255,255,255,0.82);
  margin: 0 0 14px; overflow-wrap: break-word;
}
.lg-doc p a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Callout (reuso do padrão) ---------- */
.lg-callout {
  display: flex; gap: 14px; border: 1px solid var(--border); border-left-width: 3px;
  border-left-color: var(--info); background: linear-gradient(90deg, var(--info-soft), transparent 60%);
  border-radius: var(--radius-md); padding: 16px 18px; margin: 22px 0; max-width: 760px;
}
.lg-callout__ico { font-size: 18px; line-height: 1.5; flex-shrink: 0; }
.lg-callout__body { font-size: 14.5px; }
.lg-callout__body strong { color: var(--text); }
.lg-callout__body p { margin: 4px 0 0; color: var(--text-muted); font-size: 14.5px; line-height: 1.6; }

/* ---------- Hub (/legal) ---------- */
.lg-hero { padding: 56px 0 6px; max-width: 720px; }
.lg-hero h1 { font-size: clamp(30px, 4.6vw, 44px); line-height: 1.08; letter-spacing: -0.025em; margin: 18px 0 0; font-weight: 800; }
.lg-hero__lead { font-size: clamp(15px, 1.6vw, 18px); color: var(--text-muted); margin: 16px 0 0; }
.lg-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 32px 0 0; }
.lg-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 22px; transition: border-color .18s, transform .18s;
}
.lg-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.lg-card__ico {
  width: 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; background: var(--bg-inset); border: 1px solid var(--border); margin-bottom: 6px;
}
.lg-card h3 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.lg-card p { margin: 0; font-size: 14px; color: var(--text-muted); line-height: 1.55; flex: 1; }
.lg-card__meta { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }
.lg-card__cta { font-size: 13.5px; font-weight: 600; color: var(--text); margin-top: 4px; }
.lg-card__cta .arrow { transition: transform .15s; display: inline-block; }
.lg-card:hover .lg-card__cta .arrow { transform: translateX(3px); }

/* ---------- Footer ---------- */
.lg-footer { border-top: 1px solid var(--border); background: var(--bg-elevated); margin-top: 40px; }
.lg-footer__inner {
  max-width: var(--content-max); margin: 0 auto; padding: 30px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.lg-footer__brand { font-weight: 700; font-size: 15px; }
.lg-footer__note { font-size: 13px; color: var(--text-muted); }
.lg-footer__legal { font-size: 12.5px; color: var(--text-faint); }
.lg-footer__legal a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Responsivo ---------- */
@media (max-width: 960px) {
  .lg-shell { grid-template-columns: 1fr; gap: 0; }
  .lg-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(86vw, 340px); max-height: 100vh;
    background: var(--bg-elevated); border-right: 1px solid var(--border); padding: 24px 16px; z-index: 150;
    transform: translateX(-102%); transition: transform .26s ease; box-shadow: var(--shadow);
  }
  body.lg-nav-open .lg-sidebar { transform: translateX(0); }
  .lg-nav-toggle { display: inline-flex; align-items: center; gap: 7px; }
  .lg-scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 140; opacity: 0; pointer-events: none; transition: opacity .26s; backdrop-filter: blur(2px); }
  body.lg-nav-open .lg-scrim { opacity: 1; pointer-events: auto; }
  .lg-header__link { display: none; }
}
@media (max-width: 720px) {
  .lg-cards { grid-template-columns: 1fr; }
  .lg-doc-head { padding-top: 40px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* ---------- Impressão (salvar em PDF) ---------- */
@media print {
  body { background: #fff; color: #000; }
  body::before, .lg-progress, .lg-header, .lg-sidebar, .lg-scrim, .lg-footer, .lg-nav-toggle { display: none !important; }
  .lg-shell { display: block; max-width: none; padding: 0; }
  .lg-main { padding: 0; }
  .lg-doc { max-width: none; }
  .lg-doc h2 { border-top: 1px solid #ccc; }
  .lg-doc p { color: #111; font-size: 11pt; line-height: 1.5; }
  .lg-doc-head h1 { color: #000; }
  .lg-updated { border-color: #ccc; color: #333; }
  a { color: #000 !important; }
}
