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

/* ── Variables ─────────────────────────────────────────────────────── */
:root {
  --bg:        #07070f;
  --bg2:       #0d0d1a;
  --bg3:       #12121f;
  --border:    #1c1c2e;
  --border2:   #252538;
  --green:     #7fff6e;
  --green-dim: #7fff6e22;
  --green-mid: #7fff6e66;
  --text:      #e8e8f0;
  --text2:     #9090a8;
  --text3:     #55556a;
  --red:       #ff5f5f;
  --yellow:    #ffc93c;
  --mono:      'JetBrains Mono', monospace;
  --sans:      'DM Sans', sans-serif;
  --dmono:     'DM Mono', monospace;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow:    0 8px 32px #00000066;
}

/* ── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
}
img { display: block; max-width: 100%; }

/* ── Logo ──────────────────────────────────────────────────────────── */
.logo {
  display: flex;
  align-items: center;
  gap: 3px;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.5px;
  color: var(--text);
  user-select: none;
}
.logo span { color: var(--green); }
.logo-cursor {
  width: 2px;
  height: 20px;
  background: var(--green);
  animation: blink 1s step-end infinite;
  margin-left: 1px;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--green);
  color: var(--bg);
}
.btn-primary:hover { background: #9effa0; transform: translateY(-1px); box-shadow: 0 4px 20px #7fff6e33; }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { border-color: var(--border2); color: var(--text); background: var(--bg3); }
.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid #ff5f5f33;
}
.btn-danger:hover { background: #ff5f5f11; }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 14px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }
.btn-loading { position: relative; color: transparent !important; }
.btn-loading::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  color: var(--bg);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Form elements ─────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--dmono);
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 14px;
  transition: border-color 0.15s;
  gap: 10px;
}
.input-wrap:focus-within { border-color: var(--green-mid); }
.input-wrap input {
  flex: 1;
  padding: 12px 0;
  font-size: 14px;
  color: var(--text);
  background: transparent;
}
.input-wrap input::placeholder { color: var(--text3); }
.input-wrap .prefix {
  font-family: var(--dmono);
  font-size: 13px;
  color: var(--text3);
}
.field-error { font-size: 12px; color: var(--red); font-family: var(--dmono); }

/* ── Cards ─────────────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* ── Badge ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-family: var(--dmono);
  font-size: 11px;
  font-weight: 500;
}
.badge-green  { background: var(--green-dim); color: var(--green); border: 1px solid #7fff6e33; }
.badge-yellow { background: #ffc93c18; color: var(--yellow); border: 1px solid #ffc93c33; }
.badge-red    { background: #ff5f5f18; color: var(--red);    border: 1px solid #ff5f5f33; }
.badge-gray   { background: var(--bg3); color: var(--text3); border: 1px solid var(--border); }

/* ── Toast ─────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: slideUp 0.2s ease;
  max-width: 320px;
}
.toast.success { border-color: #7fff6e44; }
.toast.error   { border-color: #ff5f5f44; }
.toast-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.toast.success .toast-dot { background: var(--green); }
.toast.error   .toast-dot { background: var(--red); }
@keyframes slideUp { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

/* ── Modal ─────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: #00000099;
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  transform: translateY(16px);
  transition: transform 0.2s;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-family: var(--mono); font-weight: 700; font-size: 16px; }
.modal-close { color: var(--text3); font-size: 20px; line-height: 1; padding: 4px; }
.modal-close:hover { color: var(--text); }

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

/* ── Noise overlay ─────────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  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)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9998;
  opacity: 0.4;
}

/* ── Utilities ─────────────────────────────────────────────────────── */
.text-green  { color: var(--green); }
.text-muted  { color: var(--text2); }
.text-dim    { color: var(--text3); }
.text-mono   { font-family: var(--mono); }
.text-dmono  { font-family: var(--dmono); }
.hidden      { display: none !important; }
.divider     { height: 1px; background: var(--border); margin: 24px 0; }
