/* =========================================================================
   ihelp — Legal pages layout (Termos de Uso / Política de Privacidade)
   Built on top of colors_and_type.css tokens.
   ========================================================================= */

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

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

body {
  margin: 0;
  font-family: var(--ihelp-font-sans);
  font-size: var(--ihelp-fs-md);
  line-height: var(--ihelp-lh-normal);
  color: var(--ihelp-fg-body);
  background: var(--ihelp-bg-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Reading progress bar ---------- */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--ihelp-primary-500);
  z-index: 60;
  transition: width 80ms linear;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ihelp-border-subtle);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 26px; width: auto; display: block; }
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a {
  font-size: var(--ihelp-fs-lg);
  font-weight: var(--ihelp-fw-medium);
  color: var(--ihelp-fg-muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--ihelp-radius-md);
  transition: background var(--ihelp-duration-fast) var(--ihelp-ease-out),
              color var(--ihelp-duration-fast) var(--ihelp-ease-out);
  white-space: nowrap;
}
.topnav a:hover { background: var(--ihelp-slate-100); color: var(--ihelp-fg-primary); }
.topnav a.active { color: var(--ihelp-primary-600); }
.topnav a.active:hover { background: var(--ihelp-primary-50); }
.btn-app {
  margin-left: 8px;
  background: var(--ihelp-primary-500);
  color: #fff !important;
  padding: 9px 16px !important;
  border-radius: var(--ihelp-radius-lg);
  font-weight: var(--ihelp-fw-semibold);
  box-shadow: var(--ihelp-shadow-surface);
}
.btn-app:hover { background: var(--ihelp-primary-600) !important; }

/* ---------- Hero ---------- */
.hero {
  background: var(--ihelp-bg-page);
  border-bottom: 1px solid var(--ihelp-border-subtle);
}
.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 32px 48px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--ihelp-fs-xs);
  font-weight: var(--ihelp-fw-semibold);
  letter-spacing: var(--ihelp-tracking-wide);
  text-transform: uppercase;
  color: var(--ihelp-primary-700);
  background: var(--ihelp-primary-50);
  border: 1px solid var(--ihelp-primary-200);
  padding: 5px 11px;
  border-radius: var(--ihelp-radius-pill);
}
.hero h1 {
  margin: 20px 0 0;
  font-size: var(--ihelp-fs-5xl);
  font-weight: var(--ihelp-fw-bold);
  line-height: var(--ihelp-lh-tight);
  letter-spacing: var(--ihelp-tracking-tight);
  color: var(--ihelp-fg-primary);
}
.hero p.lede {
  margin: 16px 0 0;
  max-width: 640px;
  font-size: var(--ihelp-fs-xl);
  line-height: var(--ihelp-lh-relaxed);
  color: var(--ihelp-fg-muted);
  text-wrap: pretty;
}
.hero-meta {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--ihelp-fs-sm);
  color: var(--ihelp-fg-muted);
  background: var(--ihelp-bg-surface);
  border: 1px solid var(--ihelp-border-subtle);
  padding: 7px 12px;
  border-radius: var(--ihelp-radius-pill);
}
.meta-chip svg { width: 15px; height: 15px; color: var(--ihelp-fg-subtle); }

/* doc switcher */
.switcher {
  margin-top: 28px;
  display: inline-flex;
  background: var(--ihelp-slate-100);
  border: 1px solid var(--ihelp-border-subtle);
  border-radius: var(--ihelp-radius-lg);
  padding: 4px;
  gap: 4px;
}
.switcher a {
  font-size: var(--ihelp-fs-lg);
  font-weight: var(--ihelp-fw-medium);
  color: var(--ihelp-fg-muted);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--ihelp-radius-md);
  transition: all var(--ihelp-duration-fast) var(--ihelp-ease-out);
}
.switcher a:hover { color: var(--ihelp-fg-primary); }
.switcher a.active {
  background: var(--ihelp-bg-surface);
  color: var(--ihelp-primary-600);
  box-shadow: var(--ihelp-shadow-surface);
}

