/* ============================================================
   INTERFALA — css/pages/legal.css
   Template reutilizável para páginas legais (Privacidade,
   Termos, Exclusão de Dados, Cookies, etc.)
   Editorial · Sóbrio · Legível · 100% reutilizável
   ============================================================ */

/* ── Page container ───────────────────────────────────────── */
.legal-page {
  background: #fff;
  color: var(--color-gray-900);
  animation: lg-fade-in 0.4s ease-out;
}
@keyframes lg-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ════════════════════════════════════════════════════════════
   1. HERO COMPACTO (editorial, não-banner)
   ════════════════════════════════════════════════════════════ */
.lg-hero {
  position: relative;
  background: var(--color-lavender);
  padding: 80px 0 60px;
  overflow: hidden;
  isolation: isolate;
}
.lg-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 0%, rgba(174,98,255,0.16), transparent 70%),
    radial-gradient(ellipse 50% 40% at 90% 100%, rgba(0,255,210,0.10), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.lg-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(113,48,240,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(113,48,240,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, #000 0%, transparent 75%);
          mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, #000 0%, transparent 75%);
  pointer-events: none;
  z-index: -1;
}

.lg-hero-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--container-pad, 24px);
  text-align: center;
}

.lg-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--color-gray-900);
  margin: 16px 0 14px;
}

.lg-hero-sub {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--color-gray-700);
  max-width: 620px;
  margin: 0 auto;
}

/* Meta info row (data, versão, leitura) */
.lg-meta {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin-top: 22px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-gray-500);
}
.lg-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  position: relative;
}
.lg-meta-item + .lg-meta-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 12px;
  background: var(--color-gray-300);
}
.lg-meta-icon {
  font-size: 13px;
  opacity: 0.85;
}

/* Aviso de leitura importante (callout no hero) */
.lg-hero-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 700px;
  margin: 28px auto 0;
  padding: 14px 20px;
  background: rgba(0, 255, 210, 0.06);
  border-left: 3px solid var(--color-cyan-dark);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-gray-700);
  text-align: left;
}
.lg-hero-notice strong {
  color: var(--color-gray-900);
  font-weight: 600;
}
.lg-hero-notice-icon {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1.4;
}
.lg-hero-notice.warning {
  background: rgba(245, 158, 11, 0.07);
  border-left-color: var(--color-warning);
}
.lg-hero-notice.privacy {
  background: rgba(113, 48, 240, 0.05);
  border-left-color: var(--color-purple);
}

/* ════════════════════════════════════════════════════════════
   2. CONTEÚDO PRINCIPAL — Layout 2 colunas
   ════════════════════════════════════════════════════════════ */
.lg-main {
  background: #fff;
  padding: 72px 0 96px;
}
.lg-main-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--container-pad, 24px);
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 60px;
  align-items: start;
}

/* ── 2A · SUMÁRIO STICKY ─────────────────────────────────── */
.lg-toc {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-xl);
  padding: 24px;
  font-family: var(--font-body);
  /* subtle scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--color-gray-300) transparent;
}
.lg-toc::-webkit-scrollbar         { width: 6px; }
.lg-toc::-webkit-scrollbar-thumb   { background: var(--color-gray-300); border-radius: 99px; }
.lg-toc::-webkit-scrollbar-track   { background: transparent; }

.lg-toc-eyebrow {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-gray-500);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lg-toc-divider {
  height: 1px;
  background: var(--color-gray-300);
  margin-bottom: 8px;
}

.lg-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lg-toc-list li {
  border-bottom: 1px solid var(--color-gray-100);
}
.lg-toc-list li:last-child {
  border-bottom: none;
}
.lg-toc-list a {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 0;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-gray-700);
  text-decoration: none;
  line-height: 1.4;
  border-left: 3px solid transparent;
  padding-left: 8px;
  margin-left: -8px;
  transition: color 0.2s var(--ease-out), padding-left 0.2s var(--ease-out), border-color 0.2s, font-weight 0.2s;
}
.lg-toc-list a .lg-toc-num {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-gray-500);
  letter-spacing: 0.05em;
  flex-shrink: 0;
  min-width: 22px;
  transition: color 0.2s;
}
.lg-toc-list a:hover {
  color: var(--color-purple);
  padding-left: 12px;
}
.lg-toc-list a:hover .lg-toc-num {
  color: var(--color-purple);
}
.lg-toc-list a.active {
  color: var(--color-purple);
  font-weight: 600;
  border-left-color: var(--color-purple);
  padding-left: 12px;
}
.lg-toc-list a.active .lg-toc-num {
  color: var(--color-purple);
}

.lg-toc-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--color-gray-100);
}
.lg-toc-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-gray-500);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}
.lg-toc-back:hover {
  color: var(--color-purple);
}

/* Mobile toc accordion (hidden on desktop) */
.lg-toc-mobile-toggle {
  display: none;
}

