:root {
  color-scheme: dark;
  --bg: #05070a;
  --panel: rgba(9, 13, 20, 0.94);
  --panel-strong: rgba(232, 241, 255, 0.08);
  --text: #e8f1ff;
  --muted: rgba(192, 199, 209, 0.82);
  --line: rgba(232, 241, 255, 0.16);
  --neon: #00d1ff;
  --blue: #007bff;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 8%, rgba(0, 123, 255, 0.24), transparent 32%),
    radial-gradient(circle at 10% 16%, rgba(0, 209, 255, 0.14), transparent 28%),
    linear-gradient(180deg, #030508, #05070a 48%, #08101a);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.legal-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.legal-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(232, 241, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(232, 241, 255, 0.026) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
}

.legal-dialog {
  position: relative;
  width: min(920px, 100%);
  max-height: calc(100vh - 56px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: 0 32px 110px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(232, 241, 255, 0.08);
}

.legal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 13, 20, 0.96);
  backdrop-filter: blur(18px);
}

.legal-kicker {
  margin: 0 0 8px;
  color: #8fdfff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.legal-close {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(232, 241, 255, 0.18);
  border-radius: 50%;
  background: rgba(232, 241, 255, 0.06);
  text-decoration: none;
  font-size: 26px;
  line-height: 1;
}

.legal-content {
  max-height: calc(100vh - 178px);
  overflow: auto;
  padding: 8px 26px 30px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.legal-content section {
  padding: 22px 0;
  border-bottom: 1px solid rgba(232, 241, 255, 0.1);
}

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

h2 {
  margin: 0 0 12px;
  font-size: 21px;
  line-height: 1.24;
}

p,
li {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.68;
}

p {
  margin: 0 0 12px;
}

ul,
ol {
  margin: 0;
  padding-left: 22px;
}

li + li {
  margin-top: 7px;
}

.legal-note {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(0, 209, 255, 0.26);
  border-radius: 16px;
  background: rgba(0, 123, 255, 0.11);
}

.legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.legal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(232, 241, 255, 0.18);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.legal-button.primary {
  border-color: rgba(0, 209, 255, 0.4);
  background: linear-gradient(180deg, #f7fbff, #bdc9d8);
  color: #05070a;
}

@media (max-width: 620px) {
  .legal-page {
    padding: 10px;
    place-items: stretch;
  }

  .legal-dialog {
    max-height: calc(100vh - 20px);
    border-radius: 22px;
  }

  .legal-header {
    padding: 20px 18px 15px;
  }

  .legal-content {
    max-height: calc(100vh - 152px);
    padding: 4px 18px 24px;
  }

  p,
  li {
    font-size: 15px;
  }
}
