/* Legal pages (terms, privacy) in the current site look.
   Loaded after homepage-new.css, which supplies the tokens (--bam-*), the top nav
   (.hero-nav*), .bam-eyebrow and the footer shell (.site-footer / .footer-bottom). */

.legal-page {
  --legal-container: 1240px; /* narrower than the homepage's 1440px: easier line length for long text */
  background: var(--bam-bg);
}

/* The home nav floats over a hero photo; here it sits on a white page, so it is
   a solid bar that stays at the top of the viewport. */
.legal-page .hero-nav {
  position: sticky;
  top: 0;
  background: rgba(77, 118, 236, 0.96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* ---- Title block (same rhythm as the pricing header on the homepage) ---- */
.legal-hero {
  max-width: var(--legal-container);
  margin: 0 auto;
  padding: clamp(48px, 6vw, 88px) clamp(24px, 7vw, 100px) clamp(28px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.legal-hero h1 {
  margin: 0;
  font-size: clamp(34px, 3.6vw, 48px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--bam-ink);
}

.legal-lede {
  margin: 0;
  max-width: 769px;
  font-size: 20px;
  line-height: 1.6;
  color: var(--bam-ink);
}

.legal-meta {
  margin: 4px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 24px;
  font-size: 15px;
  color: #5b6b86;
}

/* ---- Sidebar + document ---- */
.legal-layout {
  max-width: var(--legal-container);
  margin: 0 auto;
  padding: 0 clamp(24px, 7vw, 100px) clamp(64px, 8vw, 110px);
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: clamp(32px, 4vw, 64px);
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 128px);
  overflow-y: auto;
  padding-right: 8px;
}

.legal-toc-title {
  margin: 0 0 14px;
  font-family: Magra, serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--bam-blue);
}

.legal-toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid #e3e8f2; }

.legal-toc a {
  display: block;
  margin-left: -2px;
  padding: 7px 14px;
  border-left: 2px solid transparent;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
  color: #4a5b78;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.legal-toc a:hover { color: var(--bam-ink); background: rgba(77, 118, 236, 0.06); }
.legal-toc a.active {
  color: var(--bam-ink);
  font-weight: 600;
  border-left-color: var(--bam-lime);
  background: rgba(198, 249, 31, 0.14);
}

.legal-doc {
  background: #fff;
  border: 1px solid #e3e8f2;
  border-radius: 20px;
  padding: clamp(24px, 4vw, 56px);
  box-shadow: 0 10px 40px rgba(23, 44, 74, 0.05);
  color: var(--bam-ink);
  min-width: 0;
}

.legal-section { scroll-margin-top: 96px; }
.legal-section + .legal-section { margin-top: 44px; }

.legal-section h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-size: clamp(22px, 2vw, 26px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--bam-ink);
}

.legal-num {
  flex: 0 0 auto;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: #eef1fd;
  color: var(--bam-blue);
  font-family: Magra, serif;
  font-size: 15px;
  font-weight: 700;
}

.legal-section h3 {
  margin: 26px 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--bam-ink);
}

.legal-section p,
.legal-section li {
  font-size: 16px;
  line-height: 1.75;
  color: #2c3e5a;
}
.legal-section p { margin: 0 0 14px; }
.legal-section p.caps { font-size: 14px; line-height: 1.7; font-weight: 500; color: #4a5b78; }
.legal-section strong { color: var(--bam-ink); font-weight: 700; }
.legal-section a { color: var(--bam-blue); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.legal-section a:hover { color: var(--bam-ink); }

.legal-section ul { list-style: none; margin: 0 0 16px; padding: 0; }
.legal-section li { position: relative; padding-left: 22px; margin: 6px 0; }
.legal-section li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.78em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bam-blue);
}

.legal-box {
  margin: 18px 0 4px;
  padding: 16px 20px;
  border-radius: 14px;
  background: #f7fce3;
  border: 1.5px solid var(--bam-lime);
}
.legal-box p { margin: 0; font-size: 15px; }

.legal-contact {
  margin-top: 16px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 22px 24px;
  border-radius: 16px;
  background: var(--bam-bg);
  border: 1px solid #e3e8f2;
}
.legal-contact-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--bam-blue);
  color: #fff;
}
.legal-contact-icon svg { width: 20px; height: 20px; }
.legal-contact .contact-label { margin: 0 0 2px; font-size: 13px; color: #5b6b86; }
.legal-contact .contact-value { font-size: 17px; font-weight: 700; }
.legal-contact .contact-note { margin: 14px 0 0; font-size: 15px; line-height: 1.7; color: #2c3e5a; }

.legal-divider { height: 1px; background: #e3e8f2; margin: 44px 0 24px; }

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--bam-blue);
}
.legal-back svg { width: 18px; height: 18px; transition: transform 0.2s; }
.legal-back:hover svg { transform: translateX(-3px); }

/* ---- Footer: just the copyright bar ---- */
.legal-page .footer-stack { padding-top: 0; gap: 0; }
.legal-page .footer-bottom { border-top: 0; }

/* ---- Small screens: the sidebar becomes a plain list above the document ---- */
@media (max-width: 900px) {
  .legal-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .legal-toc { position: static; max-height: none; overflow: visible; padding: 0 0 8px; }
  .legal-toc ul { columns: 2; column-gap: 24px; border-left: 0; }
  .legal-toc a { margin-left: 0; border-left: 0; padding: 6px 0; }
  .legal-toc a.active { background: none; }
  .legal-hero h1 { font-size: 32px; }
}
@media (max-width: 560px) {
  .legal-toc ul { columns: 1; }
  .legal-contact { flex-direction: column; }
}

/* ---- Tables and two-up contact cards (privacy) ---- */
.legal-section .table-wrap {
  overflow-x: auto;
  margin: 16px 0 20px;
  border: 1px solid #e3e8f2;
  border-radius: 14px;
}
.legal-section table { width: 100%; border-collapse: collapse; font-size: 15px; }
.legal-section th {
  text-align: left;
  padding: 12px 18px;
  background: var(--bam-bg);
  border-bottom: 1px solid #e3e8f2;
  font-family: Magra, serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--bam-blue);
  white-space: nowrap;
}
.legal-section td {
  padding: 12px 18px;
  border-bottom: 1px solid #eef1f7;
  vertical-align: top;
  line-height: 1.6;
  color: #2c3e5a;
}
.legal-section tr:last-child td { border-bottom: 0; }

.legal-contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.legal-contact-grid .legal-contact { margin-top: 0; }
.legal-contact .contact-value-block { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.6; color: var(--bam-ink); }
@media (max-width: 760px) { .legal-contact-grid { grid-template-columns: 1fr; } }
