:root {
  --bg: #0b1020;
  --bg-soft: #12182c;
  --panel: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.16);
  --text: #f8f7ff;
  --muted: #c9c6d8;
  --accent: #ff4fc4;
  --accent-2: #8b5cff;
  --accent-3: #53b7ff;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  background: #0a0f1d;
  color-scheme: dark;
  min-height: 100%;
  min-height: -webkit-fill-available;
}

body {
  margin: 0;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 8%, rgba(255, 79, 196, 0.18), transparent 24%),
    radial-gradient(circle at 86% 14%, rgba(83, 183, 255, 0.16), transparent 22%),
    radial-gradient(circle at 50% 82%, rgba(139, 92, 255, 0.16), transparent 28%),
    linear-gradient(180deg, #0a0f1d 0%, #12182c 52%, #0d1322 100%);
  animation: page-fade-in 220ms ease both;
  transition: opacity 150ms ease;
}

body.page-fade-out {
  opacity: 0;
}

a {
  color: #ffd3f4;
  text-decoration: none;
}

a:hover {
  color: #ffffff;
}

.legal-topbar {
  width: min(1080px, calc(100% - 32px));
  margin: 18px auto 0;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(10, 14, 26, 0.58);
  backdrop-filter: blur(14px);
}

.legal-brand {
  color: var(--text);
  font-weight: 700;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.legal-page {
  width: min(1080px, calc(100% - 32px));
  margin: 18px auto 30px;
}

.legal-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  box-shadow: var(--shadow);
}

h1,
h2 {
  margin-top: 0;
  letter-spacing: -0.01em;
}

h2 {
  margin-top: 22px;
  font-size: 1.1rem;
}

p,
li {
  color: var(--muted);
  line-height: 1.6;
}

ul {
  margin: 10px 0 0 20px;
  padding: 0;
}

.legal-note {
  margin-top: 4px;
  color: #ffd3f4;
  font-weight: 600;
}

.legal-box {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px;
  background: rgba(9, 13, 24, 0.52);
}

.terms-accept-box {
  margin-bottom: 20px;
}

.terms-accept-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.terms-accept-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 55%, var(--accent-3) 100%);
  cursor: pointer;
}

.terms-accept-btn:disabled {
  cursor: default;
  opacity: 0.7;
}

.legal-footer {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto 24px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: center;
}

.legal-disclaimer {
  margin-top: 24px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.global-logout-btn {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 120;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 14, 26, 0.72);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.global-logout-btn:hover {
  border-color: rgba(255, 255, 255, 0.28);
}

@keyframes page-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 740px) {
  .legal-topbar {
    border-radius: 16px;
    flex-direction: column;
    align-items: flex-start;
  }
}
