:root {
  color-scheme: dark;
  --ink: #02050d;
  --ink-soft: #050b18;
  --panel: rgba(7, 17, 39, 0.88);
  --text: #eef8ff;
  --muted: #a9bdd1;
  --cyan: #00d9ff;
  --cyan-soft: #75f5ff;
  --blue: #0b63ff;
  --red: #ff003d;
  --red-soft: #ff4b6e;
  --line: rgba(87, 186, 255, 0.24);
  --grid-size: 80px;
  --content-width: 980px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background-color: var(--ink);
  background-image:
    linear-gradient(rgba(32, 121, 255, 0.115) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 121, 255, 0.115) 1px, transparent 1px);
  background-position: center top;
  background-size: var(--grid-size) var(--grid-size);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(2, 5, 13, 0.78), rgba(2, 5, 13, 0.38) 48%, rgba(2, 5, 13, 0.82)),
    linear-gradient(180deg, rgba(2, 5, 13, 0.22), rgba(2, 5, 13, 0.8) 68%, var(--ink)),
    url("./assets/trading-futures-brand.png") center top / cover no-repeat;
  content: "";
  opacity: 0.92;
  pointer-events: none;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent 0, rgba(2, 5, 13, 0.55) 500px, rgba(2, 5, 13, 0.88) 900px);
  content: "";
  pointer-events: none;
}

a {
  color: var(--cyan-soft);
  text-decoration-color: rgba(117, 245, 255, 0.4);
  text-underline-offset: 3px;
}

a:hover,
a:focus-visible {
  color: #ffffff;
  text-decoration-color: var(--cyan);
  outline: none;
}

.container {
  width: min(calc(100% - 48px), var(--content-width));
  margin-inline: auto;
}

.legal-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid rgba(87, 186, 255, 0.28);
  background: rgba(2, 5, 13, 0.82);
  box-shadow: 0 12px 42px rgba(0, 0, 0, 0.32);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.legal-header::after {
  position: absolute;
  bottom: -1px;
  left: 50%;
  width: min(46vw, 560px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 18px rgba(0, 217, 255, 0.58);
  content: "";
  transform: translateX(-50%);
}

.legal-header nav {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(0, 2fr) minmax(170px, 1fr);
  gap: 24px;
  align-items: center;
  min-height: 92px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: #ffffff;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.logo::before {
  width: 4px;
  height: 26px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  box-shadow: 0 0 14px rgba(0, 217, 255, 0.88);
  content: "";
}

.logo picture {
  display: none;
}

.page-title-header {
  min-width: 0;
  text-align: center;
}

.page-title-header h1 {
  margin: 0;
  color: #e8f4ff;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
  text-transform: uppercase;
}

.legal-header nav > div:last-child {
  justify-content: flex-end;
}

.btn-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(255, 0, 61, 0.62);
  border-radius: 4px;
  background: rgba(7, 17, 39, 0.78);
  box-shadow:
    0 0 0 1px rgba(11, 99, 255, 0.12) inset,
    0 0 24px rgba(255, 0, 61, 0.14);
  color: #ffffff;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.btn-contact:hover,
.btn-contact:focus-visible {
  border-color: var(--red);
  box-shadow: 0 0 30px rgba(255, 0, 61, 0.24);
  transform: translateY(-2px);
}

.legal-main {
  padding: 58px 0 84px;
}

.separator {
  display: none;
}

.legal-content {
  position: relative;
  padding-top: 28px;
}

.legal-content::before,
.legal-content::after {
  position: absolute;
  width: 74px;
  height: 74px;
  content: "";
  pointer-events: none;
}

.legal-content::before {
  top: 0;
  left: -18px;
  border-top: 1px solid var(--cyan);
  border-left: 1px solid var(--cyan);
  box-shadow: -5px -5px 22px rgba(0, 217, 255, 0.12);
}

.legal-content::after {
  right: -18px;
  bottom: -26px;
  border-right: 1px solid var(--red);
  border-bottom: 1px solid var(--red);
  box-shadow: 5px 5px 22px rgba(255, 0, 61, 0.12);
}

.legal-content h2,
.legal-content h3,
.legal-content h4 {
  font-family: "Space Grotesk", Arial, sans-serif;
  letter-spacing: 0;
  text-wrap: balance;
}

.legal-content h2 {
  margin: 0 0 36px;
  color: #ffffff;
  font-size: 2.65rem;
  font-weight: 700;
  line-height: 1.12;
  text-shadow: 0 14px 46px rgba(0, 0, 0, 0.62);
}

.legal-content h2::after {
  display: block;
  width: 96px;
  height: 2px;
  margin-top: 18px;
  background: linear-gradient(90deg, var(--red), var(--cyan));
  box-shadow: 0 0 16px rgba(0, 217, 255, 0.35);
  content: "";
}

.legal-content h3 {
  margin: 48px 0 14px;
  color: #ffffff;
  font-size: 1.42rem;
  font-weight: 600;
  line-height: 1.3;
}

.legal-content h4 {
  margin: 28px 0 8px;
  color: var(--cyan-soft);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.legal-content p,
.legal-content li,
.legal-content td,
.legal-content th {
  color: var(--muted);
}

.legal-content a {
  overflow-wrap: anywhere;
}

.legal-content p {
  margin: 0 0 18px;
}

.legal-content strong {
  color: #dcecff;
  font-weight: 700;
}

.legal-content ul,
.legal-content ol {
  max-width: 100%;
  margin: 12px 0 24px;
  padding-left: 25px;
}

.legal-content li {
  margin-bottom: 9px;
  padding-left: 4px;
}

.legal-content li::marker {
  color: var(--red-soft);
}

.legal-content table {
  display: block;
  width: 100%;
  margin: 24px 0 30px;
  overflow-x: auto;
  border-collapse: collapse;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(3, 9, 23, 0.58);
}

.legal-content th,
.legal-content td {
  min-width: 180px;
  padding: 15px 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.legal-content th {
  color: #e8f4ff;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-weight: 600;
}

.legal-content tr:last-child td {
  border-bottom: 0;
}

.legal-content small {
  color: #607a94;
  font-size: 0.78rem;
}

@media (max-width: 720px) {
  :root {
    --grid-size: 48px;
  }

  body {
    font-size: 15px;
    line-height: 1.7;
  }

  .container {
    width: calc(100% - 32px);
  }

  .legal-header nav {
    grid-template-columns: 1fr auto;
    gap: 14px;
    min-height: 76px;
  }

  .page-title-header {
    display: none;
  }

  .logo {
    font-size: 0.8rem;
  }

  .btn-contact {
    min-width: 88px;
    min-height: 38px;
    padding-inline: 13px;
    font-size: 0.72rem;
  }

  .legal-main {
    padding: 38px 0 60px;
  }

  .legal-content {
    padding-top: 20px;
  }

  .legal-content::before,
  .legal-content::after {
    width: 46px;
    height: 46px;
  }

  .legal-content::before {
    left: -8px;
  }

  .legal-content::after {
    right: -8px;
  }

  .legal-content h2 {
    margin-bottom: 30px;
    font-size: 2rem;
  }

  .legal-content h3 {
    margin-top: 38px;
    font-size: 1.24rem;
  }

  .legal-content th,
  .legal-content td {
    min-width: 150px;
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
