/* ==========================================================================
   Productopia · Política de Privacidade
   Mesmo sistema visual da LP de advocacia (/advocacia/css/style.css)
   e das páginas de case (/cases/css/case.css).
   Mobile first. Breakpoints: 768px (tablet) · 1024px (desktop)
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Fundos */
  --dark: #101727;
  --paper: #FFFFFF;

  /* Texto sobre fundo claro */
  --ink: #0E0E11;
  --ink-2: #2A2A30;
  --ink-3: #3F3F46;
  --text: #5C5C66;
  --text-2: #6B6B75;
  --mute-strong: #74747E;

  /* Linhas e superfícies claras */
  --line: #E7E7EB;
  --line-2: #E4E5EA;
  --surface-2: #FAFAFB;

  /* Marca */
  --accent: #FF5C00;
  --accent-ink: #E23000;    /* laranja para texto sobre branco (contraste AA) */
  --cta: #FF8C60;
  --cta-hover: #FF9D78;

  /* Texto e linhas sobre fundo escuro */
  --d-text: #F5F5F6;
  --d-body: #A3A3AD;
  --d-mute: #85858F;
  --d-line: rgba(255, 255, 255, 0.14);

  /* Tipografia */
  --font-sans: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Layout: os mesmos limites laterais das outras páginas */
  --container: 1200px;
  --gutter: 0px;            /* respiro fora do container */
  --pad: 20px;              /* respiro dentro do container */
  --header-h: 60px;
  --hang: 0px;              /* margem onde o número do item fica pendurado */
  --toc-w: 340px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 768px) {
  :root {
    --gutter: 24px;
    --pad: 24px;
    --header-h: 56px;
    --hang: 48px;
  }
}

