/* ============================================
   Mind The Bug — Global Design System 2026
   Aesthetic: Dark Neon-Brutalist / Quantum Glass
============================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=JetBrains+Mono:wght@300;400;500&display=swap');

:root {
  /* Core palette */
  --bg-void:       #04050a;
  --bg-surface:    #090b14;
  --bg-raised:     #0e1220;
  --bg-glass:      rgba(14, 18, 32, 0.7);
  --bg-card:       rgba(20, 26, 48, 0.85);

  /* Neon accents */
  --neon-cyan:     #00e5ff;
  --neon-violet:   #b44dff;
  --neon-green:    #00ff88;
  --neon-amber:    #ffb800;
  --neon-red:      #ff3d57;

  /* Primary brand */
  --brand:         #00e5ff;
  --brand-dim:     rgba(0, 229, 255, 0.15);
  --brand-glow:    0 0 24px rgba(0, 229, 255, 0.4);

  /* Text */
  --text-primary:  #e8eaf6;
  --text-secondary:#8892b0;
  --text-muted:    #4a5568;
  --text-accent:   #00e5ff;

  /* Borders */
  --border:        rgba(0, 229, 255, 0.12);
  --border-hover:  rgba(0, 229, 255, 0.35);
  --border-active: rgba(0, 229, 255, 0.7);

  /* Radii */
  --r-sm:   10px;
  --r-md:   16px;
  --r-lg:   24px;
  --r-xl:   32px;
  --r-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Semantic aliases used throughout */
  --surface:    var(--bg-raised);
}

/* ---- Light mode overrides ---- */
[data-theme="light"] {
  --bg-void:       #f0f4ff;
  --bg-surface:    #ffffff;
  --bg-raised:     #e8edf8;
  --bg-glass:      rgba(255, 255, 255, 0.8);
  --bg-card:       rgba(255, 255, 255, 0.95);
  --neon-cyan:     #006bbd;
  --neon-violet:   #7c3aed;
  --neon-green:    #16a34a;
  --neon-amber:    #d97706;
  --neon-red:      #dc2626;
  --brand:         #006bbd;
  --brand-dim:     rgba(0, 107, 189, 0.1);
  --brand-glow:    0 0 24px rgba(0, 107, 189, 0.25);
  --text-primary:  #0f1729;
  --text-secondary:#374151;
  --text-muted:    #6b7280;
  --text-accent:   #006bbd;
  --border:        rgba(0, 107, 189, 0.15);
  --border-hover:  rgba(0, 107, 189, 0.4);
  --border-active: rgba(0, 107, 189, 0.7);
}
[data-theme="light"] .grid-overlay {
  background-image:
    linear-gradient(rgba(0,107,189,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,107,189,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}
[data-theme="light"] .noise-overlay { opacity: 0.015; }
[data-theme="light"] .nav { background: rgba(240,244,255,0.85); }

/* ---- Theme toggle button ---- */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: var(--r-full);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--border-hover); background: var(--brand-dim); }

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-void);
  color: var(--text-primary);
  font-family: 'Syne', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Overlays ---- */
