/* ===================================================
   VeloxOffer Modern Legal & Documentation Engine
   Tailored for Modern Light Theme
   =================================================== */

.modern-legal-hero {
  padding: 40px 0 28px;
  text-align: center;
  position: relative;
}

.legal-hero-title {
  font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  margin-bottom: 12px;
}

.legal-hero-desc {
  font-size: 1.05rem;
  color: #475569;
  line-height: 1.65;
  max-width: 760px;
  margin: 0 auto 16px;
}

.legal-meta-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.legal-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #4338ca;
}

/* 2-Column Grid */
.modern-legal-layout {
  padding-bottom: 90px;
}

.modern-legal-grid {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 36px;
  align-items: start;
}

/* Sticky TOC Sidebar */
.modern-toc-sidebar {
  position: sticky;
  top: 96px;
}

.modern-toc-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  padding: 22px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.modern-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.modern-toc-title {
  font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modern-toc-title i {
  color: #6366f1;
}

.modern-toc-count {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.04em;
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 6px;
}

.modern-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.modern-toc-list a {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  color: #64748b;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.modern-toc-list a:hover {
  background: #f5f3ff;
  color: #6366f1;
}

.modern-toc-list a.active {
  background: #eef2ff;
  color: #4338ca;
  font-weight: 600;
  border-left: 3px solid #6366f1;
}

.modern-toc-list .toc-num {
  font-size: 0.74rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #64748b;
  padding: 2px 6px;
  border-radius: 6px;
  margin-right: 8px;
  flex-shrink: 0;
}

.modern-toc-list a.active .toc-num {
  background: #c7d2fe;
  color: #4338ca;
}

/* Sidebar Help Box */
.modern-toc-help {
  margin-top: 18px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  text-align: center;
}

.modern-toc-help p {
  font-size: 0.84rem;
  color: #64748b;
  margin: 0 0 10px;
  line-height: 1.45;
}

.modern-toc-help a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #6366f1;
  text-decoration: none;
}

.modern-toc-help a:hover {
  color: #4338ca;
  text-decoration: underline;
}

/* Main Content Card */
.modern-legal-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 24px;
  padding: 48px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.03);
  color: #334155;
  font-size: 0.98rem;
  line-height: 1.75;
}

.modern-callout-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #6366f1;
  border-radius: 14px;
  padding: 22px 26px;
  margin-bottom: 32px;
}

.modern-callout-box p {
  margin-bottom: 10px;
}

.modern-callout-box p:last-child {
  margin-bottom: 0;
}

.modern-legal-card section,
.modern-legal-card .policy-section {
  scroll-margin-top: 110px;
}

.modern-legal-card h2,
.modern-legal-card .section-header h2 {
  font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
  font-size: 1.55rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 44px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 12px;
}

.modern-legal-card h2:first-of-type,
.modern-legal-card .policy-section:first-of-type h2 {
  margin-top: 10px;
}

.modern-legal-card h3 {
  font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
  font-size: 1.18rem;
  font-weight: 700;
  color: #0f172a;
  margin: 26px 0 12px;
}

.modern-legal-card h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e293b;
  margin: 18px 0 10px;
}

.modern-legal-card p {
  color: #475569;
  margin-bottom: 16px;
}

.modern-legal-card strong {
  color: #0f172a;
  font-weight: 600;
}

.modern-legal-card a {
  color: #6366f1;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color 0.2s;
}

.modern-legal-card a:hover {
  color: #4338ca;
}

.modern-legal-card ul,
.modern-legal-card ol {
  padding-left: 22px;
  margin-bottom: 20px;
  color: #475569;
}

.modern-legal-card li {
  margin-bottom: 8px;
  line-height: 1.65;
}

/* Callout Highlights within text */
.modern-legal-card .highlight-box,
.modern-legal-card .policy-intro {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #6366f1;
  border-radius: 14px;
  padding: 20px 24px;
  margin: 24px 0;
}

.modern-legal-card .highlight-box strong,
.modern-legal-card .policy-intro strong {
  color: #0f172a;
}

/* Tables */
.modern-legal-card table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  margin: 24px 0 28px;
  background: #ffffff;
}

.modern-legal-card th {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 18px;
  border-bottom: 1.5px solid #e2e8f0;
  text-align: left;
}

.modern-legal-card td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  font-size: 0.92rem;
  line-height: 1.6;
}

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

.modern-legal-card tr:hover td {
  background: #fbfbfe;
}

/* Mobile Quick Navigation Bar */
.modern-mobile-toc-bar {
  display: none;
  margin-bottom: 24px;
}

.modern-mobile-toc-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  color: #0f172a;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.modern-mobile-toc-dropdown {
  display: none;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  margin-top: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.modern-mobile-toc-dropdown.show {
  display: block;
}

@media (max-width: 991px) {
  .modern-legal-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .modern-toc-sidebar {
    display: none;
  }
  .modern-mobile-toc-bar {
    display: block;
  }
  .modern-legal-card {
    padding: 32px 22px;
    border-radius: 20px;
  }
  .legal-hero-title {
    font-size: 2.2rem;
  }
}

/* Responsive Table Wrappers for Legal Docs */
.table-responsive-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 20px 0 24px;
}

.table-scroll-hint {
  display: none;
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .table-scroll-hint {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .modern-legal-card table {
    min-width: 540px;
  }
}

@media (max-width: 576px) {
  .modern-legal-hero {
    padding: 28px 0 20px;
  }
  .legal-hero-title {
    font-size: 1.85rem;
  }
  .legal-hero-desc {
    font-size: 0.95rem;
  }
  .modern-legal-card {
    padding: 24px 16px;
    border-radius: 16px;
  }
  .legal-section-title {
    font-size: 1.25rem;
  }
  .breadcrumb-pill {
    font-size: 0.78rem;
    padding: 5px 12px;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    justify-content: center;
  }
}
