/* ============================================================
   STANDALONE PAGES (Django server-rendered: error / legal / allauth)
   ============================================================
   These pages link the built dashboard.css, so the shared .hero-* card,
   button, form and wordmark system comes from globals.css - edit the card
   look there and it flows to both the React app and these pages. This file
   only adds what the server-rendered markup needs on top: token aliases for
   the per-page inline palettes, the lockup wordmark + brand mark, the CSS
   entrance, the legal reading layout, the generic allauth form selectors, and
   the shared starfield background container. It is @imported into globals.css
   so it ships inside dashboard.css; none of it touches the React surfaces. */

/* Map the legacy standalone token names onto the React tokens so per-page
   inline `--hero-accent` palettes and the rules below resolve in both themes
   (globals.css owns the light-theme values of the right-hand tokens). */
:root {
  --text: var(--text-main);
  --dim: var(--text-muted);
  --panel: var(--bg-panel);
  --accent: var(--accent-blue);
  --accent-warn: var(--accent-amber);
  --border: var(--border-subtle);
  --card-shadow: rgba(var(--shadow-color), 0.5);
  --card-inner: rgba(var(--fg-rgb), 0.05);
  --hero-accent: var(--accent-blue);
  --hero-accent-2: #6366f1;
  --hero-accent-3: #8b5cf6;
}

/* Brand lockup (A-mark + ARKADIA + gradient GAMES) - the server markup. The
   React app renders the <Wordmark> component instead, so these classes only
   ever apply on the Django pages. Base font/weight/case come from globals'
   .hero-wordmark. */
.hero-wordmark--lockup {
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-wordmark--lockup .brand-mark,
.legal-brand .brand-mark {
  width: 1.1em;
  height: 1.1em;
  margin-right: 0.3em;
  flex-shrink: 0;
}
.hero-wordmark__brand {
  background: var(--brand-grad-135);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* CSS entrance for the server card contents - the lightweight stand-in for the
   React ScrollAnim rise. Each direct child fades up on a 60ms step. */
.hero-stagger > * {
  opacity: 0;
  transform: translateY(12px);
  animation: hero-stagger-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.hero-stagger > *:nth-child(1) { animation-delay: 40ms; }
.hero-stagger > *:nth-child(2) { animation-delay: 100ms; }
.hero-stagger > *:nth-child(3) { animation-delay: 160ms; }
.hero-stagger > *:nth-child(4) { animation-delay: 220ms; }
.hero-stagger > *:nth-child(5) { animation-delay: 280ms; }
.hero-stagger > *:nth-child(6) { animation-delay: 340ms; }
.hero-stagger > *:nth-child(7) { animation-delay: 400ms; }
.hero-stagger > *:nth-child(8) { animation-delay: 460ms; }
.hero-stagger > *:nth-child(9) { animation-delay: 520ms; }

/* Legal pages wrap the whole article in .hero-stagger, so they run well past 9
   children; settle the rest in as one group right after the header. */
.legal-panel.hero-stagger > *:nth-child(n + 10) { animation-delay: 560ms; }

@keyframes hero-stagger-in {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-stagger > * { animation: none; opacity: 1; transform: none; }
}

/* ============================================================
   SHARED STARFIELD BACKGROUND
   ============================================================
   The vanilla starfield.js draws into [data-starfield], matching the React
   Starfield used on the dashboards. Fixed, behind the card, dark-only (the
   script no-ops in light theme - the body gradient carries those). */
[data-starfield] {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
[data-starfield] canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ============================================================
   LEGAL / LONG-FORM PAGES (terms, privacy)
   ============================================================
   A wide left-aligned reading panel with its own slim top bar and footer. */
.legal-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.legal-topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 26px 24px 0;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}

/* Matches the SPA's .hero-back-link: glass pill, arrow nudge on hover, accent glow. */
.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px 9px 12px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease,
    transform 0.15s ease, box-shadow 0.2s ease;
}

.legal-back__arrow {
  font-size: 14px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.legal-back:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--hero-accent) 45%, transparent);
  background: color-mix(in srgb, var(--hero-accent) 12%, var(--panel));
  box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--hero-accent) 60%, transparent);
}

.legal-back:hover .legal-back__arrow { transform: translateX(-3px); }
.legal-back:active { transform: scale(0.97); }

