/* ═══════════════════════════════════════════════════════════════
   LEGAL PAGES — shared design system
   Used by: Terms.cshtml, Privacy.cshtml, AiSafety.cshtml
   ═══════════════════════════════════════════════════════════════ */

/* ── Hero ──────────────────────────────────────────────────────── */
.legal-hero {
  position: relative;
  padding: 96px 24px 56px;
  background: linear-gradient(135deg, #0a1d3d 0%, #1e3a6f 45%, #311B92 100%);
  color: #fff;
  text-align: center;
  overflow: hidden;
}
.legal-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(245,124,0,0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(194,24,91,0.14) 0%, transparent 50%);
  pointer-events: none;
}
.legal-hero-inner {
  max-width: 840px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.legal-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(255,255,255,0.10);
  border: 0.5px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #FCD34D;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.legal-hero-eyebrow i { font-size: 12px; }
.legal-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.18;
  margin: 0 0 14px;
  color: #fff;
}
.legal-hero p {
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.6;
  color: rgba(255,255,255,0.86);
  max-width: 620px;
  margin: 0 auto;
}
.legal-meta-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 22px;
}
.legal-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(255,255,255,0.08);
  border: 0.5px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  font-size: 11.5px;
  color: rgba(255,255,255,0.78);
  letter-spacing: 0.04em;
}
.legal-meta-pill i { font-size: 10px; color: #FCD34D; }

/* ── Policy switcher (small pills under hero) ──────────────────── */
.legal-switcher {
  background: #F4F3F7;
  padding: 18px 24px;
  border-bottom: 1px solid #E2E8F0;
}
.legal-switcher-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.legal-switcher-label {
  font-size: 11px;
  font-weight: 700;
  color: #5F5E5A;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.legal-switcher-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.legal-switcher-pill i { font-size: 11px; color: #534AB7; }
.legal-switcher-pill:hover {
  background: #534AB7;
  color: #fff;
  border-color: #534AB7;
  transform: translateY(-1px);
}
.legal-switcher-pill:hover i { color: #FCD34D; }
.legal-switcher-pill.active {
  background: #534AB7;
  color: #fff;
  border-color: #534AB7;
}
.legal-switcher-pill.active i { color: #FCD34D; }

/* ── Body layout ───────────────────────────────────────────────── */
.legal-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
}
.legal-content { max-width: 760px; }

/* ── TOC sidebar ───────────────────────────────────────────────── */
.legal-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  font-size: 13px;
  line-height: 1.55;
}
.legal-toc-title {
  font-size: 10.5px;
  font-weight: 700;
  color: #534AB7;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #E2E8F0;
}
.legal-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: legal-toc;
}
.legal-toc li {
  margin-bottom: 7px;
  padding-left: 28px;
  position: relative;
  counter-increment: legal-toc;
}
.legal-toc li::before {
  content: counter(legal-toc);
  position: absolute;
  left: 0; top: 1px;
  width: 20px; height: 20px;
  background: #F4F3F7;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  color: #534AB7;
  display: flex;
  align-items: center;
  justify-content: center;
}
.legal-toc a {
  color: #475569;
  text-decoration: none;
  transition: color 0.15s;
}
.legal-toc a:hover { color: #534AB7; }

/* Mobile TOC (collapsible) */
.legal-toc-mobile {
  display: none;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 24px;
}
.legal-toc-mobile summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #534AB7;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.legal-toc-mobile summary::-webkit-details-marker { display: none; }
.legal-toc-mobile summary::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 11px;
  transition: transform 0.25s;
}
.legal-toc-mobile[open] summary::after { transform: rotate(180deg); }
.legal-toc-mobile ol {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.legal-toc-mobile li { margin-bottom: 6px; font-size: 13px; }
.legal-toc-mobile a { color: #475569; text-decoration: none; }
.legal-toc-mobile a:hover { color: #534AB7; }

/* ── TL;DR box ─────────────────────────────────────────────────── */
.legal-tldr {
  background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
  border: 1px solid #FED7AA;
  border-left: 4px solid #F57C00;
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 28px;
}
.legal-tldr-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  color: #B45309;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.legal-tldr-label i { font-size: 11px; }
.legal-tldr h2 {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 700;
  color: #0a1d3d;
  margin: 0 0 12px;
  line-height: 1.3;
}
.legal-tldr ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.legal-tldr li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14.5px;
  line-height: 1.55;
  color: #475569;
}
.legal-tldr li i {
  color: #F57C00;
  font-size: 12px;
  margin-top: 5px;
  flex-shrink: 0;
}
.legal-tldr li strong { color: #0a1d3d; }

/* ── Section cards ─────────────────────────────────────────────── */
.legal-section {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 14px;
  scroll-margin-top: 90px;
}
.legal-section h2 {
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 700;
  color: #0a1d3d;
  line-height: 1.25;
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #F4F3F7;
  display: flex;
  align-items: center;
  gap: 14px;
}
.legal-section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #534AB7, #311B92);
  color: #fff;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(83, 74, 183, 0.25);
}
.legal-section h3 {
  font-family: var(--font-heading);
  font-size: 15.5px;
  font-weight: 700;
  color: #0a1d3d;
  margin: 22px 0 10px;
}
.legal-section p {
  font-size: 14.5px;
  line-height: 1.7;
  color: #475569;
  margin: 0 0 12px;
}
.legal-section p:last-child { margin-bottom: 0; }
.legal-section strong { color: #0a1d3d; font-weight: 700; }
.legal-section ul,
.legal-section ol {
  margin: 0 0 14px;
  padding-left: 22px;
  font-size: 14.5px;
  line-height: 1.7;
  color: #475569;
}
.legal-section li { margin-bottom: 6px; }
.legal-section li strong { color: #0a1d3d; }
.legal-section a {
  color: #534AB7;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-section a:hover { color: #311B92; }

/* ── Callout boxes inside sections ─────────────────────────────── */
.legal-callout {
  margin: 16px 0;
  padding: 14px 18px;
  background: #F8FAFC;
  border-left: 3px solid #534AB7;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.6;
  color: #475569;
}
.legal-callout-strong {
  background: linear-gradient(135deg, rgba(83, 74, 183, 0.06), rgba(245, 124, 0, 0.06));
  border-left-color: #F57C00;
}
.legal-callout strong { color: #0a1d3d; }

/* Pull quote (referenced statements from elsewhere on the site) */
.legal-pullquote {
  margin: 18px 0;
  padding: 16px 22px;
  border-left: 3px solid #FCD34D;
  background: #FFFBEB;
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.6;
  color: #0a1d3d;
  border-radius: 4px;
}
.legal-pullquote-source {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 11.5px;
  font-weight: 600;
  color: #5F5E5A;
  letter-spacing: 0.04em;
}

/* ── Tables ────────────────────────────────────────────────────── */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 18px;
  font-size: 13.5px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
}
.legal-table thead {
  background: #F4F3F7;
}
.legal-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: #311B92;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid #E2E8F0;
}
.legal-table td {
  padding: 12px 14px;
  border-top: 1px solid #F4F3F7;
  color: #475569;
  vertical-align: top;
  line-height: 1.55;
}
.legal-table tr:first-child td { border-top: 0; }
.legal-table td:first-child { font-weight: 600; color: #0a1d3d; }

/* ── Contact card ──────────────────────────────────────────────── */
.legal-contact-card {
  background: linear-gradient(135deg, #0a1d3d 0%, #311B92 100%);
  border-radius: 16px;
  padding: 26px 30px;
  color: #fff;
  margin-top: 24px;
}
.legal-contact-card h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #fff;
}
.legal-contact-card p {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,0.85);
  margin: 0 0 14px;
}
.legal-contact-card a {
  color: #FCD34D;
  text-decoration: none;
  font-weight: 600;
}
.legal-contact-card a:hover { text-decoration: underline; }
.legal-contact-meta {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.14);
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}
.legal-contact-meta strong { color: #fff; font-weight: 600; }

/* ── Cross-policy footer ───────────────────────────────────────── */
.legal-related {
  background: #F4F3F7;
  border-top: 1px solid #E2E8F0;
  padding: 36px 24px;
  text-align: center;
}
.legal-related-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #5F5E5A;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.legal-related-pills {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.legal-related-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.legal-related-pill i { font-size: 11px; color: #534AB7; }
.legal-related-pill:hover {
  background: #534AB7;
  color: #fff;
  border-color: #534AB7;
  transform: translateY(-2px);
}
.legal-related-pill:hover i { color: #FCD34D; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .legal-hero { padding: 72px 20px 44px; }
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 32px 18px 48px;
  }
  .legal-toc { display: none; }
  .legal-toc-mobile { display: block; }
  .legal-section { padding: 22px 24px; }
}
