/* ═══════════════════════════════════════════════════════════════════════
   TERMS & CONDITIONS PAGE (/terms) — dark legal hero · left "On This Page"
   table of contents · numbered legal document with Show More. Desktop-first;
   every string, image and section is admin-driven from Admin › Terms page.
   ═══════════════════════════════════════════════════════════════════════ */
.tp-page,
:root {
  --tp-blue: #086BFF;
  --tp-blue-bright: #0878FF;
  --tp-blue-deep: #005CEB;
  --tp-bg: #F7FAFD;
  --tp-card: #FFFFFF;
  --tp-ink: #101114;
  --tp-muted: #68738A;
  --tp-line: #E1EBF8;
  --tp-tile: #EAF3FF;
  --tp-dark: #02080F;
  --tp-divider: #EDF1F6;
}

.tp-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 34px;
}

/* ── Hero ────────────────────────────────────────────────────────────── */
.tp-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 352px;
  background: var(--tp-dark);
}
.tp-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.tp-hero-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(2, 8, 15, .95) 0%, rgba(2, 8, 15, .86) 32%,
    rgba(2, 8, 15, .42) 56%, rgba(2, 8, 15, .08) 78%, rgba(2, 8, 15, 0) 100%);
}
.tp-hero--plain {
  background: radial-gradient(120% 150% at 86% 0%, rgba(8, 107, 255, .38), transparent 55%),
              linear-gradient(120deg, #02080F 0%, #08213F 58%, #0B2E5C 100%);
}
.tp-hero-inner {
  position: relative;
  z-index: 2;
  padding-top: 54px;
  padding-bottom: 54px;
  max-width: 640px;
}
.tp-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--tp-blue-bright);
  margin: 0 0 12px;
}
.tp-hero-title {
  display: flex;
  flex-direction: column;
  font-size: clamp(34px, 4.4vw, 52px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.02em;
  color: #fff;
  margin: 0 0 16px;
}
.tp-hero-title .tp-accent { color: var(--tp-blue-bright); }
.tp-hero-sub {
  color: rgba(255, 255, 255, .84);
  font-size: 15px;
  line-height: 1.6;
  max-width: 470px;
  margin: 0 0 20px;
}
.tp-crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, .72);
}
.tp-crumbs a { color: rgba(255, 255, 255, .9); text-decoration: none; }
.tp-crumbs a:hover { color: #fff; text-decoration: underline; }
.tp-crumbs i { font-size: 10px; opacity: .65; }
.tp-crumbs span[aria-current] { color: rgba(255, 255, 255, .98); font-weight: 600; }

/* ── Body / two-column layout ────────────────────────────────────────── */
.tp-body { background: var(--tp-bg); padding: 40px 0 72px; }
.tp-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.tp-toc { position: sticky; top: 96px; }
.tp-toc-card {
  background: var(--tp-card);
  border: 1px solid var(--tp-line);
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(16, 17, 20, .04);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.tp-toc-head {
  font-size: 16px;
  font-weight: 700;
  color: var(--tp-ink);
  margin: 2px 4px 12px;
}
.tp-toc-list { display: flex; flex-direction: column; }
.tp-toc-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  color: #33373F;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--tp-divider);
  transition: background .14s ease, color .14s ease;
}
.tp-toc-link:last-child { border-bottom: none; }
.tp-toc-link:hover { background: var(--tp-tile); color: var(--tp-blue); }
.tp-toc-num {
  flex: none;
  width: 18px;
  text-align: right;
  color: var(--tp-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.tp-toc-label { flex: 1; min-width: 0; }
.tp-toc-link.is-active {
  background: var(--tp-blue-bright);
  color: #fff;
  border-bottom-color: transparent;
}
.tp-toc-link.is-active .tp-toc-num { color: rgba(255, 255, 255, .82); }

/* ── Document ────────────────────────────────────────────────────────── */
.tp-doc { min-width: 0; }
.tp-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.tp-updated {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tp-muted);
}
.tp-print {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 35px;
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid var(--tp-line);
  background: #fff;
  color: var(--tp-ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.tp-print:hover { border-color: #C4DCFB; color: var(--tp-blue); background: #Fbfdff; }
.tp-print i { font-size: 14px; }

.tp-doc-title {
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 800;
  letter-spacing: -.015em;
  color: var(--tp-ink);
  margin: 0 0 14px;
}
.tp-doc-intro {
  font-size: 13px;
  line-height: 1.6;
  color: var(--tp-muted);
  margin: 0 0 22px;
  max-width: 780px;
}

/* ── Numbered legal cards ────────────────────────────────────────────── */
.tp-cards { display: flex; flex-direction: column; gap: 12px; }
.tp-card {
  display: flex;
  gap: 14px;
  background: var(--tp-card);
  border: 1px solid var(--tp-line);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(16, 17, 20, .04);
  scroll-margin-top: 104px;
}
.tp-card-num {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--tp-blue-bright), var(--tp-blue-deep));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}
.tp-card-body { min-width: 0; }
.tp-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--tp-ink);
  margin: 0 0 6px;
}
.tp-card-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--tp-muted);
  margin: 0;
}

