/* ===== Base ===== */
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/cormorant-garamond-latin-700-normal.woff2") format("woff2"); }
:root {
  /* Paleta: grafite, marfim e dourado envelhecido */
  --navy: #1e1b16;        /* tinta principal (grafite) */
  --navy-2: #2f2b24;
  --blue: #a27933;        /* acento dourado */
  --blue-dark: #845f24;
  --blue-soft: #f5eedf;
  --blue-line: #e2d1af;
  --gold-light: #b88a3e;
  --cream: #f3efe4;
  --text: #22201c;
  --muted: #6d675d;
  --faint: #9e978b;
  --line: #e6e1d8;
  --line-2: #f2efe9;
  --bg: #f8f6f0;
  --white: #ffffff;
  --ok: #3d6b4f;
  --ok-soft: #edf3ee;
  --warn: #8a5d14;
  --warn-soft: #fbf5e8;
  --warn-line: #ecdbb5;
  --danger: #9b2c2c;
  --danger-soft: #faeeee;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(34, 28, 18, .04), 0 2px 6px rgba(34, 28, 18, .04);
  --shadow-lg: 0 12px 32px rgba(34, 28, 18, .10);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.01em; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: 0; font-variant-numeric: lining-nums; }
.step .num, .step h3, .area-card h3, .check-section h3, .brand { font-variant-numeric: lining-nums; }
h1 { font-size: 34px; line-height: 1.15; }
h2 { font-size: 24px; }
h3 { font-size: 16px; }
p { margin: 0 0 .8em; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ===== Botões ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 14px; font-weight: 550;
  padding: 9px 16px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: var(--white); color: var(--text);
  transition: background .15s, border-color .15s, color .15s; white-space: nowrap;
}
.btn:hover { background: var(--line-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--line-2); color: var(--text); }
.btn-danger { color: var(--danger); border-color: #ecc8c9; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn-icon { padding: 7px; }
.btn.active { background: var(--blue-soft); border-color: var(--blue-line); color: var(--navy); }

/* ===== Cabeçalho ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--white); border-bottom: 1px solid var(--line);
  height: 64px; display: flex; align-items: center; gap: 24px; padding: 0 24px;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--navy); font-family: var(--serif); font-weight: 700; font-size: 23px; letter-spacing: .005em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 46px; width: auto; display: block; }
.search { flex: 1; max-width: 620px; position: relative; }
.search input {
  width: 100%; font: inherit; font-size: 14px; padding: 10px 14px 10px 40px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--text);
}
.search input:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(184, 138, 62, .16); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.topbar-actions { margin-left: auto; display: flex; gap: 6px; }
.menu-toggle { display: none; }

/* ===== Layout ===== */
.layout { display: grid; grid-template-columns: 248px 1fr; min-height: calc(100vh - 64px); }
.sidebar { background: var(--white); border-right: 1px solid var(--line); padding: 20px 12px; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; }
.nav-label { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); padding: 0 12px; margin: 18px 0 6px; }
.nav-label:first-child { margin-top: 0; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px;
  color: var(--text); font-size: 14px; font-weight: 500;
}
.nav a:hover { background: var(--line-2); text-decoration: none; }
.nav a.active { background: var(--blue-soft); color: var(--navy); font-weight: 600; box-shadow: inset 2px 0 0 var(--blue); }
.nav a .count { margin-left: auto; font-size: 12px; color: var(--faint); font-weight: 500; }
.nav a svg { color: var(--muted); }
.nav a.active svg { color: var(--blue); }
.main { padding: 32px 40px 64px; min-width: 0; }
.container { max-width: 1040px; margin: 0 auto; }
.container-narrow { max-width: 820px; margin: 0 auto; }

