/* ── Legal Pages (Privacy Policy & Terms) ───────── */

/* Page wrapper */
.legal-page {
  min-height: calc(100vh - 64px);
  padding: 60px 0 100px;
}

.legal-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ── */
.legal-header {
  margin-bottom: 48px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 20px;
  transition: color 0.18s;
}
.back-link:hover { color: var(--purple-light); }

.legal-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--purple-light);
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 16px;
}

.legal-header h1 {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.legal-meta {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.legal-intro {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.75;
  padding: 20px 24px;
  background: rgba(124, 58, 237, 0.06);
  border-left: 3px solid var(--purple);
  border-radius: 0 10px 10px 0;
}

/* ── Table of Contents ── */
.toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 56px;
}

.toc h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.toc ol {
  list-style: decimal;
  padding-left: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 32px;
}

.toc ol li {
  font-size: 14px;
  line-height: 1.4;
}

.toc a {
  color: var(--text-muted);
  transition: color 0.15s;
}
.toc a:hover { color: var(--purple-light); }

/* ── Body ── */
.legal-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.legal-body section {
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
}
.legal-body section:last-child { border-bottom: none; }

.legal-body h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text);
  scroll-margin-top: 80px; /* offset for sticky nav */
}

.legal-body h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 8px;
}
.legal-body h3:first-of-type { margin-top: 4px; }

.legal-body p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 12px;
}
.legal-body p:last-child { margin-bottom: 0; }

.legal-body ul,
.legal-body ol {
  padding-left: 24px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-body ul { list-style: disc; }
.legal-body ol { list-style: decimal; }

.legal-body li {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}

.legal-body a {
  color: var(--purple-light);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.legal-body a:hover { color: #fff; }

.legal-body strong { color: var(--text); font-weight: 600; }

/* ── Third-party table ── */
.third-party-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 16px 0 20px;
}

.tp-row {
  display: grid;
  grid-template-columns: 160px 1fr 200px;
  gap: 0;
}

.tp-row > span {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}
.tp-row > span:last-child { border-right: none; }
.tp-row:last-child > span { border-bottom: none; }

.tp-header {
  background: rgba(255, 255, 255, 0.04);
}
.tp-header span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ── Contact block ── */
.contact-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin: 12px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.contact-block p {
  margin: 0;
  font-size: 15px;
}

/* ── Bottom nav between pages ── */
.legal-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}

.legal-footer-nav a {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 9px;
  transition: color 0.18s, border-color 0.18s;
}
.legal-footer-nav a:hover {
  color: var(--purple-light);
  border-color: rgba(124, 58, 237, 0.4);
}

/* ── Footer active link ── */
.footer-links a.active {
  color: var(--purple-light);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .toc ol {
    grid-template-columns: 1fr;
  }

  .tp-row {
    grid-template-columns: 1fr;
  }
  .tp-row > span {
    border-right: none;
  }
  .tp-header span:not(:first-child) {
    display: none;
  }

  .legal-footer-nav {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}
