/* Manual do Vaulton Cert — páginas estáticas servidas em /manual/. Mesma paleta do portal (src/assets/main.css).
   O tema segue a escolha do usuário no portal (localStorage "vcert.theme"), aplicada por manual.js. */
:root {
  --bg: #f2f5f9;
  --surface: #ffffff;
  --text: #1f2e45;
  --muted: #66768e;
  --strong: #12233d;
  --border: #dfe5ee;
  --soft: #f6f8fb;
  --brand: #2a70a4;
  --brand-strong: #1e4872;
  --brand-soft: #eef6fb;
  --accent: #80bdda;
  --nav-from: #10233f;
  --nav-to: #173458;
  --green: #15803d;
  --green-soft: #f0fdf4;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --red: #b91c1c;
  --red-soft: #fef2f2;
  --gray: #95a3b8;
  --code-bg: #edf1f6;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #0b1626;
  --surface: #111f33;
  --text: #c9d6e6;
  --muted: #8a9bb3;
  --strong: #eef3f9;
  --border: #22354f;
  --soft: #15263d;
  --brand: #6fb0dc;
  --brand-strong: #9fd0ee;
  --brand-soft: #16304d;
  --green: #4ade80;
  --green-soft: #0f2a1c;
  --amber: #fbbf24;
  --amber-soft: #2b2110;
  --red: #f87171;
  --red-soft: #2d1416;
  --code-bg: #1a2c45;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 'Inter Variable', Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Barra superior */
.m-top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px max(16px, calc((100% - 960px) / 2));
  background: linear-gradient(120deg, var(--nav-from), var(--nav-to));
  color: #b9cce0; font-size: 14px;
}
.m-top a { color: #b9cce0; }
.m-top a:hover { color: #fff; text-decoration: none; }
.m-brand { margin-right: auto; display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .08em; color: #fff !important; }
.m-brand img { width: 26px; height: 26px; }
.m-brand b { color: var(--accent); }
.m-brand small { font-weight: 500; letter-spacing: 0; color: #9fc6e0; margin-left: 4px; }

/* Documento */
.m-doc { max-width: 960px; margin: 0 auto; padding: 32px 16px 64px; }
.m-crumb { margin: 0 0 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.m-doc h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.2; color: var(--strong); }
.m-lead { margin: 0 0 16px; font-size: 17px; color: var(--muted); }
.m-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.m-meta span { padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-strong); font-size: 12px; font-weight: 500; }
.m-doc h2 { margin: 40px 0 12px; padding-top: 8px; font-size: 21px; color: var(--strong); border-top: 1px solid var(--border); }
.m-doc h3 { margin: 24px 0 8px; font-size: 16.5px; color: var(--strong); }
.m-doc h2, .m-doc h3 { scroll-margin-top: 70px; }
.m-doc p, .m-doc ul, .m-doc ol { margin: 0 0 12px; }
.m-doc li { margin: 4px 0; }
.m-doc strong { color: var(--strong); }
.m-doc code, .m-doc kbd {
  padding: 1px 6px; border-radius: 5px; background: var(--code-bg); color: var(--strong);
  font: 0.88em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.m-doc kbd { border: 1px solid var(--border); border-bottom-width: 2px; }
.m-doc pre { overflow-x: auto; padding: 12px 14px; border-radius: 10px; background: var(--code-bg); font-size: 13px; line-height: 1.5; }
.m-doc pre code { padding: 0; background: none; }

/* Índice automático da página (gerado por manual.js a partir dos h2) */
.m-toc { margin: 0 0 8px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.m-toc p { margin: 0 0 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.m-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; font-size: 14px; }
.m-toc li { margin: 2px 0; break-inside: avoid; }

/* Destaques */
.m-note, .m-tip, .m-warn, .m-danger {
  margin: 16px 0; padding: 12px 16px; border-left: 4px solid; border-radius: 10px; font-size: 14.5px;
}
.m-note { border-color: var(--brand); background: var(--brand-soft); }
.m-tip { border-color: var(--green); background: var(--green-soft); }
.m-warn { border-color: var(--amber); background: var(--amber-soft); }
.m-danger { border-color: var(--red); background: var(--red-soft); }
.m-note > :last-child, .m-tip > :last-child, .m-warn > :last-child, .m-danger > :last-child { margin-bottom: 0; }

/* Passo a passo numerado */
.m-steps { list-style: none; counter-reset: step; padding: 0; }
.m-steps > li { position: relative; counter-increment: step; margin: 0 0 12px; padding-left: 44px; min-height: 30px; }
.m-steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 14px;
}

/* Tabelas (campos, colunas, status) */
.m-table-wrap { overflow-x: auto; margin: 12px 0 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.m-doc table { width: 100%; border-collapse: collapse; font-size: 14px; }
.m-doc th { padding: 9px 12px; text-align: left; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.m-doc td { padding: 9px 12px; border-top: 1px solid var(--border); vertical-align: top; }
.m-doc td:first-child { font-weight: 600; color: var(--strong); white-space: nowrap; }

/* Indicadores do semáforo e de status */
.m-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.m-dot.green { background: #15803d; } .m-dot.yellow { background: #d97706; } .m-dot.red { background: #b91c1c; } .m-dot.gray { background: var(--gray); } .m-dot.blue { background: #2a70a4; }
.m-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--soft); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.m-btn { display: inline-block; padding: 1px 9px; border-radius: 7px; font-size: 13px; font-weight: 600; background: var(--surface); color: var(--strong); border: 1px solid var(--border); white-space: nowrap; }

/* Cartões (sumário e "veja também") */
.m-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 12px 0 24px; padding: 0; list-style: none; }
.m-cards li { margin: 0; }
.m-cards a { display: block; height: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); transition: border-color .15s, transform .15s; }
.m-cards a:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-1px); }
.m-cards b { display: block; color: var(--strong); margin-bottom: 2px; }
.m-cards span { font-size: 13.5px; color: var(--muted); }
.m-related { margin-top: 48px; }

/* Perguntas frequentes */
.m-doc details { margin: 8px 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.m-doc summary { cursor: pointer; font-weight: 600; color: var(--strong); }
.m-doc details[open] summary { margin-bottom: 8px; }

/* Manual completo */
.m-chapter + .m-chapter { margin-top: 64px; padding-top: 32px; border-top: 3px solid var(--border); }
.m-cover { padding: 48px 0 24px; }
.m-cover h1 { font-size: 38px; }
.m-full-toc > ol { columns: 2; list-style: none; padding: 0; }
.m-full-toc > ol > li { margin-bottom: 12px; }
.m-full-toc > ol > li > ol { columns: 1; margin-top: 2px; }

/* Aberto dentro do portal (painel de ajuda): sem barra superior, margens menores */
.m-embedded .m-top { display: none; }
.m-embedded .m-doc { padding-top: 20px; }
.m-embedded .m-embed-hide { display: none; }

@media (max-width: 640px) {
  .m-doc h1 { font-size: 25px; }
  .m-toc ol { columns: 1; }
}

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .m-top, .m-toc:not(.m-full-toc), .m-noprint { display: none !important; }
  .m-full-toc { border: 0; padding: 0; break-after: page; }
  .m-doc { max-width: none; padding: 0; }
  .m-chapter { break-before: page; border: 0 !important; margin: 0 !important; padding: 0 !important; }
  .m-doc h2, .m-doc h3 { break-after: avoid; }
  .m-table-wrap, .m-note, .m-tip, .m-warn, .m-danger, .m-steps > li { break-inside: avoid; }
  a { color: inherit; }
}