/* ── Show More ───────────────────────────────────────────────────────── */
.tp-more-wrap { display: flex; justify-content: center; margin-top: 18px; }
.tp-more {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 7px 18px;
  border-radius: 8px;
  border: 1px solid var(--tp-blue);
  background: #fff;
  color: var(--tp-blue);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.tp-more:hover { background: var(--tp-tile); }
.tp-more i { font-size: 13px; }
.tp-more-chev { transition: transform .2s ease; }
.tp-more[aria-expanded="true"] .tp-more-chev { transform: rotate(180deg); }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .tp-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 22px; }
}

@media (max-width: 860px) {
  .tp-wrap { padding: 0 20px; }
  .tp-hero { min-height: 320px; }
  .tp-hero-img { object-position: 64% 28%; }
  .tp-body { padding: 26px 0 56px; }

  /* Sidebar becomes a compact, horizontally scrollable table-of-contents row. */
  .tp-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .tp-toc { position: static; top: auto; }
  .tp-toc-card { padding: 10px; max-height: none; overflow: visible; }
  .tp-toc-head { margin: 0 0 8px; font-size: 14px; }
  .tp-toc-list {
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }
  .tp-toc-link {
    flex: none;
    border-bottom: none;
    border: 1px solid var(--tp-line);
    border-radius: 999px;
    padding: 7px 13px;
    white-space: nowrap;
  }
  .tp-toc-link.is-active { border-color: var(--tp-blue); }
}

@media (max-width: 560px) {
  .tp-hero-inner { padding-top: 40px; padding-bottom: 40px; }
  .tp-hero-sub { font-size: 14px; }
  .tp-meta { flex-direction: column; align-items: flex-start; gap: 10px; }
  .tp-print { width: 100%; justify-content: center; }
  .tp-card { padding: 13px 14px; }
  .tp-card-title { font-size: 16px; }
  .tp-more { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .tp-print, .tp-more, .tp-more-chev, .tp-toc-link { transition: none; }
}

/* ── Print — the legal document only ─────────────────────────────────── */
@media print {
  .sg-top,
  .sgn-foot,
  #sg-sale,
  .sg-nav,
  .sg-trust,
  .tp-hero,
  .tp-toc,
  .tp-meta button,
  .tp-more-wrap,
  .tp-crumbs { display: none !important; }

  .tp-body { background: #fff; padding: 0; }
  .tp-wrap { max-width: none; padding: 0; }
  .tp-layout { display: block; }

  #terms-more[hidden] { display: flex !important; }

  .tp-doc-title { font-size: 24pt; margin-bottom: 6pt; }
  .tp-doc-intro { font-size: 10pt; color: #000; max-width: none; }
  .tp-updated {
    display: block;
    color: #444;
    margin-bottom: 10pt;
  }
  .tp-cards { gap: 8pt; }
  .tp-card {
    border: 1px solid #ccc;
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .tp-card-title { font-size: 12pt; }
  .tp-card-text { font-size: 9.5pt; color: #000; }
  .tp-card-num {
    background: #086BFF !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
