/* ===================================================================
   Open SWG Realms — design tokens
   Direction: "Service platform" — reads like a real product (think a
   clean SaaS dashboard/marketing site), with restrained space cues:
   a soft nebula-gradient orb as the mark, a faint starfield in the
   hero, and orbit rings as the one recurring signature motif.
   =================================================================== */

:root {
  /* color */
  --bg:            #0a0c14;
  --bg-panel:      #12141f;
  --bg-panel-alt:  #171a28;
  --border:        #23273a;
  --border-strong: #343a52;
  --text-primary:  #eef0f7;
  --text-secondary:#a8adc2;
  --text-muted:    #6b7086;

  --accent:        #6d6df2;
  --accent-hover:  #8180f5;
  --accent-soft:   rgba(109, 109, 242, 0.14);
  --nebula-pink:   #ec6fae;
  --gold:          #e8b04b;

  --success:       #34d399;
  --danger:        #f87171;
  --pending:       #fbbf24;

  /* type */
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body:    'Inter', 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  /* layout */
  --max-width: 1120px;
  --radius: 10px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  color: var(--text-primary);
}

h1 { font-size: 2.75rem; line-height: 1.15; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.05rem; font-family: var(--font-body); font-weight: 600; }

p { color: var(--text-secondary); margin: 0 0 1em; }

code, kbd, .mono { font-family: var(--font-mono); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.9em;
  background: var(--accent-soft);
  padding: 5px 12px;
  border-radius: 999px;
}

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ---------------- nav ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 12, 20, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}
.brand:hover { text-decoration: none; }

.brand-mark { width: 28px; height: 28px; flex-shrink: 0; }
.brand-realms { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 30px; list-style: none; margin: 0; padding: 0; }

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--text-primary); text-decoration: none; }
.nav-links a.active { color: var(--text-primary); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 10px 18px;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--bg-panel-alt); border-color: var(--text-muted); text-decoration: none; }

.btn-solid {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
.btn-solid:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.btn-ghost { border-color: var(--border); color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); }

/* ---------------- hero ---------------- */

.hero { padding: 108px 24px 90px; text-align: center; position: relative; overflow: hidden; }

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1.5px 1.5px at 75% 20%, rgba(255,255,255,0.25), transparent),
    radial-gradient(1px 1px at 60% 60%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 35% 75%, rgba(255,255,255,0.25), transparent),
    radial-gradient(1.5px 1.5px at 90% 65%, rgba(255,255,255,0.2), transparent),
    radial-gradient(ellipse 480px 320px at 50% 15%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}

.hero-inner { position: relative; max-width: 720px; margin: 0 auto; }
.hero h1 span {
  background: linear-gradient(90deg, var(--accent), var(--nebula-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub { font-size: 1.08rem; max-width: 560px; margin: 0 auto 2.2em; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------------- sections ---------------- */

.section { padding: 76px 24px; border-top: 1px solid var(--border); }
.section-head { max-width: 620px; margin: 0 auto 44px; text-align: center; }
.section-head p { margin: 0; }

/* ---------------- card (signature element) ----------------
   Clean, quiet card — no gadget corners. The .corner spans from
   earlier markup are hidden; orbit rings (used on the mark + logos)
   carry the "galaxy" motif instead. */

.hud-frame {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.hud-frame:hover { border-color: var(--border-strong); }

.corner { display: none; }

/* ---------------- feature grid ---------------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.feature-card { text-align: left; }

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--accent);
}
.feature-icon svg { width: 20px; height: 20px; }

.feature-card h3 { margin-bottom: 0.4em; }
.feature-card p { font-size: 0.92rem; margin: 0; }

/* ---------------- how it works ---------------- */

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: var(--max-width); margin: 0 auto; }

.step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.step h3 { margin-bottom: 0.4em; }
.step p { margin: 0; font-size: 0.92rem; }

/* ---------------- server grid ---------------- */

.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; max-width: var(--max-width); margin: 0 auto; }

.server-card { display: flex; flex-direction: column; gap: 14px; }
.server-card-top { display: flex; align-items: center; gap: 14px; }

.server-logo {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-panel-alt);
  box-shadow: 0 0 0 4px var(--accent-soft);
  flex-shrink: 0;
}

.server-name { font-family: var(--font-display); font-weight: 600; font-size: 1rem; margin: 0; color: var(--text-primary); }

.server-links { display: flex; gap: 10px; margin-top: auto; }
.server-links .btn { flex: 1; justify-content: center; padding: 9px 12px; font-size: 0.8rem; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ---------------- docs page ---------------- */

.docs-layout { max-width: 820px; margin: 0 auto; padding: 56px 24px 96px; }
.docs-layout h2 { margin-top: 2.2em; }
.docs-layout h2:first-of-type { margin-top: 0; }

.field-table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 0.92rem; border-radius: var(--radius); overflow: hidden; }
.field-table th, .field-table td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; vertical-align: top; }
.field-table th {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  background: var(--bg-panel-alt);
}
.field-table td.field-name { font-family: var(--font-mono); color: var(--accent); white-space: nowrap; }

pre.code-block {
  background: #0d0f18;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: #d5d8ea;
  margin: 1.2em 0;
}

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  background: var(--bg-panel);
  padding: 14px 18px;
  font-size: 0.9rem;
  margin: 1.4em 0;
}
.callout strong { color: var(--gold); }