.grid-overlay {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,229,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.noise-overlay {
  position: fixed;
  inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 40px;
  background: rgba(4, 5, 10, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-icon {
  width: 22px;
  height: 22px;
  display: block;
  filter: drop-shadow(0 0 6px var(--neon-cyan));
}
.card-logo .brand-icon {
  width: 20px;
  height: 20px;
}

.brand-name {
  letter-spacing: 0.18em;
}

.nav-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

.nav-btn-ghost {
  padding: 8px 20px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  transition: all 0.25s var(--ease-out);
}

.nav-btn-ghost:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--brand-dim);
}

.nav-btn-primary {
  padding: 8px 22px;
  border-radius: var(--r-full);
  background: var(--neon-cyan);
  color: var(--bg-void);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: all 0.25s var(--ease-out);
}

.nav-btn-primary:hover {
  box-shadow: var(--brand-glow);
  transform: translateY(-1px);
}

/* ---- Form Card (shared) ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 20px 40px;
  position: relative;
  z-index: 1;
}

.auth-bg-glow {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(0,229,255,0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 44px 48px;
  width: 100%;
  max-width: 480px;
  position: relative;
  backdrop-filter: blur(24px);
  box-shadow:
    0 0 0 1px rgba(0,229,255,0.05),
    0 32px 80px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255,255,255,0.05);
  animation: cardIn 0.5s var(--ease-out) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  border-radius: var(--r-full);
}

.card-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  margin-bottom: 32px;
}

.card-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.2;
}

.card-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 300;
}

/* ---- Form Elements ---- */
.form-group {
  margin-bottom: 18px;
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  background: rgba(9, 11, 20, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 13px 16px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  transition: all 0.25s var(--ease-out);
  outline: none;
  -webkit-appearance: none;
}

.form-input:focus {
  border-color: var(--border-active);
  background: rgba(0, 229, 255, 0.04);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1), var(--brand-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input.error {
  border-color: var(--neon-red);
  box-shadow: 0 0 0 3px rgba(255, 61, 87, 0.12);
}

.form-input.success {
  border-color: var(--neon-green);
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  transition: color 0.2s;
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
}

.input-icon:hover { color: var(--neon-cyan); }

.field-error {
  font-size: 0.78rem;
  color: var(--neon-red);
  margin-top: 5px;
  font-family: 'JetBrains Mono', monospace;
  display: none;
}

.field-error.visible { display: block; }

/* ---- Buttons ---- */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--neon-cyan);
  color: var(--bg-void);
  border: none;
  border-radius: var(--r-md);
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  box-shadow: var(--brand-glow);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

.btn-ghost {
  width: 100%;
  padding: 13px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: 'Syne', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}

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

/* ---- Divider ---- */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  font-family: 'JetBrains Mono', monospace;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- Links ---- */
.auth-link {
  color: var(--neon-cyan);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s;
}

.auth-link:hover { opacity: 0.75; text-decoration: underline; }

.card-footer-text {
  text-align: center;
  margin-top: 24px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ---- Alert boxes ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 0.85rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
}

.alert-error {
  background: rgba(255, 61, 87, 0.1);
  border: 1px solid rgba(255, 61, 87, 0.3);
  color: #ff8a9a;
}

.alert-success {
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  color: #80ffbb;
}

.alert-info {
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  color: #80f0ff;
}

.alert-warning {
  background: rgba(255, 184, 0, 0.08);
  border: 1px solid rgba(255, 184, 0, 0.25);
  color: #ffd966;
}

/* ---- Strength Meter ---- */
.strength-bar {
  height: 4px;
  background: var(--bg-raised);
  border-radius: var(--r-full);
  margin-top: 8px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.4s var(--ease-out), background 0.4s;
  width: 0%;
}

.strength-label {
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 4px;
  color: var(--text-muted);
}

/* ---- Checkbox ---- */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--neon-cyan);
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-label {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---- Pulse dot ---- */
.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

/* ---- Utility ---- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-void); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ---- Mobile ---- */
@media (max-width: 768px) {
  .nav { padding: 14px 20px; }
  .nav-brand .brand-name { font-size: 1rem; }
  .nav-links { gap: 8px; }
  .nav-btn-ghost, .nav-btn-primary { padding: 7px 14px; font-size: 0.8rem; }
  .nav-hint { display: none; }

  .auth-page { padding: 80px 16px 32px; }
  .auth-card { padding: 28px 20px; border-radius: var(--r-lg); }
  .auth-card-wide { max-width: 100%; }
  .card-title { font-size: 1.4rem; }
  .name-grid { grid-template-columns: 1fr; }

  .otp-group-lg { gap: 6px; }
  .otp-digit-lg { width: 44px; height: 54px; font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .nav-links .nav-btn-ghost { display: none; }
  .auth-card { padding: 24px 16px; }
  .card-title { font-size: 1.25rem; }
  .card-logo { margin-bottom: 20px; }
  .steps { gap: 4px; }
  .mfa-method-card { padding: 12px; }
  .backup-grid { grid-template-columns: 1fr 1fr; }
  .theme-toggle { width: 30px; height: 30px; font-size: 14px; }
  .notif-panel { width: min(320px, 92vw); right: -60px; }
}
