/* ═══════════════════════════════════════════
   MisaNet Dashboard v2 — Premium Dark Theme
   Direction: Linear × Vercel × Stripe
   ═══════════════════════════════════════════ */

:root {
  color-scheme: dark;
  /* palette */
  --bg: #05080f;
  --bg-elevated: #0a1019;
  --surface: rgba(12, 20, 35, 0.7);
  --surface-hover: rgba(18, 30, 52, 0.75);
  --surface-strong: rgba(10, 18, 32, 0.92);
  --border: rgba(255, 255, 255, 0.06);
  --border-subtle: rgba(255, 255, 255, 0.03);
  --border-accent: rgba(99, 102, 241, 0.3);

  --text-primary: #eef2ff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent: #818cf8;
  --accent-light: #a5b4fc;
  --accent-dim: rgba(129, 140, 248, 0.15);
  --accent-glow: rgba(99, 102, 241, 0.25);
  --success: #34d399;
  --success-dim: rgba(52, 211, 153, 0.15);
  --warning: #fbbf24;
  --warning-dim: rgba(251, 191, 36, 0.14);
  --danger: #f87171;
  --danger-dim: rgba(248, 113, 113, 0.14);

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-card: 0 1px 2px rgba(0,0,0,.3), 0 4px 24px rgba(0,0,0,.2);
  --shadow-elevated: 0 4px 6px rgba(0,0,0,.25), 0 16px 48px rgba(0,0,0,.22);
  --shadow-glow: 0 0 40px var(--accent-glow);

  --transition-fast: 150ms cubic-bezier(.4,0,.2,1);
  --transition-smooth: 250ms cubic-bezier(.4,0,.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(129, 140, 248, .2); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(129, 140, 248, .38); }

/* ═══════════════════════════════════
   AUTH PAGE — Login
   ═════════════════════════════════ */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* ambient orbs */
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}
.orb-1 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(99,102,241,.28), transparent 70%);
  top: -120px; right: -80px;
  animation: float-orb 12s ease-in-out infinite;
}
.orb-2 {
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(56,189,248,.18), transparent 70%);
  bottom: -60px; left: -60px;
  animation: float-orb 16s ease-in-out infinite reverse;
}
.orb-3 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(167,139,250,.14), transparent 70%);
  top: 40%; left: 30%;
  animation: float-orb 20s ease-in-out infinite;
}

@keyframes float-orb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -20px) scale(1.06); }
  66% { transform: translate(-15px, 15px) scale(0.96); }
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(99,102,241,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 70%);
}

.auth-shell {
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
}

.auth-card {
  background: var(--surface-strong);
  backdrop-filter: blur(40px) saturate(1.4);
  -webkit-backdrop-filter: blur(40px) saturate(1.4);
  border: 1px solid var(--border);
  border-top-color: rgba(129,140,248,.12);
  border-radius: var(--radius-xl);
  padding: 36px 28px 28px;
  box-shadow: var(--shadow-elevated), 0 0 0 1px rgba(255,255,255,.02) inset;
  animation: card-enter .5s cubic-bezier(.16,1,.3,1) both;
}

@keyframes card-enter {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-brand { text-align: center; margin-bottom: 28px; }
.brand-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  box-shadow: 0 8px 24px rgba(99,102,241,.32);
  margin-bottom: 18px;
}
.auth-brand h1 {
  font-size: 21px; font-weight: 700; letter-spacing: -.02em;
  line-height: 1.25; margin-bottom: 6px;
}
.auth-brand p {
  font-size: 13.5px; color: var(--text-secondary); line-height: 1.6;
}

/* form */
.auth-form { display: flex; flex-direction: column; gap: 16px; }

.field-group label {
  display: block;
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted); margin-bottom: 7px;
}

.input-wrap {
  position: relative;
  display: flex; align-items: center;
}

.input-icon {
  position: absolute; left: 13px; color: var(--text-muted);
  pointer-events: none; transition: color var(--transition-fast);
  display: flex; align-items: center;
}
.input-wrap:focus-within .input-icon { color: var(--accent); }

.input-wrap input {
  width: 100%; height: 48px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(5, 11, 22, .65);
  color: var(--text-primary);
  font-family: var(--font-mono); font-size: 15px;
  letter-spacing: .04em;
  outline: none;
  transition: all var(--transition-fast);
}
.input-wrap input::placeholder { color: var(--text-muted); opacity: .55; }
.input-wrap input:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--accent-dim), var(--shadow-glow);
  background: rgba(5, 11, 22, .82);
}

.btn-primary {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 4px 16px rgba(99,102,241,.3), 0 0 0 1px rgba(129,140,248,.15) inset;
  transition: all var(--transition-fast);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(99,102,244,.4), 0 0 0 1px rgba(129,140,248,.2) inset;
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: .65; cursor: not-allowed; }

.hidden { display: none !important; }
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-banner {
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 13px;
  background: var(--danger-dim);
  border: 1px solid rgba(248,113,113,.2);
  color: var(--danger);
  animation: shake .4s ease-in-out;
}
@keyframes shake {
  0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)}
}

.auth-footer {
  margin-top: 22px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: .02em;
}

@media (max-width:480px) {
  .auth-card { padding: 24px 18px 20px; border-radius: var(--radius-lg); }
  .brand-icon { width: 44px; height: 44px; margin-bottom: 14px; }
  .auth-brand h1 { font-size: 18px; letter-spacing: -.01em; margin-bottom: 4px; }
  .auth-brand p { font-size: 12.5px; }
  .auth-form { gap: 13px; }
  .input-wrap input { height: 44px; font-size: 14px; }
  .btn-primary { height: 44px; font-size: 13px; }
  .auth-footer { margin-top: 16px; font-size: 11px; }
}

@media (max-width:360px) {
  .auth-card { padding: 20px 15px 18px; border-radius: var(--radius-md); margin: 10px; width: calc(100% - 20px); }
  .brand-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); }
  .auth-brand h1 { font-size: 17px; }
}

/* ═══════════════════════════════════
   DASHBOARD SHELL
   ═════════════════════════════════ */

.dashboard-shell {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(99,102,241,.07) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, #070c17 100%);
  position: relative;
}
.dashboard-shell::before {
  content: '';
  position: fixed; top: 0; left: 0; right: 0;
  height: 1px; background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
}

/* shared components used by both pages */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