/* ---------- Layout grid ---------- */
.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 32px 96px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 56px;
  align-items: start;
}

/* ---------- TOC sidebar ---------- */
.toc {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.toc-title {
  font-size: var(--ihelp-fs-xs);
  font-weight: var(--ihelp-fw-semibold);
  letter-spacing: var(--ihelp-tracking-wide);
  text-transform: uppercase;
  color: var(--ihelp-fg-subtle);
  margin: 0 0 14px;
  padding-left: 14px;
}
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { margin: 0; }
.toc a {
  counter-increment: toc;
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 7px 14px;
  font-size: var(--ihelp-fs-lg);
  line-height: var(--ihelp-lh-snug);
  color: var(--ihelp-fg-muted);
  text-decoration: none;
  border-left: 2px solid var(--ihelp-border-subtle);
  transition: all var(--ihelp-duration-fast) var(--ihelp-ease-out);
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--ihelp-font-mono);
  font-size: var(--ihelp-fs-sm);
  color: var(--ihelp-fg-disabled);
  flex: none;
}
.toc a:hover { color: var(--ihelp-fg-primary); background: var(--ihelp-slate-50); }
.toc a.active {
  color: var(--ihelp-primary-700);
  border-left-color: var(--ihelp-primary-500);
  font-weight: var(--ihelp-fw-medium);
}
.toc a.active::before { color: var(--ihelp-primary-500); }

/* ---------- Content ---------- */
.content { max-width: 720px; min-width: 0; }
.content section { scroll-margin-top: 96px; padding-bottom: 8px; }
.content section + section { margin-top: 48px; }

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ihelp-border-subtle);
}
.sec-num {
  font-family: var(--ihelp-font-mono);
  font-size: var(--ihelp-fs-lg);
  font-weight: var(--ihelp-fw-medium);
  color: var(--ihelp-primary-500);
  flex: none;
}
.content h2 {
  margin: 0;
  font-size: var(--ihelp-fs-3xl);
  font-weight: var(--ihelp-fw-semibold);
  line-height: var(--ihelp-lh-snug);
  color: var(--ihelp-fg-primary);
  letter-spacing: var(--ihelp-tracking-tight);
}
.content h3 {
  margin: 28px 0 8px;
  font-size: var(--ihelp-fs-xl);
  font-weight: var(--ihelp-fw-semibold);
  color: var(--ihelp-fg-primary);
}
.content p {
  margin: 0 0 14px;
  font-size: var(--ihelp-fs-lg);
  line-height: var(--ihelp-lh-relaxed);
  color: var(--ihelp-fg-body);
  text-wrap: pretty;
}
.content ul, .content ol.bul { margin: 0 0 14px; padding: 0; list-style: none; }
.content ul li, .content ol.bul li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
  font-size: var(--ihelp-fs-lg);
  line-height: var(--ihelp-lh-relaxed);
  color: var(--ihelp-fg-body);
}
.content ul li::before {
  content: "";
  position: absolute;
  left: 6px; top: 10px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ihelp-primary-400);
}
.content ol.bul { counter-reset: item; }
.content ol.bul li { counter-increment: item; }
.content ol.bul li::before {
  content: counter(item);
  position: absolute;
  left: 0; top: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ihelp-primary-50);
  color: var(--ihelp-primary-700);
  font-size: 11px;
  font-weight: var(--ihelp-fw-semibold);
  font-family: var(--ihelp-font-mono);
  display: flex; align-items: center; justify-content: center;
}
.content a.inline { color: var(--ihelp-primary-600); text-decoration: none; font-weight: var(--ihelp-fw-medium); }
.content a.inline:hover { text-decoration: underline; }
.content strong { color: var(--ihelp-fg-primary); font-weight: var(--ihelp-fw-semibold); }
.term { font-weight: var(--ihelp-fw-semibold); color: var(--ihelp-fg-primary); }