/* ── 2B · CONTEÚDO DO DOCUMENTO ──────────────────────────── */
.lg-content {
  max-width: 720px;
  font-family: var(--font-body);
}

.lg-content h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin-top: 56px;
  margin-bottom: 20px;
  color: var(--color-gray-900);
  letter-spacing: -0.02em;
  line-height: 1.3;
  scroll-margin-top: 100px;
}
.lg-content h2:first-child {
  margin-top: 0;
}
.lg-content h2::before {
  content: attr(data-number);
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-purple);
  margin-bottom: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lg-content h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--color-gray-900);
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.lg-content p {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-gray-700);
  margin-bottom: 18px;
  text-wrap: pretty;
}

.lg-content strong {
  color: var(--color-gray-900);
  font-weight: 600;
}

.lg-content a {
  color: var(--color-purple);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s, text-decoration-thickness 0.2s;
}
.lg-content a:hover {
  color: var(--color-purple-dark);
  text-decoration-thickness: 2px;
}

/* ── Listas ─────────────────────────────────────────────── */
.lg-content ul,
.lg-content ol {
  margin: 16px 0 24px 0;
  padding-left: 24px;
  list-style: revert;
}
.lg-content ul li,
.lg-content ol li {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-gray-700);
  margin-bottom: 8px;
  padding-left: 4px;
}
.lg-content ul li::marker {
  color: var(--color-purple);
}
.lg-content ol li::marker {
  color: var(--color-purple);
  font-weight: 600;
  font-family: var(--font-display);
}

/* ── Tabelas ────────────────────────────────────────────── */
.lg-table-wrap {
  margin: 24px 0;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-gray-300);
}
.lg-content table,
.lg-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
}
.lg-content thead th,
.lg-table thead th {
  background: var(--color-gray-100);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  padding: 14px 16px;
  color: var(--color-gray-900);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--color-gray-300);
  white-space: nowrap;
}
.lg-content tbody td,
.lg-table tbody td {
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-gray-700);
  border-bottom: 1px solid var(--color-gray-100);
  vertical-align: top;
}
.lg-content tbody tr:last-child td,
.lg-table tbody tr:last-child td {
  border-bottom: none;
}
.lg-content tbody tr:hover td,
.lg-table tbody tr:hover td {
  background: rgba(245, 243, 250, 0.6);
}

/* ── Callouts (caixas de destaque) ──────────────────────── */
.legal-callout {
  background: rgba(113, 48, 240, 0.05);
  border-left: 4px solid var(--color-purple);
  padding: 18px 22px;
  margin: 24px 0;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
}
.legal-callout p {
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-gray-700);
}
.legal-callout p + p {
  margin-top: 10px;
}
.legal-callout strong {
  color: var(--color-gray-900);
  font-weight: 600;
}
.legal-callout-warning {
  background: rgba(245, 158, 11, 0.07);
  border-left-color: var(--color-warning);
}
.legal-callout-info {
  background: rgba(0, 255, 210, 0.06);
  border-left-color: var(--color-cyan-dark);
}
.legal-callout-danger {
  background: rgba(239, 68, 68, 0.05);
  border-left-color: var(--color-error);
}

/* Definition list (para glossários ou termos) */
.lg-content dl {
  margin: 18px 0 24px;
  display: grid;
  gap: 14px;
}
.lg-content dt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--color-gray-900);
}
.lg-content dd {
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-gray-700);
  margin-left: 0;
}

/* Bloco de citação editorial */
.lg-content blockquote {
  margin: 24px 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--color-purple-light);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--color-gray-900);
  letter-spacing: -0.015em;
  font-style: normal;
}

/* ════════════════════════════════════════════════════════════
   3. CTA FINAL DE CONTATO
   ════════════════════════════════════════════════════════════ */
