/* ============================================================
   LEGAL PAGES STYLES
   Shared between /terms.html and /privacy.html.
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

.legal-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- HEADER ---------------- */

.legal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0f172a;
  color: #ffffff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.legal-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.legal-brand {
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legal-header-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.legal-header-nav a {
  color: #cbd5e1;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.legal-header-nav a:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.legal-header-nav a.active {
  background: #2563eb;
  color: #ffffff;
}

/* ---------------- HERO ---------------- */

.legal-hero {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #ffffff;
  padding: 40px 24px 36px;
}

.legal-hero-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.legal-hero-kicker {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.legal-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.legal-hero-sub {
  font-size: 0.95rem;
  color: #cbd5e1;
  max-width: 720px;
  margin: 0 auto 16px;
  line-height: 1.6;
}

.legal-hero-meta {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 20px;
}

.legal-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legal-hero-meta strong {
  color: #ffffff;
  font-weight: 700;
}

.legal-crosslink {
  display: inline-block;
  padding: 10px 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 30px;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.legal-crosslink a {
  color: #facc15;
  text-decoration: none;
  font-weight: 700;
  margin-left: 4px;
}

.legal-crosslink a:hover {
  text-decoration: underline;
}

/* ---------------- LAYOUT ---------------- */

.legal-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  align-items: start;
}

/* ---------------- TOC ---------------- */

.legal-toc {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.legal-toc-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.legal-toc-title i {
  color: #2563eb;
}

.legal-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.legal-toc-list a {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  color: #475569;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.legal-toc-list a:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.legal-toc-list a.is-current {
  background: #eff6ff;
  color: #1d4ed8;
  border-left-color: #2563eb;
  font-weight: 700;
}

/* ---------------- CONTENT ---------------- */

.legal-content {
  min-width: 0;
  max-width: 820px;
}

.legal-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  scroll-margin-top: 84px;
}

.legal-section h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.legal-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  margin: 16px 0 8px;
}

.legal-section p {
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 12px;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section strong {
  color: #0f172a;
  font-weight: 700;
}

.legal-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legal-list li {
  position: relative;
  padding-left: 20px;
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.6;
}

.legal-list li::before {
  content: '●';
  position: absolute;
  left: 4px;
  top: 0;
  color: #2563eb;
  font-size: 0.6rem;
  line-height: 1.9;
}

.legal-note {
  font-size: 0.82rem;
  color: #64748b;
  font-style: italic;
  margin: 8px 0 12px;
  padding: 8px 12px;
  background: #f8fafc;
  border-left: 3px solid #94a3b8;
  border-radius: 4px;
}

.legal-definitions {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.legal-definitions dt {
  font-weight: 700;
  font-size: 0.85rem;
  color: #0f172a;
}

.legal-definitions dd {
  margin: 2px 0 0;
  padding-left: 0;
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.6;
}

/* ---------------- CALLOUT ---------------- */

.legal-callout {
  margin: 14px 0;
  padding: 14px 18px;
  background: #eff6ff;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
}

.legal-callout strong {
  display: block;
  font-size: 0.85rem;
  color: #1e40af;
  margin-bottom: 8px;
}

.legal-callout ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legal-callout ul li {
  font-size: 0.85rem;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.legal-callout i {
  color: #2563eb;
  width: 16px;
  text-align: center;
}

.legal-callout a {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
}

.legal-callout a:hover {
  text-decoration: underline;
}

/* ---------------- INLINE LINKS ---------------- */

.legal-section a {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgba(37, 99, 235, 0.25);
}

.legal-section a:hover {
  border-bottom-color: #1d4ed8;
  color: #1e40af;
}

/* ---------------- FOOTER ---------------- */

.legal-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 22px 24px;
  font-size: 0.82rem;
}

.legal-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.legal-footer strong {
  color: #ffffff;
  font-weight: 800;
}

.legal-footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.legal-footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8rem;
}

.legal-footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* ---------------- BACK TO TOP ---------------- */

.legal-back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #2563eb;
  color: #ffffff;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.legal-back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.legal-back-to-top:hover {
  transform: translateY(-2px);
  background: #1d4ed8;
}

/* ---------------- COOKIE BANNER ---------------- */

.legal-cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 300;
  max-width: 720px;
  margin: 0 auto;
  background: #0f172a;
  color: #cbd5e1;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
  display: none;
  font-size: 0.85rem;
  line-height: 1.55;
}

.legal-cookie-banner.is-visible {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.legal-cookie-banner p {
  flex: 1;
  min-width: 200px;
  margin: 0;
}

.legal-cookie-banner a {
  color: #facc15;
  font-weight: 700;
  text-decoration: none;
}

.legal-cookie-banner a:hover {
  text-decoration: underline;
}

.legal-cookie-banner button {
  padding: 8px 18px;
  border: none;
  border-radius: 30px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.legal-cookie-banner button:hover {
  background: #1d4ed8;
}

/* ---------------- RESPONSIVE ---------------- */

@media (max-width: 900px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 16px 80px;
  }

  .legal-toc {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .legal-toc-list {
    max-height: 260px;
    overflow-y: auto;
  }

  .legal-section {
    padding: 20px;
  }

  .legal-hero {
    padding: 30px 16px 26px;
  }

  .legal-hero-meta {
    flex-direction: column;
    gap: 6px;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .legal-header-inner {
    padding: 10px 14px;
  }

  .legal-brand {
    font-size: 0.95rem;
  }

  .legal-header-nav a {
    padding: 5px 10px;
    font-size: 0.75rem;
  }

  .legal-section {
    padding: 16px;
    border-radius: 10px;
  }

  .legal-section h2 {
    font-size: 1.05rem;
  }

  .legal-cookie-banner.is-visible {
    flex-direction: column;
    align-items: stretch;
  }

  .legal-cookie-banner button {
    width: 100%;
  }

  .legal-back-to-top {
    right: 12px;
    bottom: 12px;
    width: 40px;
    height: 40px;
  }
}