:root {
  color-scheme: dark;
  --page-bg: #0d0f12;
  --page-surface: #15181d;
  --page-surface-raised: #1a1e24;
  --page-border: #292e36;
  --page-border-strong: #3a414d;
  --page-text: #f3f0e9;
  --page-text-secondary: #c6c4be;
  --page-text-muted: #9399a3;
  --page-accent: #7182ba;
  --page-accent-hover: #8496ce;
  --page-focus: #9aabe2;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--page-text);
  font-family: Satoshi, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
}

a {
  color: #aebcf0;
  text-underline-offset: 3px;
}

a:focus-visible {
  border-radius: 4px;
  outline: 3px solid var(--page-focus);
  outline-offset: 3px;
}

.legal-main {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.legal-panel,
.error-panel {
  border: 1px solid var(--page-border);
  border-radius: 16px;
  background: var(--page-surface);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.24);
}

.legal-panel {
  padding: clamp(28px, 5vw, 56px);
}

.back-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  color: var(--page-text-secondary);
  font-weight: 700;
  text-decoration: none;
}

.back-link::before {
  content: "←";
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.25rem, 8vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

h2 {
  margin: 38px 0 12px;
  color: var(--page-text);
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

p,
li {
  color: var(--page-text-secondary);
}

.updated {
  margin-bottom: 30px;
  color: var(--page-text-muted);
  font-weight: 600;
}

ul {
  padding-left: 22px;
}

.error-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px 0;
  text-align: center;
}

.error-main {
  width: min(560px, calc(100% - 32px));
}

.error-panel {
  padding: clamp(32px, 7vw, 56px);
}

.error-code {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  margin-bottom: 18px;
  padding: 0 11px;
  border: 1px solid var(--page-border-strong);
  border-radius: 999px;
  color: var(--page-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.error-panel h1 {
  margin-bottom: 14px;
  font-size: clamp(2.4rem, 10vw, 4rem);
}

.error-panel p {
  max-width: 36rem;
  margin: 0 auto 30px;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.error-actions a {
  display: inline-flex;
  min-width: 170px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--page-border-strong);
  border-radius: 10px;
  color: var(--page-text);
  font-weight: 700;
  text-decoration: none;
}

.error-actions .primary {
  border-color: var(--page-accent);
  background: var(--page-accent);
  color: #fff;
}

.error-actions .primary:hover {
  border-color: var(--page-accent-hover);
  background: var(--page-accent-hover);
}

.error-actions .secondary:hover {
  background: var(--page-surface-raised);
}

@media (max-width: 520px) {
  .legal-main {
    width: min(100% - 24px, 880px);
    padding: 12px 0 36px;
  }

  .legal-panel {
    padding: 24px 20px 32px;
  }

  .back-link {
    margin-bottom: 22px;
  }

  .error-actions a {
    width: 100%;
  }
}
