/* legal.css — shared styles for terms.html / privacy.html / refund.html
 *
 * Layout:
 *   [hero ribbon, 1240px wide, centered]
 *   [ TOC sidebar 240px | content 960px ]  ← 1240px grid on wide screens
 *
 * Mobile (<1100px): TOC hides, content takes full width.
 */

html, body { background: var(--bg); color: var(--text); }
body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  padding: 32px 20px 60px;
  -webkit-font-smoothing: antialiased;
}

/* ───────────────── Hero ribbon (shared by all 3 legal pages) ───────────────── */
.legal-hero {
  max-width: 1240px;
  margin: 0 auto 28px;
  padding: 36px 36px 30px;
  background:
    radial-gradient(620px 240px at 90% -10%, rgba(99, 102, 241, 0.45), transparent 60%),
    radial-gradient(520px 240px at -10% 110%, rgba(34, 211, 238, 0.32), transparent 60%),
    linear-gradient(150deg, #0a1024 0%, #1b1450 50%, #312e81 100%);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(8, 15, 40, 0.35);
  color: #e6eeff;
  position: relative;
  overflow: hidden;
}
.legal-hero .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  opacity: 0.92;
}
.legal-hero .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.legal-hero .brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.legal-hero .brand-name { font-weight: 800; letter-spacing: -0.02em; font-size: 0.95rem; color: #fff; }
.legal-hero .brand-name .fno { color: #5b9aff; }
.legal-hero h1 {
  font-size: 2rem;
  margin: 0 0 6px;
  letter-spacing: -0.5px;
  font-weight: 800;
  color: #ffffff;
}
.legal-hero .updated {
  color: rgba(232, 239, 255, 0.7);
  font-size: 0.85rem;
}
.legal-hero .updated strong { color: #67e8f9; font-weight: 600; }
.legal-hero .back {
  position: absolute;
  top: 22px;
  right: 26px;
  color: rgba(232, 239, 255, 0.85);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.legal-hero .back:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* ───────────────── 2-column layout: TOC | content ───────────────── */
.legal-wrap {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
}

/* ───────────────── Sticky TOC sidebar ───────────────── */
.legal-toc {
  position: sticky;
  top: 32px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  font-size: 0.9rem;
}
.legal-toc .toc-title {
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--muted);
  margin-bottom: 12px;
}
.legal-toc ul {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
}
.legal-toc li {
  margin: 0;
}
.legal-toc a {
  display: block;
  padding: 7px 10px 7px 14px;
  color: var(--text);
  opacity: 0.78;
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.4;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.legal-toc a:hover {
  opacity: 1;
  background: rgba(122, 169, 240, 0.06);
}
/* Currently-visible section gets the accent treatment. */
.legal-toc a.active {
  opacity: 1;
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(122, 169, 240, 0.10);
  font-weight: 600;
}

/* Cross-doc links at the bottom of the TOC */
.legal-toc .toc-cross {
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.legal-toc .toc-cross a {
  padding: 6px 10px 6px 14px;
  font-size: 0.82rem;
  color: var(--muted);
  border-left: 2px solid transparent;
}
.legal-toc .toc-cross a:hover {
  color: var(--accent);
  opacity: 1;
  background: rgba(122, 169, 240, 0.06);
}

/* ───────────────── Content sections ───────────────── */
.legal-doc { min-width: 0; /* prevents grid blowout on long URLs */ }
.legal-doc section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  scroll-margin-top: 24px; /* nice offset when jumping to a section via TOC */
}
.legal-doc h2 {
  font-size: 1.15rem;
  margin: 0 0 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.2px;
  display: inline-block;
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(122, 169, 240, 0.25);
}
.legal-doc h3 {
  font-size: 0.98rem;
  margin: 18px 0 8px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.1px;
}
.legal-doc p,
.legal-doc li {
  font-size: 0.94rem;
  line-height: 1.7;
  color: var(--text);
  opacity: 0.92;
}
.legal-doc p { margin: 0 0 12px; }
.legal-doc p:last-child { margin-bottom: 0; }
.legal-doc ul { padding-left: 22px; margin: 4px 0 12px; }
.legal-doc li { margin-bottom: 6px; }
.legal-doc a { color: var(--accent); text-decoration: none; font-weight: 500; }
.legal-doc a:hover { text-decoration: underline; }
.legal-doc strong { color: var(--text); opacity: 1; }

.intro-pill {
  display: inline-block;
  background: rgba(34, 211, 238, 0.12);
  color: #67e8f9;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 12px;
  border: 1px solid rgba(34, 211, 238, 0.25);
}

/* ───────────────── Responsive ───────────────── */
@media (max-width: 1100px) {
  /* On narrower screens, drop the sticky TOC and let the content take the full row. */
  .legal-wrap {
    grid-template-columns: 1fr;
  }
  .legal-toc {
    display: none;
  }
}
@media (max-width: 640px) {
  body { padding: 18px 12px 40px; }
  .legal-hero {
    padding: 24px 22px 22px;
    border-radius: 10px;
  }
  .legal-hero h1 { font-size: 1.5rem; }
  .legal-hero .back {
    position: static;
    display: inline-block;
    margin-bottom: 12px;
  }
  .legal-doc section {
    padding: 18px 18px;
    border-radius: 10px;
  }
}