@media (min-width: 1024px) {
  :root {
    --gutter: 32px;
    --pad: 32px;
    --hang: 56px;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, p, ul, ol, table { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
strong, b { font-weight: 600; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Container ---------- */
.wrap {
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

@media (min-width: 768px) {
  .wrap { border-inline: 1px solid var(--line); }
  .is-dark .wrap { border-color: var(--d-line); }
}

.is-dark {
  background: var(--dark);
  color: var(--d-text);
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn--cta { background: var(--cta); color: var(--ink); }
.btn--cta:hover { background: var(--cta-hover); }

.btn--sm {
  position: relative;
  height: 40px;
  padding: 0 14px;
  border-radius: 5px;
  font-size: 14px;
}

/* área de toque de 44px sem aumentar o botão */
.btn--sm::after {
  content: '';
  position: absolute;
  inset: -2px 0;
}

@media (min-width: 768px) {
  .btn--sm { height: 38px; }
}

/* ==========================================================================
   HEADER (barra translúcida com blur, igual à LP)
   ========================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  border-radius: 0 0 4px 4px;
  color: var(--dark);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}

/* Rolando sobre seções claras */
.site-header[data-theme='light'] {
  background: rgba(255, 255, 255, 0.62);
  border-bottom-color: var(--line);
  color: var(--dark);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

/* Rolando sobre seções escuras */
.site-header[data-theme='dark'] {
  background: rgba(16, 23, 39, 0.6);
  border-bottom-color: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

/* Topo da página, antes de qualquer rolagem */
.site-header[data-theme='top'] {
  background: rgba(255, 255, 255, 0.12);
  border-bottom-color: var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(var(--container), 100% - 2 * var(--gutter));
  height: 100%;
  margin-inline: auto;
  padding-inline: var(--pad);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
}

.brand__full {
  display: none;
  width: auto;
  height: 20px;
}

.brand__mark {
  width: 32px;
  height: auto;
}

@media (min-width: 768px) {
  .brand__full { display: block; }
  .brand__mark { display: none; }
}

/* ponto laranja "pisca" no hover, como na Home */
.brand:hover .logo-dot,
.footer__logo:hover .logo-dot {
  animation: dot-flicker 0.5s linear infinite;
}

@keyframes dot-flicker {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==========================================================================
   Abertura: título do documento e data de vigência
   ========================================================================== */
.doc-hero__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: calc(var(--header-h) + 48px) var(--pad) 40px;
}

.doc-hero__title {
  font-size: clamp(2.125rem, 1.35rem + 3.1vw, 3.5rem);
  line-height: 1.07;
  font-weight: 500;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.doc-hero__date {
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .doc-hero__body {
    gap: 20px;
    padding: calc(var(--header-h) + 72px) var(--pad) 56px;
  }
}

@media (min-width: 1024px) {
  .doc-hero__body { padding: calc(var(--header-h) + 96px) var(--pad) 64px; }
  .doc-hero__date { font-size: 12.5px; }
}

/* ==========================================================================
   Corpo do documento: índice à esquerda, itens à direita
   No celular a ordem é resumo → índice → itens.
   ========================================================================== */
.doc__grid { border-top: 1px solid var(--line); }

@media (min-width: 1024px) {
  .doc__grid {
    display: grid;
    grid-template-columns: var(--toc-w) minmax(0, 1fr);
  }

  .toc {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .resumo,
  .clauses { grid-column: 2; }
}

/* ---------- Índice ---------- */
.toc {
  padding: 8px var(--pad) 12px;
  border-top: 1px solid var(--line);
}

.toc__track { position: relative; }

.toc__list a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 44px;
  padding: 11px 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.toc__num {
  flex: 0 0 22px;
  color: var(--mute-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* "Em resumo" vem logo acima do índice no celular: só entra na lista no desktop */
.toc__resumo,
.toc__marker { display: none; }

@media (min-width: 768px) {
  .toc__list {
    columns: 2;
    column-gap: 40px;
  }

  .toc__list li { break-inside: avoid; }

  /* os títulos do índice alinham com o texto dos itens */
  .toc__num { flex-basis: calc(var(--hang) - 10px); }
}

@media (min-width: 1024px) {
  .toc {
    padding: 0;
    border-top: 0;
    border-right: 1px solid var(--line);
  }

  /* fixo enquanto o documento rola; rola por dentro se a tela for baixa */
  .toc__inner {
    position: sticky;
    top: var(--header-h);
    max-height: calc(100vh - var(--header-h));
    padding: 56px var(--pad) 40px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .toc__list { columns: auto; }
  .toc__resumo { display: block; }

  .toc__list a {
    min-height: 0;
    padding: 7px 0 7px 20px;
    color: var(--text-2);
    font-size: 14px;
  }

  .toc__list a:hover,
  .toc__list a[aria-current] { color: var(--ink); }

  .toc__num { flex-basis: 20px; }
  .toc__list a[aria-current] .toc__num { color: var(--ink); }

  /* marcador do item em leitura: o mesmo quadrado laranja dos rótulos da LP */
  .js .toc__marker {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 2px;
    background: var(--accent);
    opacity: 0;
    transform: translateY(var(--y, 0px));
    transition: transform 0.35s var(--ease-out), opacity 0.2s ease;
  }

  .js .toc__marker.is-on { opacity: 1; }
}

/* Telas baixas (notebooks): o índice aperta para caber inteiro */
@media (min-width: 1024px) and (max-height: 760px) {
  .toc__inner { padding: 36px var(--pad) 24px; }
  .toc__list a { padding-block: 6px; }
}

/* ---------- Itens ---------- */
.resumo,
.clause { padding: 36px var(--pad) 40px; }

.clause { border-top: 1px solid var(--line); }

.clause__title {
  font-size: clamp(1.375rem, 1.2rem + 0.75vw, 1.75rem);
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.clause__num {
  display: block;
  margin-bottom: 8px;
  color: var(--mute-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 400;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 768px) {
  .resumo,
  .clause {
    padding: 48px var(--pad) 56px calc(var(--pad) + var(--hang));
  }

  /* o número fica pendurado na margem, na linha de base do título */
  .clause__title--num {
    display: grid;
    grid-template-columns: var(--hang) minmax(0, 1fr);
    align-items: baseline;
    margin-left: calc(-1 * var(--hang));
  }

  .clause__num {
    margin-bottom: 0;
    font-size: 13px;
  }
}

@media (min-width: 1024px) {
  .resumo,
  .clause {
    padding-top: 56px;
    padding-bottom: 64px;
  }
}

/* ---------- Texto corrido ---------- */
.prose { margin-top: 20px; }
.prose > * + * { margin-top: 16px; }

.prose p,
.prose li {
  max-width: 620px;         /* cerca de 75 caracteres por linha */
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
  text-wrap: pretty;
}

.prose strong {
  color: var(--ink);
  font-weight: 500;
}

.prose h3 {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.prose > * + h3 { margin-top: 36px; }

.prose ul {
  display: grid;
  gap: 10px;
}

.prose li {
  position: relative;
  padding-left: 20px;
}

/* marcador em círculo vazado, como nas listas da LP */
.prose li::before {
  content: '';
  position: absolute;
  top: calc((1.65em - 7px) / 2);
  left: 0;
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--ink-3);
  border-radius: 50%;
}

.prose a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.prose a:hover { color: var(--ink); }

/* parágrafo de abertura do resumo */
.prose .lead {
  max-width: 640px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.prose .lead + p { margin-top: 20px; }

@media (min-width: 768px) {
  .prose { margin-top: 24px; }
  .prose .lead { font-size: 22px; }
}

@media (min-width: 1024px) {
  .prose p,
  .prose li { font-size: 16.5px; }

  .prose h3 { font-size: 18px; }
  .prose .lead { font-size: 24px; }
}

/* Trecho do texto que ainda depende de definição antes de publicar */
.pend {
  padding: 1px 5px;
  border-radius: 3px;
  background: #FFF1E8;
  color: var(--ink);
  outline: 1px dashed var(--accent);
  outline-offset: -1px;
}

/* ---------- Tabelas ---------- */
/* No celular cada linha vira um bloco, com o nome da coluna acima do valor */
.sheet {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.sheet table {
  display: block;
  width: 100%;
  border-collapse: collapse;
}

.sheet thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.sheet tbody,
.sheet tr,
.sheet th,
.sheet td { display: block; }

.sheet tbody tr { padding: 18px 0 20px; }
.sheet tbody tr + tr { border-top: 1px solid var(--line); }

.sheet tbody th {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-align: left;
}

.sheet td {
  margin-top: 12px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

.sheet td::before {
  content: attr(data-label);
  display: block;
  margin-bottom: 2px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .sheet { margin-top: 28px; }

  .sheet table { display: table; table-layout: fixed; }

  .sheet thead {
    position: static;
    display: table-header-group;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }

  .sheet tbody { display: table-row-group; }
  .sheet tr { display: table-row; }

  .sheet th,
  .sheet td {
    display: table-cell;
    padding: 16px 24px 18px 0;
    vertical-align: top;
    text-align: left;
  }

  .sheet th:last-child,
  .sheet td:last-child { padding-right: 0; }

  .sheet tbody tr { padding: 0; }
  .sheet tbody tr + tr { border-top: 0; }

  .sheet tbody th,
  .sheet tbody td { border-top: 1px solid var(--line); }

  .sheet thead th {
    padding-top: 12px;
    padding-bottom: 12px;
    color: var(--text-2);
    font-family: var(--font-mono);
    font-size: 11.5px;
    line-height: 1.5;
    font-weight: 500;
  }

  .sheet tbody th { font-size: 15px; line-height: 1.5; }

  .sheet td {
    margin-top: 0;
    font-size: 15px;
    line-height: 1.5;
  }

  .sheet td::before { content: none; }

  /* larguras de coluna por tabela */
  .sheet--bases th:first-child { width: 36%; }
  .sheet--cookies th:first-child { width: 24%; }
  .sheet--cookies th:last-child { width: 32%; }
  .sheet--prazos th:first-child { width: 42%; }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer { border-top: 1px solid var(--d-line); }

.site-footer .wrap { padding: 32px var(--pad) 40px; }

.footer__top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.footer__logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #FFFFFF;
}

.footer__logo svg {
  width: auto;
  height: 20px;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  color: var(--d-body);
  font-size: 14px;
}

.footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  transition: color 0.2s ease;
}

.footer__links a:hover { color: var(--d-text); }

.footer__legal {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--d-line);
  color: var(--d-mute);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
}

/* Área de toque de 44px sem mexer na altura da linha */
.footer__legal a {
  display: inline-block;
  margin: -13px 0;
  padding: 13px 0;
  transition: color 0.2s ease;
}

.footer__legal a:hover { color: var(--d-text); }

@media (min-width: 768px) {
  .site-footer .wrap { padding: 40px var(--pad); }

  .footer__top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
  }

  .footer__links { gap: 0 28px; }

  .footer__legal {
    flex-direction: row;
    justify-content: space-between;
    gap: 24px;
    margin-top: 24px;
  }
}

/* ==========================================================================
   Entrada da abertura (um único gesto, só com JS e sem "reduzir movimento")
   ========================================================================== */
.js-anim [data-intro] { opacity: 0; }

[data-intro] {
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.js-anim [data-intro]:not(.is-in) { transform: translateY(14px); }

[data-intro].is-in {
  opacity: 1;
  transform: none;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Impressão: só o documento
   ========================================================================== */
@media print {
  .site-header,
  .toc,
  .footer__top { display: none; }

  .wrap {
    width: auto;
    border: 0;
  }

  .doc__grid { display: block; }
  .doc-hero__body { padding-top: 0; }

  .resumo,
  .clause { padding-inline: 0; }

  .clause__title--num { margin-left: 0; }
  .clause__title { break-after: avoid; }
  .sheet tr { break-inside: avoid; }

  .is-dark {
    background: none;
    color: var(--text);
  }

  .footer__legal {
    border-top-color: var(--line);
    color: var(--text);
  }

  [data-intro] {
    opacity: 1 !important;
    transform: none !important;
  }
}
