/* Páginas legais (/privacidade e /termos): mesmas cores e fonte da landing, em largura de leitura. Sempre claras,
   como a landing (o modo escuro é só do sistema logado). */
:root {
  --primary: #006a6a;
  --primary-soft: #9ff2ef;
  --primary-tint: #e3f6f5;
  --surface: #ffffff;
  --surface-low: #f1f4f3;
  --text: #161d1d;
  --text-muted: #3f4948;
  --border: #d9e2e1;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font:
    400 1rem/1.7 Inter,
    system-ui,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Links sem sublinhado: o hover avisa que dá para clicar, como na landing. */
a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

a:hover,
a:focus-visible {
  background: var(--primary-tint);
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

.topbar {
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand svg {
  width: 32px;
  height: 32px;
}

.topbar a.back {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.topbar a.back:hover {
  color: var(--primary);
  background: none;
}

.hero {
  padding: 40px 0 24px;
  background: linear-gradient(180deg, var(--primary-tint) 0%, var(--surface) 100%);
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
}

.version {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Sumário: no celular, um cartão antes do texto; no desktop, um trilho à esquerda que fica preso na tela e
   acende a seção que está sendo lida (legal.js), no mesmo estilo da vitrine da landing. */
.toc {
  margin: 24px 0 8px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-low);
}

.toc strong {
  display: block;
  margin-bottom: 0.25rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.25rem;
}

.toc a {
  font-weight: 400;
}

main {
  min-width: 0;
  max-width: 720px;
}

@media (min-width: 960px) {
  .doc {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 56px;
    align-items: start;
  }

  .toc {
    position: sticky;
    top: 24px;
    margin: 32px 0 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
  }

  .toc strong {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .toc ol {
    padding: 0;
    list-style: none;
  }

  .toc li {
    --item-progress: 0;
    position: relative;
    margin: 0;
  }

  /* Trilho à esquerda; no item ativo ele enche conforme a seção é lida */
  .toc li::before,
  .toc li::after {
    content: '';
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 0;
    width: 3px;
    border-radius: 3px;
    background: var(--border);
  }

  .toc li::after {
    bottom: auto;
    height: calc((100% - 12px) * var(--item-progress));
    background: var(--primary);
  }

  .toc a {
    display: block;
    padding: 6px 10px 6px 18px;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.4;
    opacity: 0.6;
    border-radius: 0 8px 8px 0;
    transition:
      color 0.2s ease,
      opacity 0.3s ease,
      background-color 0.2s ease;
  }

  .toc a:hover,
  .toc a:focus-visible {
    color: var(--primary);
    opacity: 1;
  }

  .toc li.active a {
    color: var(--text);
    font-weight: 600;
    opacity: 1;
  }
}

main section {
  padding-top: 16px;
}

h2 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.3rem;
}

h3 {
  margin: 1.25rem 0 0.25rem;
  font-size: 1.05rem;
}

p,
ul {
  margin: 0 0 0.75rem;
}

li {
  margin-bottom: 0.25rem;
}

table {
  width: 100%;
  margin: 0 0 0.75rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 8px 10px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-low);
}

/* Tabela larga rola só dentro dela, nunca a página. */
.table-scroll {
  overflow-x: auto;
}

.footer {
  margin-top: 48px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer a {
  color: var(--text-muted);
  font-weight: 400;
}

.footer a:hover {
  color: var(--primary);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
