/*
 * Nexave — Shared Design System
 * Shared across all pages. Page-specific styles remain inline per-file.
 */

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── Design tokens ──────────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --nx-bg:          #0a0f1e;
  --nx-surface:     #0d1117;
  --nx-surface-2:   #111827;
  --nx-border:      #1e2a3a;
  --nx-border-2:    #0f172a;

  /* Brand */
  --nx-indigo:      #6366f1;
  --nx-indigo-dim:  #4f46e5;
  --nx-indigo-glow: rgba(99, 102, 241, 0.35);
  --nx-cyan:        #06b6d4;

  /* Semantic */
  --nx-red:         #f43f5e;
  --nx-green:       #22c55e;
  --nx-amber:       #f59e0b;

  /* Text */
  --nx-text:        #e2e8f0;
  --nx-text-muted:  #94a3b8;
  --nx-text-dim:    #64748b;
  --nx-text-subtle: #334155;

  /* Typography */
  --nx-font:        Inter, system-ui, -apple-system, sans-serif;
  --nx-font-mono:   'JetBrains Mono', 'Fira Code', monospace;

  /* Radii */
  --nx-r-sm:  4px;
  --nx-r:     8px;
  --nx-r-md:  10px;
  --nx-r-lg:  14px;
  --nx-r-xl:  20px;

  /* Transitions */
  --nx-t:       0.12s ease;
  --nx-t-slow:  0.25s ease;
}

/* ── Base typography ────────────────────────────────────────────────────── */
body {
  background:  var(--nx-bg);
  color:       var(--nx-text);
  font-family: var(--nx-font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--nx-indigo); }

/* ── Shared button primitives ───────────────────────────────────────────── */
.nx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--nx-font);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--nx-r);
  padding: 8px 18px;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background var(--nx-t), box-shadow var(--nx-t), border-color var(--nx-t), color var(--nx-t);
  white-space: nowrap;
  line-height: 1;
}
.nx-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.nx-btn-primary {
  background: var(--nx-indigo);
  color: #fff;
  box-shadow: 0 0 20px var(--nx-indigo-glow);
}
.nx-btn-primary:hover {
  background: var(--nx-indigo-dim);
  box-shadow: 0 0 28px rgba(99,102,241,0.5);
  text-decoration: none;
  color: #fff;
}

.nx-btn-ghost {
  background: transparent;
  color: var(--nx-text);
  border: 1px solid var(--nx-border);
}
.nx-btn-ghost:hover {
  border-color: var(--nx-text-dim);
  color: #f1f5f9;
  text-decoration: none;
}

.nx-btn-danger {
  background: rgba(244,63,94,0.1);
  color: #f87171;
  border: 1px solid rgba(244,63,94,0.2);
}
.nx-btn-danger:hover {
  background: rgba(244,63,94,0.18);
  border-color: rgba(244,63,94,0.4);
  text-decoration: none;
}

/* ── Shared form inputs ─────────────────────────────────────────────────── */
.nx-input {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  color: var(--nx-text);
  border-radius: var(--nx-r);
  padding: 8px 12px;
  font-family: var(--nx-font);
  font-size: 14px;
  width: 100%;
  transition: border-color var(--nx-t);
  outline: none;
}
.nx-input::placeholder { color: var(--nx-text-subtle); }
.nx-input:focus        { border-color: var(--nx-indigo); }
.nx-input:disabled     { opacity: 0.5; cursor: not-allowed; }

/* ── Toast notification ─────────────────────────────────────────────────── */
.nx-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--nx-surface-2);
  border: 1px solid var(--nx-border);
  color: var(--nx-text-muted);
  padding: 10px 22px;
  border-radius: var(--nx-r-md);
  font-size: 13px;
  font-family: var(--nx-font);
  z-index: 9999;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  white-space: nowrap;
  pointer-events: none;
  animation: nx-toast-in 0.2s ease;
}
.nx-toast.success { border-color: rgba(34,197,94,0.4);  color: #86efac; }
.nx-toast.error   { border-color: rgba(244,63,94,0.4);  color: #fca5a5; }
.nx-toast.info    { border-color: rgba(99,102,241,0.4); color: #a5b4fc; }
@keyframes nx-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Badge / plan pill ──────────────────────────────────────────────────── */
.nx-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
}
.nx-badge-indigo  { background: rgba(99,102,241,0.12); color: #818cf8; border: 1px solid rgba(99,102,241,0.2); }
.nx-badge-green   { background: rgba(34,197,94,0.12);  color: #86efac; border: 1px solid rgba(34,197,94,0.2); }
.nx-badge-amber   { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }
.nx-badge-red     { background: rgba(244,63,94,0.12);  color: #fca5a5; border: 1px solid rgba(244,63,94,0.2); }

/* ── Spinner ────────────────────────────────────────────────────────────── */
.nx-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--nx-border);
  border-top-color: var(--nx-indigo);
  border-radius: 50%;
  animation: nx-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes nx-spin { to { transform: rotate(360deg); } }

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar              { width: 6px; height: 6px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: #1e2a3a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover  { background: #334155; }