/* ---------- Callout ---------- */
.callout {
  background: var(--ihelp-slate-50);
  border: 1px solid var(--ihelp-border-subtle);
  border-radius: var(--ihelp-radius-lg);
  padding: 18px 20px;
  margin: 18px 0;
  display: flex;
  gap: 14px;
}
.callout svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.callout p { margin: 0; font-size: var(--ihelp-fs-md); line-height: var(--ihelp-lh-relaxed); }
.callout .callout-title {
  display: block;
  font-weight: var(--ihelp-fw-semibold);
  color: var(--ihelp-fg-primary);
  margin-bottom: 3px;
  font-size: var(--ihelp-fs-md);
}
.callout.warn { background: var(--ihelp-status-warning-bg); border-color: #FACC8A; }
.callout.warn svg { color: var(--ihelp-status-warning-fg); }
.callout.info svg { color: var(--ihelp-info); }

/* ---------- Definition / rights grid ---------- */
.def-list { display: grid; gap: 12px; margin: 8px 0 14px; }
.def-item {
  background: var(--ihelp-bg-surface);
  border: 1px solid var(--ihelp-border-subtle);
  border-radius: var(--ihelp-radius-lg);
  padding: 16px 18px;
  box-shadow: var(--ihelp-shadow-surface);
}
.def-item dt {
  font-weight: var(--ihelp-fw-semibold);
  color: var(--ihelp-fg-primary);
  font-size: var(--ihelp-fs-lg);
  margin-bottom: 4px;
}
.def-item dd { margin: 0; font-size: var(--ihelp-fs-lg); line-height: var(--ihelp-lh-relaxed); color: var(--ihelp-fg-body); }

.rights-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 8px 0 14px; }
.right-card {
  background: var(--ihelp-bg-surface);
  border: 1px solid var(--ihelp-border-subtle);
  border-radius: var(--ihelp-radius-lg);
  padding: 16px;
  box-shadow: var(--ihelp-shadow-surface);
}
.right-card .ico {
  width: 34px; height: 34px;
  border-radius: var(--ihelp-radius-md);
  background: var(--ihelp-primary-50);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.right-card .ico svg { width: 18px; height: 18px; color: var(--ihelp-primary-600); }
.right-card h4 { margin: 0 0 4px; font-size: var(--ihelp-fs-md); font-weight: var(--ihelp-fw-semibold); color: var(--ihelp-fg-primary); }
.right-card p { margin: 0; font-size: var(--ihelp-fs-sm); line-height: var(--ihelp-lh-snug); color: var(--ihelp-fg-muted); }

/* ---------- Sub-processors table ---------- */
.subproc {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 14px;
  border: 1px solid var(--ihelp-border-subtle);
  border-radius: var(--ihelp-radius-lg);
  overflow: hidden;
  font-size: var(--ihelp-fs-md);
}
.subproc th, .subproc td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--ihelp-border-subtle); }
.subproc thead th {
  background: var(--ihelp-slate-50);
  font-size: var(--ihelp-fs-xs);
  font-weight: var(--ihelp-fw-semibold);
  letter-spacing: var(--ihelp-tracking-wide);
  text-transform: uppercase;
  color: var(--ihelp-fg-subtle);
}
.subproc tbody tr:last-child td { border-bottom: none; }
.subproc td:first-child { font-weight: var(--ihelp-fw-medium); color: var(--ihelp-fg-primary); }

