/* ==========================================================================
   SAHALPLUS — LEGAL DOCUMENT STYLES (PRIVACY / TERMS / PROVIDERS POLICY)
   Prioritizes: High Readability + Clarity + Professional Two-Column TOC Layout
   ========================================================================== */

/* 1. COMPACT LEGAL HERO WITH SUBTLE BRAND COLOR TREATMENT */
.legal-hero {
  position: relative;
  padding: 36px 0 26px;
  background: linear-gradient(180deg, rgba(112, 255, 11, 0.05) 0%, var(--bg-surface-alt) 100%);
  border-bottom: 1px solid var(--border-light);
  overflow: hidden;
  transition: background var(--transition-normal);
}

[data-theme="dark"] .legal-hero {
  background: linear-gradient(180deg, rgba(112, 255, 11, 0.08) 0%, var(--bg-surface-soft) 100%);
}

.legal-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.legal-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 12px;
  background: var(--brand-green-subtle);
  border: 1px solid rgba(112, 255, 11, 0.35);
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 800;
  color: #0E6B00;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

[data-theme="dark"] .legal-hero-eyebrow {
  color: var(--brand-green);
  background: rgba(112, 255, 11, 0.12);
}

.legal-hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.2vw, 1.95rem);
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.025em;
  margin-bottom: 6px;
}

.legal-hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.legal-meta-dot {
  color: var(--brand-green);
}

/* 2. TWO-COLUMN LEGAL LAYOUT */
.legal-page-container {
  padding: 36px 0 60px;
}

.legal-layout-grid {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 32px;
  align-items: start;
}

/* 3. STICKY TABLE OF CONTENTS (LEFT COLUMN) */
.legal-toc-wrapper {
  position: sticky;
  top: 80px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.legal-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.legal-toc-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.legal-toc-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.legal-toc-link {
  display: block;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
  text-decoration: none;
  border-left: 2px solid transparent;
  line-height: 1.35;
}

[dir="rtl"] .legal-toc-link {
  border-left: none;
  border-right: 2px solid transparent;
}

.legal-toc-link:hover {
  color: var(--text-heading);
  background: var(--bg-surface-alt);
  border-color: rgba(112, 255, 11, 0.5);
}

.legal-toc-link.active {
  color: #0E6B00;
  font-weight: 700;
  background: var(--brand-green-subtle);
  border-color: var(--brand-green);
}

[data-theme="dark"] .legal-toc-link.active {
  color: var(--brand-green);
  background: rgba(112, 255, 11, 0.12);
}

/* 4. MAIN LEGAL CONTENT (RIGHT COLUMN) */
.legal-content-body {
  max-width: 820px;
}

.legal-section {
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-light);
  scroll-margin-top: 80px;
}

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

.legal-section-heading {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.015em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.legal-section-heading span.section-num {
  font-size: 0.88rem;
  color: #0E6B00;
  background: var(--brand-green-subtle);
  padding: 2.5px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(112, 255, 11, 0.3);
  font-weight: 800;
}

[data-theme="dark"] .legal-section-heading span.section-num {
  color: var(--brand-green);
}

.legal-subheading {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 18px 0 8px;
}

.legal-paragraph {
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.65;
  margin-bottom: 12px;
}

.legal-list {
  margin: 10px 0 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

[dir="rtl"] .legal-list {
  margin: 10px 20px 14px 0;
}

.legal-list li {
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.55;
  position: relative;
  list-style-type: disc;
}

/* 5. POLICY HIGHLIGHT CALLOUTS */
.policy-callout {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin: 16px 0;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.86rem;
  line-height: 1.55;
}

.policy-callout.verified-distinction {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.policy-callout.sponsored-distinction {
  background: rgba(255, 212, 0, 0.08);
  border-color: rgba(255, 212, 0, 0.3);
}

.policy-callout.important-warning {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.3);
}

.policy-callout-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.policy-callout.verified-distinction .policy-callout-icon {
  color: #10B981;
}

.policy-callout.sponsored-distinction .policy-callout-icon {
  color: #D97706;
}

[data-theme="dark"] .policy-callout.sponsored-distinction .policy-callout-icon {
  color: var(--brand-yellow);
}

/* 6. COMMISSION SPLIT VISUAL BOX (PROVIDERS POLICY) */
.commission-split-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px;
  margin: 18px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.split-pill {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  padding: 12px;
  text-align: center;
}

.split-pill.provider {
  border-color: rgba(112, 255, 11, 0.5);
  background: rgba(112, 255, 11, 0.06);
}

.split-pill.platform {
  border-color: rgba(255, 212, 0, 0.5);
  background: rgba(255, 212, 0, 0.06);
}

.split-percent {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.split-pill.provider .split-percent {
  color: #0E6B00;
}

[data-theme="dark"] .split-pill.provider .split-percent {
  color: var(--brand-green);
}

.split-pill.platform .split-percent {
  color: #B45309;
}

[data-theme="dark"] .split-pill.platform .split-percent {
  color: var(--brand-yellow);
}

.split-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-heading);
}

/* 7. MOBILE TOC TOGGLE BAR */
.legal-mobile-toc-bar {
  display: none;
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text-heading);
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
  .legal-layout-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .legal-mobile-toc-bar {
    display: flex;
  }

  .legal-toc-wrapper {
    position: static;
    max-height: 0;
    overflow: hidden;
    padding: 0 14px;
    border: none;
    box-shadow: none;
    transition: max-height 0.35s ease, padding 0.3s ease;
  }

  .legal-toc-wrapper.open {
    max-height: 440px;
    padding: 14px;
    border: 1px solid var(--border-light);
    margin-bottom: 20px;
    overflow-y: auto;
  }
}

@media (max-width: 640px) {
  .legal-hero-title {
    font-size: 1.5rem;
  }

  .legal-section-heading {
    font-size: 1.18rem;
  }

  .commission-split-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
