:root {
  --legal-surface: #1f2230;
  --legal-surface-soft: #1b1e29;
  --legal-surface-border: #2c3142;
  --legal-surface-soft-border: #353a4d;
  --legal-text: #e7ebf8;
  --legal-muted: #b5bdd6;
  --legal-highlight: #ffb07c;
  --legal-shadow: 0 14px 32px rgba(0, 0, 0, 0.4);
  --legal-soft-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.legal-page {
  min-height: 100vh;
  margin: 0;
  padding: clamp(1.75rem, 3vw, 3rem);
  font-family: "Inter", "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--color-body-bg, #151821);
  background-attachment: fixed;
  color: var(--color-text-primary, var(--legal-text));
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vw, 1.5rem);
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

.legal-page__background {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  background: radial-gradient(120px 120px at 18% 65%, rgba(244, 78, 78, 0.12), rgba(244, 78, 78, 0)),
    radial-gradient(220px 220px at 88% 18%, rgba(62, 110, 204, 0.15), rgba(62, 110, 204, 0)),
    radial-gradient(160px 160px at 42% 22%, rgba(255, 216, 160, 0.14), rgba(255, 216, 160, 0)),
    radial-gradient(260px 260px at 78% 80%, rgba(174, 188, 255, 0.14), rgba(174, 188, 255, 0));
  background-attachment: fixed;
  background-position: center;
  background-size: 140% 140%;
  background-repeat: no-repeat;
  filter: blur(18px);
  opacity: 0.9;
  z-index: 0;
  transform: translateZ(0) scale(1.1);
}

.legal-shell {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 2.5vw, 2rem);
  min-height: 100vh;
  padding-bottom: 20px;
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)) var(--surface-soft, #1b1e29);
  border: 1px solid var(--surface-soft-border, var(--legal-surface-soft-border));
  border-radius: 16px;
  box-shadow: var(--surface-soft-shadow, var(--legal-soft-shadow));
  backdrop-filter: blur(8px);
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--color-text-primary, #e4e7f5);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-family: "Space Grotesk", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.legal-brand__icon {
  width: 48px;
  height: 48px;
  display: block;
}

.legal-brand__icon--light {
  display: none;
}

html[data-theme="dark"] .legal-brand__icon--dark,
html[data-theme="night"] .legal-brand__icon--dark {
  display: none;
}

html[data-theme="dark"] .legal-brand__icon--light,
html[data-theme="night"] .legal-brand__icon--light {
  display: block;
}

.legal-brand__name {
  font-size: 1.05rem;
}

.legal-header__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  color: var(--color-text-primary, #e4e7f5);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.legal-header__back:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}

body.dark-theme .legal-brand__icon--dark {
  display: none;
}

body.dark-theme .legal-brand__icon--light {
  display: block;
}

.legal-main {
  display: flex;
  flex-direction: column;
}

.legal-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)) var(--surface-default, #1f2230);
  border: 1px solid var(--surface-border, var(--legal-surface-border));
  border-radius: 22px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow: var(--surface-shadow, var(--legal-shadow));
  backdrop-filter: blur(6px);
  margin-bottom: 20px;
}

.legal-hero {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-bottom: 0.75rem;
}

.legal-hero__eyebrow {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warning-accent);
}

.legal-hero__title {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.3rem);
  font-family: "Space Grotesk", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.legal-hero__updated {
  margin: 0;
  font-size: 1rem;
  color: var(--text-muted);
}

.legal-section {
  margin-top: 1.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--surface-border, var(--legal-surface-border));
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.legal-section__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
}

.legal-section p {
  margin: 0;
  line-height: 1.65;
  color: var(--color-text-primary);
}

.legal-list {
  margin: 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.3rem;
  color: var(--color-text-primary);
}

.legal-list li {
  line-height: 1.6;
}

.legal-list strong {
  font-weight: 700;
}

.legal-note {
  background: color-mix(in srgb, var(--surface-soft) 90%, transparent);
  border: 1px solid color-mix(in srgb, var(--surface-border) 70%, transparent);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  line-height: 1.6;
  color: var(--panel-heading-color, var(--color-text-primary));
}

.legal-section__list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
}

.legal-section__list li {
  line-height: 1.6;
}

@media (max-width: 720px) {
  body.legal-page {
    padding: 1.25rem;
  }

  .legal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .legal-brand {
    font-size: 0.98rem;
  }

  .legal-hero__title {
    font-size: clamp(1.6rem, 5vw, 2rem);
  }
}