/* ---------- Contact box ---------- */
.contact-box {
  background: var(--ihelp-secondary-400);
  border-radius: var(--ihelp-radius-2xl);
  padding: 32px;
  color: #fff;
  margin-top: 8px;
}
.contact-box h3 { margin: 0 0 6px; font-size: var(--ihelp-fs-2xl); font-weight: var(--ihelp-fw-semibold); color: #fff; }
.contact-box p { color: rgba(255,255,255,0.72); font-size: var(--ihelp-fs-md); margin: 0 0 20px; }
.contact-rows { display: grid; gap: 1px; background: rgba(255,255,255,0.10); border-radius: var(--ihelp-radius-lg); overflow: hidden; }
.contact-row {
  background: rgba(255,255,255,0.04);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
}
.contact-row svg { width: 18px; height: 18px; color: var(--ihelp-primary-400); flex: none; }
.contact-row .lbl { font-size: var(--ihelp-fs-sm); color: rgba(255,255,255,0.55); width: 110px; flex: none; }
.contact-row .val { font-size: var(--ihelp-fs-md); color: #fff; font-weight: var(--ihelp-fw-medium); }
.contact-row a.val { text-decoration: none; }
.contact-row a.val:hover { color: var(--ihelp-primary-300); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--ihelp-border-subtle);
  background: var(--ihelp-bg-page);
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 28px;
}
.footer-legal { max-width: 460px; }
.footer-legal img { height: 24px; margin-bottom: 14px; }
.footer-legal p { margin: 0; font-size: var(--ihelp-fs-sm); line-height: var(--ihelp-lh-relaxed); color: var(--ihelp-fg-subtle); }
.footer-legal .razao { color: var(--ihelp-fg-muted); font-weight: var(--ihelp-fw-medium); }
.footer-links { display: flex; gap: 48px; }
.footer-col h5 {
  margin: 0 0 12px; font-size: var(--ihelp-fs-xs); font-weight: var(--ihelp-fw-semibold);
  letter-spacing: var(--ihelp-tracking-wide); text-transform: uppercase; color: var(--ihelp-fg-subtle);
}
.footer-col a {
  display: block; font-size: var(--ihelp-fs-md); color: var(--ihelp-fg-muted);
  text-decoration: none; margin-bottom: 9px;
  transition: color var(--ihelp-duration-fast) var(--ihelp-ease-out);
}
.footer-col a:hover { color: var(--ihelp-primary-600); }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 28px; bottom: 28px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ihelp-bg-surface);
  border: 1px solid var(--ihelp-border-subtle);
  box-shadow: var(--ihelp-shadow-raised);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: all var(--ihelp-duration-base) var(--ihelp-ease-out);
  z-index: 40;
}
.to-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.to-top:hover { background: var(--ihelp-slate-50); }
.to-top svg { width: 20px; height: 20px; color: var(--ihelp-fg-muted); }

/* ---------- Mobile TOC select ---------- */
.toc-mobile { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; gap: 0; padding-top: 24px; }
  .toc { display: none; }
  .toc-mobile {
    display: block;
    position: sticky; top: 64px; z-index: 30;
    background: var(--ihelp-bg-surface);
    margin: 0 -32px 28px;
    padding: 12px 32px;
    border-bottom: 1px solid var(--ihelp-border-subtle);
  }
  .toc-mobile select {
    width: 100%; font-family: var(--ihelp-font-sans); font-size: var(--ihelp-fs-lg);
    color: var(--ihelp-fg-body); padding: 10px 12px;
    border: 1px solid var(--ihelp-border-strong); border-radius: var(--ihelp-radius-md);
    background: var(--ihelp-bg-surface);
  }
  .content { max-width: 100%; }
  .rights-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: var(--ihelp-fs-4xl); }
}
@media (max-width: 640px) {
  .topbar-inner, .hero-inner, .shell, .footer-inner { padding-left: 20px; padding-right: 20px; }
  .topnav a:not(.btn-app) { display: none; }
  .footer-links { gap: 32px; }
  .subproc { font-size: var(--ihelp-fs-sm); }
  .subproc th, .subproc td { padding: 9px 10px; }
}

/* ---------- Print ---------- */
@media print {
  .topbar, .toc, .toc-mobile, .to-top, .progress, .switcher, .btn-app { display: none !important; }
  .shell { grid-template-columns: 1fr; padding: 0; }
  body { background: #fff; }
  .hero { border: none; }
  .content section { page-break-inside: avoid; }
}
