/* ── Design tokens ───────────────────────────────────────────────────────── */
:root {
  --bg:     #0a0b0f;
  --bg2:    #111318;
  --bg3:    #181b22;
  --bg4:    #1e222b;
  --border:  rgba(255,255,255,0.06);
  --border2: rgba(255,255,255,0.10);
  --text:   #f0efe8;
  --muted:  #5a5a6a;
  --muted2: #8a8a9a;
  --purple: #7c6af7;
  --pl:     #a89ff9;
  --pl2:    rgba(124,106,247,0.15);
  --teal:   #2ecf9a;
  --teal2:  rgba(46,207,154,0.12);
  --amber:  #f5a623;
  --amber2: rgba(245,166,35,0.10);
  --coral:  #f06449;
  --coral2: rgba(240,100,73,0.10);
  --blue:   #378add;
  --blue2:  rgba(55,138,221,0.10);
  --green:  #4caf7d;
}

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

/* ── Base ────────────────────────────────────────────────────────────────── */
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Animation ───────────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Back link ───────────────────────────────────────────────────────────── */
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color .15s;
}
.back:hover { color: var(--text); }

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 14px;
}

/* ── Input ───────────────────────────────────────────────────────────────── */
.inp {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.inp:focus   { border-color: rgba(124,106,247,0.6); }
.inp::placeholder { color: var(--muted); }
.inp.error   { border-color: var(--coral); }

/* ── Primary button ──────────────────────────────────────────────────────── */
.btn {
  padding: 13px;
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:hover:not(:disabled) { background: var(--pl); color: #1a1a2e; }
.btn:disabled              { opacity: .6; cursor: not-allowed; }
.btn-full                  { width: 100%; }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

/* ── Feedback messages ───────────────────────────────────────────────────── */
.msg {
  font-size: 12px;
  text-align: center;
  margin-top: 12px;
  padding: 10px;
  border-radius: 8px;
  display: none;
  line-height: 1.4;
}
.msg.ok  { background: rgba(46,207,154,0.10);  color: var(--teal);  display: block; }
.msg.err { background: rgba(240,100,73,0.10);  color: var(--coral); display: block; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 13px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  z-index: 100;
}
.toast.on  { opacity: 1; }
.toast.ok  { border-color: rgba(46,207,154,.3);  color: var(--teal);  }
.toast.err { border-color: rgba(240,100,73,.3);   color: var(--coral); }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-bg.on { display: flex; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
}