/* ---------------- footer ---------------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------------- forms (auth + submission) ---------------- */

.auth-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  min-height: calc(100vh - 260px);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55);
}

.auth-card-mark { display: flex; justify-content: center; margin-bottom: 20px; }
.auth-card-mark svg { width: 44px; height: 44px; }

.auth-card h1 { font-size: 1.5rem; text-align: center; margin-bottom: 0.4em; }
.auth-card > p.auth-sub { text-align: center; margin-bottom: 1.8em; font-size: 0.92rem; }

.form-card { max-width: 480px; margin: 0 auto; }

.form-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 2.5em;
}

.form-field { margin-bottom: 18px; }
.form-field label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-field input {
  width: 100%;
  background: var(--bg-panel-alt);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-field input:hover { border-color: var(--text-muted); }
.form-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Chrome/Safari force a light autofill background unless overridden —
   without this, autofilled fields break the dark theme entirely. */
.form-field input:-webkit-autofill,
.form-field input:-webkit-autofill:hover,
.form-field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-panel-alt) inset;
  -webkit-text-fill-color: var(--text-primary);
  caret-color: var(--text-primary);
  transition: background-color 9999s ease-in-out 0s;
}

.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .two-col { grid-template-columns: 1fr; } }

.form-error-list {
  display: flex;
  gap: 10px;
  border: 1px solid var(--danger);
  background: rgba(248, 113, 113, 0.08);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.form-error-list .alert-icon { color: var(--danger); flex-shrink: 0; margin-top: 1px; }
.form-error-list .alert-body p { color: #fecaca; margin: 0 0 4px; font-size: 0.86rem; }
.form-error-list .alert-body p:last-child { margin-bottom: 0; }

.form-success {
  display: flex;
  gap: 10px;
  border: 1px solid var(--success);
  background: rgba(52, 211, 153, 0.08);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  color: #a7f3d0;
  font-size: 0.88rem;
}
.form-success .alert-icon { color: var(--success); flex-shrink: 0; margin-top: 1px; }

.form-footer-link { text-align: center; font-size: 0.88rem; margin-top: 20px; color: var(--text-muted); }

/* ---------------- status badges ---------------- */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}
.status-pending  { color: var(--pending); background: rgba(251, 191, 36, 0.14); }
.status-approved { color: var(--success); background: rgba(52, 211, 153, 0.14); }
.status-rejected { color: var(--danger); background: rgba(248, 113, 113, 0.14); }

/* ---------------- submission list ---------------- */

.submission-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.submission-row-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.submission-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  background: var(--bg-panel-alt);
  flex-shrink: 0;
}
.submission-name { font-family: var(--font-display); font-weight: 600; }
.submission-date { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* ---------------- responsive ---------------- */

@media (max-width: 760px) {
  .nav-links { display: none; }
  .hero h1 { font-size: 2.15rem; }
  .steps { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