/* ===== Elementos comuns ===== */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px 22px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px; background: var(--line-2); color: var(--muted); white-space: nowrap;
}
.badge-type { background: var(--blue-soft); color: var(--blue-dark); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-draft { background: var(--warn-soft); color: var(--warn); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.page-head { margin-bottom: 24px; }
.page-head p { color: var(--muted); max-width: 720px; }
.crumbs { font-size: 13px; color: var(--faint); margin-bottom: 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { width: 36px; height: 36px; color: var(--faint); margin-bottom: 8px; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: #f3eadb; border: 1px solid #3a352c; padding: 11px 18px; border-radius: 7px; font-size: 14px;
  box-shadow: var(--shadow-lg); opacity: 0; transition: all .2s; z-index: 100; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

/* ===== Início ===== */
.hero { background: radial-gradient(120% 140% at 100% 0%, #36302575 0%, #1e1b16 60%), #1e1b16; color: #fff; border-radius: 14px; padding: 46px 48px; margin-bottom: 32px; position: relative; overflow: hidden; border: 1px solid #2e2b25; }
.hero-mark { position: absolute; right: 44px; top: 50%; transform: translateY(-50%); height: 72%; opacity: .09; pointer-events: none; }
.hero > *:not(.hero-mark) { position: relative; }
.hero .eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-light); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.hero .eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--gold-light); }
.hero h1 { color: var(--cream); font-size: 44px; margin-bottom: 12px; max-width: 640px; }
.hero p { color: #c8c0b2; max-width: 600px; margin-bottom: 24px; font-size: 15.5px; }
.hero .search { max-width: 560px; }
.hero .search input { background: var(--cream); border-color: transparent; padding: 13px 16px 13px 42px; font-size: 15px; }
.hero-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.hero-chips button { font: inherit; font-size: 13px; background: transparent; color: #ddd3c1; border: 1px solid rgba(184, 138, 62, .35); border-radius: 20px; padding: 5px 12px; cursor: pointer; }
.hero-chips button:hover { background: rgba(184, 138, 62, .14); color: #fff; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 38px 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.section-title h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.area-card { padding: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.area-card:hover { border-color: var(--blue-line); box-shadow: var(--shadow-lg); text-decoration: none; }
.area-card .ic { width: 40px; height: 40px; border-radius: 8px; background: transparent; border: 1px solid var(--blue-line); display: grid; place-items: center; color: var(--blue); margin-bottom: 8px; }
.area-card h3 { margin: 0; font-family: var(--serif); font-size: 23px; font-weight: 600; }
.area-card p { font-size: 13.5px; color: var(--muted); margin: 0; flex: 1; }
.area-card .foot { font-size: 11.5px; color: var(--blue); font-weight: 600; margin-top: 10px; letter-spacing: .1em; text-transform: uppercase; }
.type-card { padding: 16px 18px; display: flex; align-items: center; gap: 12px; color: var(--text); cursor: pointer; }
.type-card:hover { border-color: var(--blue-line); text-decoration: none; }
.type-card .ic { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--blue-line); display: grid; place-items: center; color: var(--blue); flex: none; }
.type-card strong { display: block; font-size: 14px; }
.type-card span { font-size: 12.5px; color: var(--muted); }

/* ===== Lista de conteúdos ===== */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff; }
.seg button { font: inherit; font-size: 13px; font-weight: 550; border: 0; background: transparent; padding: 7px 13px; cursor: pointer; color: var(--muted); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--line-2); }
.seg button.on { background: var(--navy); color: #f3eadb; }
select.input-sm { font: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--text); }
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item { display: flex; gap: 16px; align-items: flex-start; padding: 16px 18px; color: var(--text); transition: border-color .15s; }
.list-item:hover { border-color: var(--blue-line); text-decoration: none; }
.list-item .ic { width: 38px; height: 38px; border-radius: 50%; background: transparent; border: 1px solid var(--blue-line); color: var(--blue); display: grid; place-items: center; flex: none; }
.list-item h3 { margin: 0 0 3px; font-size: 15.5px; }
.list-item p { margin: 0; font-size: 13.5px; color: var(--muted); }
.list-item .meta { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.list-item .go { margin-left: auto; color: var(--faint); align-self: center; }
mark { background: #f3e5c4; color: inherit; padding: 0 1px; border-radius: 2px; }

/* ===== Página de conteúdo ===== */
.doc-head { margin-bottom: 22px; }
.doc-head h1 { font-size: 40px; margin-bottom: 10px; }
.doc-head .lead { font-size: 16px; color: var(--muted); margin-bottom: 14px; }
.doc-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.doc-meta .sep { color: var(--line); }
.doc-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.doc-section { margin-bottom: 18px; }
.doc-section > h2 { display: flex; align-items: center; gap: 10px; font-size: 24px; margin-bottom: 12px; }
.doc-section > h2 svg { color: var(--blue); }
.prose p:last-child { margin-bottom: 0; }
.prose ul { margin: 0; padding-left: 20px; }
.prose li { margin-bottom: 4px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bullets { list-style: none; margin: 0; padding: 0; }
.bullets li { position: relative; padding: 7px 0 7px 22px; border-bottom: 1px solid var(--line-2); font-size: 14.5px; }
.bullets li:last-child { border-bottom: 0; }
.bullets li::before { content: ""; position: absolute; left: 4px; top: 15px; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.bullets.warn li::before { background: var(--warn); }
.callout { border: 1px solid var(--warn-line); background: var(--warn-soft); border-radius: 7px; padding: 11px 14px; font-size: 14px; display: flex; gap: 10px; margin-top: 12px; }
.callout svg { color: var(--warn); margin-top: 2px; }
.callout-info { border-color: var(--blue-line); background: var(--blue-soft); }
.callout-info svg { color: var(--blue); }
.disclaimer { font-size: 12.5px; color: var(--faint); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 28px; }

/* Passo a passo */
.steps-bar { display: flex; align-items: center; gap: 14px; padding: 14px 18px; position: sticky; top: 76px; z-index: 5; margin-bottom: 14px; }
.progress { flex: 1; height: 5px; background: var(--line-2); border-radius: 10px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--blue-dark), var(--gold-light)); border-radius: 10px; transition: width .25s; }
.steps-bar .label { font-size: 13px; color: var(--muted); font-weight: 550; white-space: nowrap; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 18px 20px; margin-bottom: 10px; transition: border-color .15s, background .15s; }
.step .num {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--blue); color: var(--blue-dark);
  display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 19px; background: #fff;
}
.step h3 { margin: 4px 0 6px; font-family: var(--serif); font-size: 22px; font-weight: 600; }
.step .body { font-size: 14.5px; }
.step .step-foot { margin-top: 12px; display: flex; gap: 8px; }
.step.done { background: #fafcfb; border-color: #cfe6d9; }
.step.done .num { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.done h3 { color: var(--ok); }
.step.current { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(184, 138, 62, .14); }
.focus-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; }

/* Fluxo de decisão */
.flow-wrap { display: grid; grid-template-columns: 1fr 280px; gap: 18px; align-items: start; }
.flow-q { padding: 28px 30px; }
.flow-q .step-tag { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .16em; color: var(--blue); margin-bottom: 8px; }
.flow-q h2 { font-size: 28px; margin-bottom: 10px; }
.flow-q .help { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.flow-opts { display: flex; flex-direction: column; gap: 10px; }
.flow-opt {
  font: inherit; text-align: left; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  cursor: pointer; font-size: 15px; font-weight: 550; color: var(--text); transition: all .15s;
}
.flow-opt:hover { border-color: var(--blue); background: var(--blue-soft); }
.flow-opt .k { width: 26px; height: 26px; border-radius: 6px; background: var(--line-2); display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--muted); flex: none; }
.flow-opt:hover .k { background: var(--navy); color: var(--gold-light); }
.flow-opt svg { margin-left: auto; color: var(--faint); }
.flow-result { padding: 30px 32px; border-top: 3px solid var(--blue); }
.flow-result .step-tag { color: var(--blue); }
.flow-hist { padding: 16px 18px; }
.flow-hist h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-bottom: 10px; }
.flow-hist ol { list-style: none; padding: 0; margin: 0; }
.flow-hist li { border-left: 2px solid var(--blue-line); padding: 2px 0 12px 14px; position: relative; font-size: 13.5px; }
.flow-hist li::before { content: ""; position: absolute; left: -5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: #fff; border: 2px solid var(--blue); }
.flow-hist li:last-child { padding-bottom: 0; }
.flow-hist .q { color: var(--muted); display: block; }
.flow-hist button { font: inherit; background: none; border: 0; padding: 0; color: var(--navy); font-weight: 600; cursor: pointer; text-align: left; }
.flow-hist button:hover { text-decoration: underline; }

/* Checklist */
.check-section { padding: 6px 0; margin-bottom: 14px; }
.check-section h3 { padding: 14px 20px 10px; margin: 0; display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 21px; font-weight: 600; }
.check-section h3 .small { margin-left: auto; font-weight: 500; font-family: var(--font); }
.check-item { display: flex; gap: 12px; align-items: flex-start; padding: 11px 20px; cursor: pointer; border-top: 1px solid var(--line-2); font-size: 14.5px; user-select: none; }
.check-item:hover { background: #fafbfd; }
.check-item input { position: absolute; opacity: 0; pointer-events: none; }
.check-box { width: 20px; height: 20px; border: 2px solid #b9c3d0; border-radius: 5px; flex: none; margin-top: 1px; display: grid; place-items: center; transition: all .12s; background: #fff; }
.check-box svg { width: 13px; height: 13px; stroke: #fff; stroke-width: 3; opacity: 0; }
.check-item input:checked + .check-box { background: var(--ok); border-color: var(--ok); }
.check-item input:checked + .check-box svg { opacity: 1; }
.check-item input:checked ~ .txt { color: var(--faint); text-decoration: line-through; }
.check-item input:focus-visible + .check-box { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Modelos */
.file-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line-2); }
.file-row:first-child { border-top: 0; }
.file-ic { width: 40px; height: 46px; border-radius: 5px; border: 1px solid var(--line); display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: var(--navy); background: var(--bg); text-transform: uppercase; flex: none; }
.file-row .name { font-weight: 600; font-size: 14.5px; word-break: break-word; }
.template-text { white-space: pre-wrap; font-family: var(--font); font-size: 14px; background: #fbfcfd; border: 1px solid var(--line); border-radius: 7px; padding: 18px 20px; margin: 0; max-height: 520px; overflow: auto; line-height: 1.6; }

/* Relacionados */
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.related a { padding: 12px 14px; display: flex; gap: 10px; align-items: center; color: var(--text); font-size: 14px; font-weight: 550; }
.related a:hover { border-color: var(--blue-line); text-decoration: none; }
.related a svg { color: var(--blue); }

/* Rodapé */
.footer { font-size: 12.5px; color: var(--faint); margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; gap: 16px; flex-wrap: wrap; }
.footer a { color: var(--muted); }

/* ===== Responsivo ===== */
@media (max-width: 900px) {
  .hero h1 { font-size: 32px; }
  h1, .doc-head h1 { font-size: 30px; }
  .hero-mark { display: none; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 64px; bottom: 0; width: 270px; z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); height: auto; }
  .sidebar.open { transform: none; }
  .menu-toggle { display: inline-flex; }
  .main { padding: 22px 16px 48px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .brand-logo { height: 32px; }
  .topbar .search { display: none; }
  .two-col, .flow-wrap { grid-template-columns: 1fr; }
  .hero { padding: 26px 22px; }
  .flow-q, .flow-result { padding: 22px 20px; }
  .step { grid-template-columns: 1fr; }
}

/* ===== Impressão ===== */
@media print {
  .topbar, .sidebar, .doc-actions, .steps-bar, .step-foot, .focus-nav, .footer, .toast, .no-print { display: none !important; }
  .layout { display: block; }
  .main { padding: 0; }
  body { background: #fff; font-size: 12pt; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .step { display: grid !important; }
  a { color: inherit; }
}