@media (prefers-reduced-motion: reduce) {
  .legal-back,
  .legal-back__arrow { transition: none; }
  .legal-back:active { transform: none; }
}

.legal-wrapper {
  position: relative;
  z-index: 10;
  flex: 1;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 24px 72px;
}

.legal-panel {
  background: var(--panel);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow:
    0 30px 70px -20px var(--card-shadow),
    0 1px 0 var(--card-inner) inset;
  padding: 52px 56px 56px;
  color: var(--dim);
  line-height: 1.7;
  font-size: 15px;
}

.legal-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--hero-accent);
  background: color-mix(in srgb, var(--hero-accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--hero-accent) 28%, transparent);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.legal-title {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
  color: var(--text);
  margin: 0 0 10px;
}

.legal-title__accent {
  background: linear-gradient(135deg,
    var(--hero-accent) 0%,
    var(--hero-accent-2) 55%,
    var(--hero-accent-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.legal-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--dim);
  opacity: 0.8;
  padding-bottom: 26px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border);
}

.legal-panel h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 38px 0 12px;
}

.legal-panel p { margin: 0 0 14px; }

.legal-panel ul {
  margin: 0 0 14px;
  padding-left: 20px;
  list-style: disc;
}

.legal-panel li { margin-bottom: 8px; }
.legal-panel li strong,
.legal-panel p strong { color: var(--text); font-weight: 600; }

.legal-panel a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.legal-panel a:hover { text-decoration: underline; }

.legal-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 6px;
  background: var(--card-inner);
  border: 1px solid var(--border);
  color: var(--text);
}

.legal-disclaimer {
  margin-top: 40px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-inner);
  font-size: 13px;
  color: var(--dim);
}

.legal-footer {
  position: relative;
  z-index: 10;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-deep) 55%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.legal-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 22px 24px;
}

.legal-copy {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
  opacity: 0.8;
}

.legal-footer-links { display: flex; gap: 24px; }

.legal-footer-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.2s;
}

.legal-footer-links a:hover { color: var(--text); }

@media (max-width: 600px) {
  .legal-panel { padding: 34px 24px 38px; border-radius: 16px; }
  .legal-title { font-size: 1.7rem; }
  .legal-footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   ALLAUTH FORMS (django-allauth renders plain forms, not .hero-field markup)
   ============================================================
   Scoped under .allauth-inner so these generic element selectors never reach
   the error-page headline (.hero-card h2) or the brand wordmark. */
.allauth-inner h1,
.allauth-inner h2,
.allauth-inner h3 {
  font-size: 1.05rem;
  margin: 0 0 12px 0;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text);
  text-align: center;
}

.allauth-inner p {
  color: var(--dim);
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 18px 0;
  text-align: center;
}

.allauth-inner a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
.allauth-inner a:hover { color: var(--text); }

.allauth-inner form:not(.hero-form) { display: flex; flex-direction: column; gap: 14px; }

.allauth-inner form label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dim);
}

.allauth-inner form button[type="submit"],
.allauth-inner form input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  border: 1px solid transparent;
  cursor: pointer;
  background: linear-gradient(135deg, var(--hero-accent) 0%, var(--hero-accent-2) 100%);
  box-shadow:
    0 8px 24px -6px color-mix(in srgb, var(--hero-accent) 45%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.2s, box-shadow 0.25s;
}

.allauth-inner form button[type="submit"]:hover,
.allauth-inner form input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 34px -8px color-mix(in srgb, var(--hero-accent) 60%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.allauth-inner .helptext,
.allauth-inner .form-text { font-size: 11px; color: var(--dim); line-height: 1.5; }

.allauth-inner .errorlist,
.allauth-inner ul.errorlist {
  list-style: none;
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  margin: 0;
}

.allauth-inner ul:not(.errorlist):not(.hero-errors):not(.hero-nonfield-errors),
.allauth-inner ol {
  color: var(--dim);
  font-size: 13px;
  line-height: 1.6;
  padding-left: 20px;
}

.allauth-inner { margin-top: 24px; }
.allauth-section-heading { margin-top: 28px; }
.allauth-hint-tiny { font-size: 11px; }

@media (prefers-reduced-motion: reduce) {
  .allauth-inner form button[type="submit"]:hover,
  .allauth-inner form input[type="submit"]:hover { transform: none; }
}
