:root {
  --bg: #030303;
  --bg-elevated: #0c0c0c;
  --surface: rgba(12, 12, 12, 0.92);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --ink: #f4f4f5;
  --muted: #a1a1aa;
  --muted-2: #71717a;
  --accent-blue: #1682ff;
  --accent-red: #ed2939;
  --radius: 10px;
  --radius-lg: 16px;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html {
  -webkit-font-smoothing: antialiased;
}

body.legal-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  position: relative;
}

.legal-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(22, 130, 255, 0.18), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(237, 41, 57, 0.06), transparent 45%),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(22, 130, 255, 0.08), transparent 50%),
    linear-gradient(180deg, #050508 0%, #000 40%, #030303 100%);
}

.legal-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  background: rgba(3, 3, 3, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.legal-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.legal-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.legal-logo svg {
  width: clamp(132px, 22vw, 188px);
  height: auto;
  display: block;
}

.legal-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.legal-lang-strip {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 22px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(3, 3, 3, 0.55);
}

.legal-lang-strip .lang-switcher {
  margin-right: 0;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lang-btn {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 6px 9px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  line-height: 1;
  font-family: inherit;
}

.lang-btn:hover {
  color: var(--ink);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.07);
}

.lang-btn.is-active {
  color: #0a0a0a;
  background: var(--ink);
  border-color: var(--ink);
}

.lang-btn.is-active:hover {
  background: #e4e4e7;
  border-color: #e4e4e7;
}

.legal-back-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.legal-back-link:hover {
  color: var(--ink);
}

.legal-main {
  position: relative;
  z-index: 1;
  max-width: min(820px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.legal-hero-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 28px 28px 26px;
  margin-bottom: 28px;
  background: linear-gradient(
    155deg,
    rgba(22, 130, 255, 0.14) 0%,
    rgba(12, 12, 14, 0.97) 42%,
    #0a0a0b 100%
  );
  border: 1px solid var(--border);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.legal-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 12px;
}

.legal-title {
  margin: 0 0 10px;
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--ink);
}

.legal-updated {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--muted);
}

.legal-lead {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #d4d4d8;
  max-width: 62ch;
}

.legal-sections {
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 0 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.legal-sections.fx-grad-top {
  padding-top: 14px;
}

.legal-block {
  padding: 22px 26px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.legal-block:last-of-type {
  border-bottom: none;
}

.legal-block h2 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.legal-block ul {
  margin: 0;
  padding: 0 0 0 1.2rem;
  list-style: none;
}

.legal-block li {
  position: relative;
  margin: 0 0 10px;
  padding-left: 0.35rem;
  color: #d4d4d8;
  font-size: 15px;
  line-height: 1.65;
}

.legal-block li:last-child {
  margin-bottom: 0;
}

.legal-block li::before {
  content: '';
  position: absolute;
  left: -1rem;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-red));
  opacity: 0.85;
}

.legal-footer {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.legal-footer-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 14px;
}

.legal-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legal-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.legal-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

@media (max-width: 520px) {
  .legal-header-inner {
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .legal-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .legal-hero-card {
    padding: 22px 20px;
  }

  .legal-block {
    padding: 18px 20px 16px;
  }
}
