/* =============================================================================
   LEGAL.CSS — Terms of Service & Privacy Policy (Revolut-inspired layout)
   ============================================================================= */

/* ── Page layout ── */
.legal-page {
  min-height: 100vh;
  background: var(--bg-primary);
}

/* ── Hero header ── */
.legal-hero {
  background: var(--text-primary);
  padding: 72px 0 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.legal-hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.legal-hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.legal-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--purple-light);
  background: rgba(167,139,250,0.12);
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 6px;
  padding: 4px 10px;
}

.legal-version {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  font-weight: 400;
}

.legal-hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  color: #fff;
  margin: 0 0 16px;
  line-height: 1.2;
}

.legal-hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.legal-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 8px 16px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.legal-pdf-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.legal-updated {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}

/* ── Body layout: sidebar + content ── */
.legal-body {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  align-items: start;
}

/* ── Sidebar ── */
.legal-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  max-height: calc(100vh - var(--nav-height) - 48px);
  overflow-y: auto;
  padding: 40px 0 40px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.legal-sidebar::-webkit-scrollbar {
  width: 4px;
}
.legal-sidebar::-webkit-scrollbar-track { background: transparent; }
.legal-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.legal-toc-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 24px 12px;
}

.legal-toc-group {
  margin-bottom: 4px;
}

.legal-toc-group-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 8px 24px 4px;
  display: block;
}

.legal-toc-link {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 24px;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  line-height: 1.4;
}

.legal-toc-link:hover {
  color: var(--purple);
  background: var(--purple-glow);
}

.legal-toc-link.active {
  color: var(--purple);
  border-left-color: var(--purple);
  font-weight: 500;
  background: var(--purple-glow);
}

/* ── Main content ── */
.legal-content {
  padding: 48px 0 80px 56px;
  border-left: 1px solid var(--border);
  min-width: 0;
}

/* ── Section groups ── */
.legal-section-group {
  margin-bottom: 64px;
}

.legal-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--purple);
  margin: 0 0 32px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ── Individual sections ── */
.legal-section {
  margin-bottom: 40px;
  scroll-margin-top: calc(var(--nav-height) + 32px);
}

.legal-section-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

.legal-section h3 {
  font-size: 18px;
  font-weight: 650;
  color: var(--text-primary);
  margin: 0 0 14px;
  line-height: 1.35;
}

.legal-section p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin: 0 0 14px;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section ul,
.legal-section ol {
  margin: 10px 0 14px 0;
  padding-left: 22px;
}

.legal-section li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 6px;
}

.legal-section a {
  color: var(--purple);
  text-decoration: none;
  border-bottom: 1px solid rgba(124,58,237,0.2);
  transition: border-color 0.15s;
}

.legal-section a:hover {
  border-bottom-color: var(--purple);
}

/* ── Highlight box ── */
.legal-highlight {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-left: 3px solid var(--purple);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 18px 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ── Info table ── */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 16px 0;
}

.legal-table th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-section);
}

.legal-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
  line-height: 1.6;
}

.legal-table tr:last-child td {
  border-bottom: none;
}

/* ── Contact card ── */
.legal-contact-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-top: 16px;
  text-decoration: none;
}

.legal-contact-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--purple-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--purple);
}

.legal-contact-card h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.legal-contact-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

/* ── Footer note ── */
.legal-footer-note {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Mobile ── */
@media (max-width: 860px) {
  .legal-body {
    grid-template-columns: 1fr;
  }

  .legal-sidebar {
    position: static;
    max-height: none;
    padding: 24px 0 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
  }

  .legal-content {
    border-left: none;
    padding: 32px 0 60px;
  }
}

/* ── Hero legal navigation ── */
.legal-hero-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.legal-hero-nav-link {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.legal-hero-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.legal-hero-nav-link.active-page {
  color: #fff;
  background: rgba(167, 139, 250, 0.2);
  border-color: rgba(167, 139, 250, 0.4);
  font-weight: 600;
}

@media (max-width: 860px) {
  .legal-hero-nav { gap: 6px; }
  .legal-hero-nav-link { font-size: 12px; padding: 6px 12px; }
}