.lg-cta {
  background: var(--color-lavender);
  padding: 80px 0 80px;
  position: relative;
  overflow: hidden;
}
.lg-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 50% at 50% 100%, rgba(174,98,255,0.10), transparent 70%);
  pointer-events: none;
}
.lg-cta-card {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  padding: 48px 40px;
  background: #fff;
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
  text-align: center;
}
.lg-cta-card h3 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-gray-900);
  margin: 14px 0 12px;
  line-height: 1.25;
}
.lg-cta-card p {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-gray-700);
  max-width: 520px;
  margin: 0 auto 24px;
}
.lg-cta-btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}
.lg-cta-card .lg-cta-foot {
  font-size: 13px;
  color: var(--color-gray-500);
  margin: 0;
  line-height: 1.6;
}
.lg-cta-card .lg-cta-foot a {
  color: var(--color-purple);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.lg-cta-card .lg-cta-foot a:hover {
  color: var(--color-purple-dark);
}

/* ════════════════════════════════════════════════════════════
   4. INFORMAÇÕES LEGAIS DO RODAPÉ (mini-seção)
   ════════════════════════════════════════════════════════════ */
.lg-legal-foot {
  background: var(--color-gray-100);
  padding: 36px 0;
  border-top: 1px solid var(--color-gray-300);
  font-family: var(--font-body);
  text-align: center;
}
.lg-legal-foot-inner {
  max-width: var(--container-max, 1180px);
  margin: 0 auto;
  padding: 0 var(--container-pad, 24px);
}
.lg-legal-foot-info {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-gray-700);
  margin-bottom: 10px;
}
.lg-legal-foot-info .item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  position: relative;
}
.lg-legal-foot-info .item + .item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 12px;
  background: var(--color-gray-300);
}
.lg-legal-foot-note {
  font-size: 12.5px;
  color: var(--color-gray-500);
  line-height: 1.6;
  max-width: 620px;
  margin: 0 auto 14px;
}
.lg-legal-foot-links {
  font-size: 13px;
  color: var(--color-gray-500);
}
.lg-legal-foot-links .label {
  margin-right: 4px;
}
.lg-legal-foot-links a {
  color: var(--color-gray-700);
  text-decoration: none;
  font-weight: 500;
  padding: 0 4px;
  transition: color 0.2s;
}
.lg-legal-foot-links a:hover {
  color: var(--color-purple);
}
.lg-legal-foot-links .sep {
  color: var(--color-gray-300);
  margin: 0 4px;
}

/* ════════════════════════════════════════════════════════════
   5. BOTÃO "Voltar ao topo" flutuante
   ════════════════════════════════════════════════════════════ */
.lg-back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-purple);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(113,48,240,0.35);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), background 0.2s;
  z-index: 80;
  font-size: 18px;
  line-height: 1;
}
.lg-back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.lg-back-to-top:hover {
  background: #5f24d6;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
  .lg-main-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  /* Sumário vira accordion colapsável */
  .lg-toc {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0;
    border-radius: var(--radius-lg);
  }
  .lg-toc-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    padding: 16px 20px;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-gray-900);
    letter-spacing: -0.01em;
    text-align: left;
  }
  .lg-toc-mobile-toggle .chev {
    transition: transform 0.25s var(--ease-out);
    color: var(--color-gray-500);
    font-size: 16px;
  }
  .lg-toc[data-open="false"] .lg-toc-mobile-toggle .chev {
    transform: rotate(-90deg);
  }
  .lg-toc-body {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s var(--ease-out);
    padding: 0 20px;
  }
  .lg-toc[data-open="true"] .lg-toc-body {
    max-height: 1000px;
    padding: 0 20px 20px;
  }
  .lg-toc-eyebrow,
  .lg-toc-divider {
    display: none;
  }
}

@media (max-width: 767px) {
  .lg-hero {
    padding: 56px 0 44px;
  }
  .lg-hero h1 {
    font-size: clamp(1.7rem, 7vw, 2.2rem);
  }
  .lg-hero-sub {
    font-size: 15px;
  }
  .lg-meta {
    font-size: 12.5px;
    gap: 4px;
  }
  .lg-meta-item {
    padding: 0 10px;
  }
  .lg-hero-notice {
    font-size: 13px;
    padding: 12px 16px;
  }
  .lg-main {
    padding: 48px 0 64px;
  }
  .lg-content {
    font-size: 15px;
  }
  .lg-content h2 {
    font-size: 24px;
    margin-top: 44px;
  }
  .lg-content h3 {
    font-size: 17px;
  }
  .lg-content p,
  .lg-content ul li,
  .lg-content ol li {
    font-size: 15px;
  }
  .lg-content thead th {
    font-size: 11px;
    padding: 12px 14px;
  }
  .lg-content tbody td,
  .lg-table tbody td {
    font-size: 14px;
    padding: 12px 14px;
  }
  .lg-cta {
    padding: 56px 0;
  }
  .lg-cta-card {
    padding: 36px 24px;
  }
  .lg-cta-card h3 {
    font-size: 22px;
  }
  .lg-legal-foot-info {
    flex-direction: column;
    gap: 8px;
  }
  .lg-legal-foot-info .item {
    padding: 0;
  }
  .lg-legal-foot-info .item + .item::before {
    display: none;
  }
  .lg-back-to-top {
    bottom: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
  }
}
