/* ==========================================================================
   EQUITY INTELLIGENCE — INSTITUTIONAL LEGAL & COMPLIANCE STYLESHEET
   Aesthetic: Swiss Obsidian Minimalist Ledger (UI_DESIGN_SYSTEM.md)
   ========================================================================== */

:root {
  --bg-canvas: #0D0F14;
  --bg-surface: #13161F;
  --bg-surface-elevated: #181C26;
  --border-hairline: rgba(255, 255, 255, 0.045);
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-medium: rgba(255, 255, 255, 0.16);

  --text-primary: #FFFFFF;
  --text-secondary: #E4E4E7;
  --text-muted: #8E8E93;
  --text-tertiary: #52525B;

  --accent-emerald: #10B981;
  --accent-emerald-dim: rgba(16, 185, 129, 0.12);
  --accent-blue: #3B82F6;
  --accent-blue-dim: rgba(59, 130, 246, 0.12);

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

body.legal-body {
  background-color: var(--bg-canvas);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.68;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Ambient Top Glow --- */
.legal-ambient-glow {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 380px;
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(255, 255, 255, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* --- Header --- */
.legal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 15, 20, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-hairline);
  padding: 18px 0;
}

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

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-wrap svg {
  color: #ffffff;
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}

.btn-header-cta {
  background: #ffffff;
  color: #0D0F14;
  padding: 7px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-header-cta:hover {
  background: #E4E4E7;
  transform: translateY(-1px);
}

/* --- Main Layout --- */
.legal-main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 32px 80px 32px;
  position: relative;
  z-index: 1;
}

/* Hero Header Block */
.legal-hero-block {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-hairline);
}

.legal-badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.legal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.legal-badge.badge-green {
  background: var(--accent-emerald-dim);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--accent-emerald);
}

.legal-title {
  font-family: var(--font-family);
  font-size: clamp(34px, 4.2vw, 46px);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 14px;
}

.legal-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 740px;
  line-height: 1.6;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  -ms-hyphens: auto;
  text-wrap: pretty;
}

/* Content Grid with Sticky Sidebar */
.legal-content-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 64px;
  align-items: start;
}

/* Sticky TOC Sidebar */
.legal-toc-sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 16px;
  border-right: 1px solid var(--border-hairline);
}

.toc-heading {
  font-family: var(--font-family);
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.toc-link {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.45;
}

.toc-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.toc-link.active {
  color: var(--text-primary);
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
}

.toc-link .toc-num {
  font-family: var(--font-family);
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text-tertiary);
  margin-right: 8px;
}

/* Legal Body Article */
.legal-article {
  max-width: 800px;
}

.legal-section {
  margin-bottom: 48px;
  scroll-margin-top: 110px;
}

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

.section-header-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-hairline);
}

.section-num {
  font-family: var(--font-family);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.section-heading {
  font-family: var(--font-family);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.legal-p {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.76;
  margin-bottom: 16px;
  text-align: justify;
  text-justify: inter-word;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  -ms-hyphens: auto;
  text-wrap: pretty;
  word-break: normal;
  overflow-wrap: break-word;
}

.legal-lead-intro,
p.legal-lead-intro {
  text-align: left !important;
  text-align-last: left !important;
}

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

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

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

.legal-list li {
  position: relative;
  padding-left: 22px;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.68;
  text-align: justify;
  text-justify: inter-word;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  -ms-hyphens: auto;
  text-wrap: pretty;
}

.legal-list li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
}

.legal-callout-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 20px 0;
}

.callout-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.callout-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.65;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  -ms-hyphens: auto;
  text-wrap: pretty;
}

.legal-table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--border-hairline);
  border-radius: 10px;
  background: var(--bg-surface);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.legal-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-family: var(--font-family);
  font-weight: 600;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-hairline);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.legal-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-hairline);
  color: var(--text-secondary);
}

.legal-table tr:last-child td {
  border-bottom: none;
}

/* --- Institutional Footer --- */
.legal-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-hairline);
  padding: 36px 0;
}

.legal-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--text-primary);
}

.footer-disclaimer-p {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.65;
  max-width: 900px;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  -ms-hyphens: auto;
  text-wrap: pretty;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .legal-content-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .legal-toc-sidebar {
    display: none;
  }

  .legal-header-inner,
  .legal-main,
  .legal-footer-inner {
    padding-left: 20px;
    padding-right: 20px;
  }

  .header-nav {
    gap: 16px;
  }
}
