/* Terms of Service / Privacy Policy pages (layout from includes/legal_body.php) */

.legal-page {
  padding: 140px 0 80px;
  overflow: visible;
}

/* Hero */
.legal-hero {
  position: relative;
  padding-bottom: 36px;
  margin-bottom: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.legal-hero::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 96px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-color), transparent);
}
.legal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--accent-color);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.legal-eyebrow i { font-size: 15px; }
.legal-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.1;
}
.legal-intro {
  max-width: 720px;
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 17px;
  line-height: 1.75;
}
.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.legal-meta li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}
.legal-meta i { color: var(--accent-color); }

/* Table of contents */
.legal-toc {
  position: sticky;
  top: 110px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  padding: 22px 18px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-color), transparent 55%);
  scrollbar-width: thin;
}
.legal-toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  list-style: none;
  cursor: default;
  pointer-events: none;
}
.legal-toc summary::-webkit-details-marker { display: none; }
.legal-toc summary .bi { display: none; }
.legal-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.legal-toc a {
  display: flex;
  gap: 10px;
  padding: 7px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  line-height: 1.4;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}
.legal-toc a span {
  flex: 0 0 22px;
  color: rgba(255, 255, 255, 0.35);
  font-variant-numeric: tabular-nums;
}
.legal-toc a:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.legal-toc a.active {
  border-left-color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color), transparent 88%);
  color: #fff;
}
.legal-toc a.active span { color: var(--accent-color); }

/* Sections */
.legal-section {
  scroll-margin-top: 110px;
  padding: 34px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.legal-section:first-child { padding-top: 0; border-top: 0; }
.legal-section h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
}
.legal-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--accent-color), transparent 60%);
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-color), transparent 88%);
  color: var(--accent-color);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.legal-section p,
.legal-section li {
  max-width: 76ch;
  color: rgba(255, 255, 255, 0.76);
  font-size: 16px;
  line-height: 1.8;
}
.legal-section p { margin: 0 0 14px; }
.legal-section p:last-child { margin-bottom: 0; }
.legal-section a { text-decoration: underline; text-underline-offset: 3px; }

.legal-list {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}
.legal-list li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 8px;
}
.legal-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.75em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-color);
}
.legal-list.lettered { counter-reset: legal; }
.legal-list.lettered li { padding-left: 34px; }
.legal-list.lettered li::before {
  counter-increment: legal;
  content: counter(legal, lower-alpha);
  top: 0.35em;
  left: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent-color), transparent 85%);
  color: var(--accent-color);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

/* Callout for short key statements */
.legal-note {
  max-width: 76ch;
  margin: 0 0 14px;
  padding: 14px 18px;
  border-left: 3px solid var(--accent-color);
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--accent-color), transparent 92%);
  color: rgba(255, 255, 255, 0.86);
}

/* Contact card at the end */
.legal-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 40px;
  padding: 28px 30px;
  border: 1px solid color-mix(in srgb, var(--accent-color), transparent 70%);
  border-radius: 18px;
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--accent-color), transparent 80%), transparent 55%),
    color-mix(in srgb, var(--surface-color), transparent 40%);
}
.legal-contact h3 { margin: 0 0 6px; font-size: 20px; font-weight: 600; }
.legal-contact p { margin: 0; color: rgba(255, 255, 255, 0.7); }
.legal-contact .btn-legal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 999px;
  background: var(--accent-color);
  color: #fff;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.2s, transform 0.2s;
}
.legal-contact .btn-legal:hover { background: #4a7bdc; color: #fff; transform: translateY(-1px); }

/* Tablet / phone: contents become a collapsible box above the text */
@media (max-width: 991px) {
  .legal-page { padding-top: 110px; }
  .legal-toc {
    position: static;
    max-height: none;
    margin-bottom: 32px;
    padding: 16px 18px;
  }
  .legal-toc summary { margin: 0; cursor: pointer; pointer-events: auto; }
  .legal-toc summary .bi { display: inline-block; transition: transform 0.2s; }
  .legal-toc[open] summary { margin-bottom: 12px; }
  .legal-toc[open] summary .bi { transform: rotate(180deg); }
  .legal-section h2 { font-size: 19px; }
  .legal-num { min-width: 34px; height: 34px; font-size: 14px; border-radius: 10px; }
  .legal-section p, .legal-section li { font-size: 15px; }
  .legal-contact { padding: 22px; }
}
