/* ==========================================================================
   Memorial Brasil — Páginas legais (Termos de Uso, Política de Privacidade)
   Carregado depois de home.css; reaproveita tokens, header, footer e botões.
   ========================================================================== */

/* ---------- Topo do documento ---------- */
.legal-hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(130px, 16vw, 180px) 0 clamp(48px, 6vw, 72px);
  border-bottom: 1px solid var(--line);
}
.legal-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 50% 70% at 85% 30%, rgba(217, 168, 108, .32), rgba(236, 217, 189, .3) 40%, transparent 72%),
    radial-gradient(ellipse 40% 50% at 0% 0%, rgba(124, 139, 122, .14), transparent 70%);
}

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--text-dim); margin-bottom: 28px; }
.crumbs a { color: var(--text-soft); transition: color .2s; }
.crumbs a:hover { color: var(--accent-text); }
.crumbs svg { width: 14px; height: 14px; transform: rotate(45deg); opacity: .6; }

.legal-hero h1 { font-size: clamp(42px, 6.4vw, 84px); letter-spacing: -0.045em; line-height: 1; }
.legal-hero h1 em { font-size: 1.06em; }
.legal-lede { max-width: 640px; margin-top: 24px; font-size: clamp(16px, 1.35vw, 19px); color: var(--text-soft); }

.legal-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line-strong);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 14px; font-weight: 500; color: var(--text-soft);
}
.meta-chip svg { width: 16px; height: 16px; color: var(--accent-text); }
.meta-chip strong { color: var(--text); font-weight: 600; }

/* ---------- Layout ---------- */
.legal-body { padding: clamp(48px, 6vw, 80px) 0 clamp(80px, 10vw, 130px); }
.legal-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: clamp(40px, 6vw, 88px); align-items: start; }

/* Sumário */
.toc { position: sticky; top: 108px; }
.toc summary { display: none; }
.toc-title { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 14px; }
.toc ol {
  display: grid; gap: 2px;
  max-height: calc(100vh - 220px); overflow-y: auto;
  padding-right: 6px; scrollbar-width: thin;
  border-left: 1px solid var(--line);
}
.toc a {
  display: flex; gap: 10px;
  padding: 7px 12px 7px 16px; margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 14px; line-height: 1.4; color: var(--text-soft);
  transition: color .2s, border-color .2s, background-color .2s;
}
.toc a span { color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 18px; }
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--text); font-weight: 600; border-left-color: var(--accent); background: linear-gradient(90deg, var(--accent-soft), transparent); }
.toc a.is-active span { color: var(--accent-text); }

.toc-switch {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 28px; padding: 16px 18px; border-radius: var(--r);
  background: var(--bg-2); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600;
  transition: border-color .3s, transform .4s var(--ease-out);
}
.toc-switch small { display: block; font-size: 12px; font-weight: 500; color: var(--text-dim); }
.toc-switch svg { width: 18px; height: 18px; color: var(--accent-text); }
.toc-switch:hover { border-color: var(--accent); transform: translateY(-2px); }

/* ---------- Documento ---------- */
.legal-doc { max-width: 760px; }
.doc-intro p { font-size: 18px; line-height: 1.75; color: var(--text-soft); }
.doc-intro p + p { margin-top: 16px; }
.doc-intro p:first-child { font-size: 20px; color: var(--text); font-weight: 500; }

.doc-section { padding-top: 48px; margin-top: 48px; border-top: 1px solid var(--line); scroll-margin-top: 100px; }
.doc-section h2 {
  display: flex; align-items: baseline; gap: 14px;
  font-size: clamp(24px, 2.4vw, 30px); letter-spacing: -0.03em; line-height: 1.2;
  margin-bottom: 20px;
}
.doc-num {
  flex-shrink: 0;
  display: inline-grid; place-items: center;
  min-width: 38px; height: 30px; padding: 0 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 14px; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums;
  transform: translateY(-3px);
}
.doc-section h3 { font-size: 18px; letter-spacing: -0.015em; margin: 32px 0 12px; }
.doc-section p, .doc-section li { font-size: 16.5px; line-height: 1.75; color: var(--text-soft); }
.doc-section p + p, .doc-section ul + p, .doc-section p + ul, .doc-section .callout + p, .doc-section p + .callout, .doc-section .plans + p { margin-top: 16px; }

.doc-section ul { display: grid; gap: 8px; }
.doc-section ul li { position: relative; padding-left: 26px; }
.doc-section ul li::before {
  content: ""; position: absolute; left: 6px; top: .72em;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
.doc-section ul.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }

.doc-section a, .doc-intro a { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.callout {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 20px 22px; border-radius: var(--r);
  background: var(--bg-3); border: 1px solid var(--line);
}
.callout svg { width: 22px; height: 22px; color: var(--accent-text); flex-shrink: 0; margin-top: 3px; }
.callout p { color: var(--text); font-weight: 500; }

/* Planos dentro do texto */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.plan-box { padding: 22px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); }
.plan-box h3 { margin: 0 0 4px; font-size: 18px; }
.plan-box .plan-price { font-size: 26px; font-weight: 800; letter-spacing: -0.04em; color: var(--text); line-height: 1.2; }
.plan-box ul { margin-top: 14px; gap: 6px; }
.plan-box li { font-size: 14.5px; line-height: 1.5; padding-left: 20px; }
.plan-box li::before { left: 2px; top: .6em; width: 6px; height: 6px; }

/* Contato ao fim */
.contact-card {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-top: 24px; padding: 24px 26px; border-radius: var(--r-lg);
  background: var(--ink); color: #f5efe4;
}
.contact-card .label { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #8f978b; }
.contact-card .mail { display: block; margin-top: 4px; font-size: clamp(17px, 2vw, 21px); font-weight: 700; letter-spacing: -0.02em; color: #f5efe4; word-break: break-all; }

.doc-end {
  margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line);
  font-size: 15px; color: var(--text-dim); font-style: italic;
}

/* ---------- Responsivo ---------- */
@media (max-width: 960px) {
  .legal-layout { grid-template-columns: 1fr; }
  .toc { position: static; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); }
  .toc summary {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; cursor: pointer; list-style: none;
    font-size: 15px; font-weight: 600;
  }
  .toc summary::-webkit-details-marker { display: none; }
  .toc summary svg { width: 18px; height: 18px; transition: transform .3s var(--ease-out); }
  .toc[open] summary svg { transform: rotate(45deg); }
  .toc-inner { padding: 0 12px 16px; }
  .toc-title { display: none; }
  .toc ol { max-height: none; border-left: 0; }
  .toc a { border-left: 0; border-radius: 10px; padding: 9px 10px; }
  .toc a.is-active { background: var(--accent-soft); }
  .toc-switch { margin: 12px 0 0; }
}

@media (max-width: 640px) {
  .plans { grid-template-columns: 1fr; }
  .doc-section ul.cols { grid-template-columns: 1fr; }
  .doc-section h2 { gap: 10px; }
  .doc-intro p:first-child { font-size: 18px; }
  .contact-card .btn { width: 100%; justify-content: space-between; }
}

/* ---------- Impressão ---------- */
@media print {
  .site-header, .site-footer, .toc, .skip-link, .contact-card .btn, .legal-hero::before { display: none !important; }
  body { background: #fff; color: #000; }
  .legal-hero { padding: 0 0 16px; }
  .legal-layout { display: block; }
  .doc-section { break-inside: avoid-page; padding-top: 20px; margin-top: 20px; }
  .doc-section p, .doc-section li { color: #222; }
  .contact-card { background: none; color: #000; border: 1px solid #ccc; }
  .contact-card .mail { color: #000; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
