.terms-page {
  background: #f5f7fb;
}

.legal-hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 76px;
  background:
    radial-gradient(circle at 82% 20%, rgba(37, 99, 235, .28), transparent 30%),
    linear-gradient(135deg, #07152f 0%, #102853 100%);
}

.legal-hero::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -100px;
  bottom: -210px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  box-shadow: 0 0 0 54px rgba(255, 255, 255, .025), 0 0 0 108px rgba(255, 255, 255, .018);
}

.legal-hero .container {
  position: relative;
  z-index: 1;
}

.legal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: #8db5ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.legal-eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  background: #4d87f7;
}

.legal-hero h1 {
  max-width: 760px;
  color: #fff;
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.06;
}

.legal-hero p {
  max-width: 650px;
  margin-top: 18px;
  color: rgba(255, 255, 255, .7);
  font-size: 16px;
  line-height: 1.75;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  margin-top: 28px;
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
}

.legal-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legal-meta i {
  color: #71a0ff;
}

.legal-shell {
  padding: 52px 0 80px;
}

.legal-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1080px);
  justify-content: center;
  align-items: start;
  gap: 34px;
}

.legal-toc {
  position: sticky;
  top: 110px;
  max-height: calc(100vh - 138px);
  overflow-y: auto;
  padding: 22px 12px 22px 22px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, .05);
  scrollbar-width: thin;
}

.legal-toc h2 {
  margin: 0 10px 14px 0;
  padding-bottom: 13px;
  border-bottom: 1px solid #e8edf5;
  color: #0b1630;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.legal-toc-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
}

.legal-toc-list a {
  display: block;
  padding: 7px 10px;
  color: #64748b;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
  transition: color .15s, background .15s;
}

.legal-toc-list a:hover,
.legal-toc-list a.active {
  color: #1d4ed8;
  background: #eef4ff;
}

.legal-document {
  min-width: 0;
  padding: clamp(28px, 5vw, 58px);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .06);
}

.legal-intro {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid #e5eaf2;
}

.legal-intro p {
  color: #475569;
  font-size: 15px;
  line-height: 1.85;
}

.legal-intro p + p {
  margin-top: 14px;
}

.legal-intro p:last-child {
  padding: 14px 16px;
  color: #7f1d1d;
  background: #fff7f7;
  border-left: 3px solid #ef4444;
  border-radius: 0 8px 8px 0;
  font-weight: 600;
}

.legal-section {
  scroll-margin-top: 115px;
}

.legal-section + .legal-section {
  margin-top: 42px;
  padding-top: 42px;
  border-top: 1px solid #e8edf4;
}

.legal-section h2 {
  margin-bottom: 18px;
  color: #0b1630;
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.3;
}

.legal-section h3 {
  margin: 26px 0 12px;
  color: #172554;
  font-size: 17px;
  font-weight: 750;
  line-height: 1.4;
}

.legal-section p {
  color: #475569;
  font-size: 14.5px;
  line-height: 1.85;
}

.legal-section p + p,
.legal-section ul + p,
.legal-section ol + p,
.legal-section p + ul,
.legal-section p + ol {
  margin-top: 14px;
}

.legal-section ul,
.legal-section ol {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 14px 0 0 20px;
  color: #475569;
}

.legal-section li {
  padding-left: 5px;
  font-size: 14.5px;
  line-height: 1.75;
}

.legal-section li::marker {
  color: #2563eb;
  font-weight: 700;
}

.legal-section a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.legal-section a:hover {
  text-decoration: underline;
}

.legal-loading {
  padding: 70px 20px;
  color: #64748b;
  text-align: center;
}

.legal-loading i {
  display: block;
  margin-bottom: 14px;
  color: #2563eb;
  font-size: 28px;
}

.legal-error {
  padding: 24px;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  line-height: 1.7;
}

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

@media (max-width: 768px) {
  .legal-hero {
    padding: 52px 0 56px;
  }

  .legal-shell {
    padding: 24px 0 52px;
  }

  .legal-layout {
    display: block;
  }

  .legal-toc {
    position: static;
    max-height: none;
    margin-bottom: 18px;
    padding: 17px;
  }

  .legal-toc h2 {
    margin-bottom: 10px;
  }

  .legal-toc-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 220px;
    overflow-y: auto;
  }

  .legal-document {
    border-radius: 13px;
  }
}

@media (max-width: 480px) {
  .legal-meta {
    flex-direction: column;
    gap: 9px;
  }

  .legal-toc-list {
    grid-template-columns: 1fr;
  }

  .legal-section + .legal-section {
    margin-top: 32px;
    padding-top: 32px;
  }
}
