/* ── Night Work — ZK Task Marketplace ──────────────────────── */
:root {
  --bg:      #050308;
  --surface: #0d0a1a;
  --raised:  #120f20;
  --depth:   #080511;
  --ink:     #7c3aed;
  --glow:    #a78bfa;
  --plasma:  #c084fc;
  --green:   #00d68f;
  --red:     #ef4444;
  --gold:    #f5c518;
  --cyan:    #06b6d4;
  --rim:     rgba(255,255,255,.07);
  --rim2:    rgba(255,255,255,.12);
  --text:    #f1f0f5;
  --text2:   #9ca3af;
  --muted:   #4b5563;
  --faint:   #374151;
  --sans:    'Inter', system-ui, sans-serif;
  --mono:    'JetBrains Mono', 'Fira Code', monospace;
  --serif:   'Playfair Display', Georgia, serif;
}

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

body { background: var(--bg); color: var(--text); font-family: var(--sans); min-height: 100vh; overflow-x: hidden; }

nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5,3,8,.92); border-bottom: 1px solid var(--rim);
  backdrop-filter: blur(16px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 56px;
}
.nav-logo { font-family: var(--serif); font-size: 20px; font-style: italic; cursor: pointer; }
.nav-logo span { color: var(--cyan); }
.nav-right { display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 700; font-family: var(--sans);
  border: 1px solid transparent; cursor: pointer; transition: all .18s;
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #6d28d9; }
.btn-ghost { background: transparent; color: var(--text2); border-color: var(--rim2); }
.btn-ghost:hover { color: var(--text); border-color: var(--glow); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }
.btn-cyan { background: var(--cyan); color: #000; border-color: var(--cyan); }
.btn-cyan:hover { opacity: .9; }
.btn-green { background: var(--green); color: #000; border-color: var(--green); }
.btn-green:hover { opacity: .9; }

.page-inner { max-width: 1000px; margin: 0 auto; padding: 40px 24px; }

.hero { text-align: center; margin-bottom: 40px; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; font-family: var(--mono);
  background: rgba(6,182,212,.08); color: var(--cyan);
  border: 1px solid rgba(6,182,212,.2);
  padding: 4px 12px; border-radius: 20px;
  margin-bottom: 18px; letter-spacing: .05em;
}
.hero h1 { font-family: var(--serif); font-size: clamp(36px,5vw,60px); font-style: italic; line-height: 1.05; margin-bottom: 14px; }
.hero h1 em { color: var(--cyan); }
.hero p { font-size: 15px; color: var(--text2); max-width: 500px; margin: 0 auto 24px; line-height: 1.8; font-weight: 300; }
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.stats-strip {
  display: grid; grid-template-columns: repeat(4,1fr);
  background: var(--surface); border: 1px solid var(--rim);
  border-radius: 14px; overflow: hidden; margin-bottom: 28px;
}
.stat-cell { padding: 14px 10px; text-align: center; border-right: 1px solid var(--rim); }
.stat-cell:last-child { border-right: none; }
.stat-val { font-size: 18px; font-weight: 800; letter-spacing: -.03em; font-family: var(--mono); }
.stat-lbl { font-size: 9px; color: var(--muted); font-family: var(--mono); text-transform: uppercase; letter-spacing: 1px; margin-top: 3px; }

.tabs-bar {
  display: flex; gap: 4px; background: var(--surface);
  border: 1px solid var(--rim); border-radius: 14px;
  padding: 6px; margin-bottom: 24px;
}
.tab {
  flex: 1; text-align: center; padding: 9px 12px;
  font-size: 12px; font-weight: 700; border-radius: 10px;
  cursor: pointer; color: var(--muted); transition: all .15s;
}
.tab:hover { color: var(--text2); }
.tab.active { background: var(--raised); color: var(--text); border: 1px solid var(--rim2); }

/* ── Task cards ───────────────────────────────────────────────── */
.nw-tasks { display: flex; flex-direction: column; gap: 12px; margin-bottom: 32px; }
.nw-task {
  display: grid; grid-template-columns: 48px 1fr auto auto;
  align-items: start; gap: 14px;
  background: var(--surface); border: 1px solid var(--rim);
  border-radius: 14px; padding: 16px 20px;
  transition: border-color .2s;
}
.nw-task:hover { border-color: var(--rim2); }
.nw-task.accepted { border-color: rgba(6,182,212,.3); background: rgba(6,182,212,.03); }
.nw-task.submitted { border-color: rgba(0,214,143,.3); background: rgba(0,214,143,.03); }
.nw-task-icon { font-size: 28px; padding-top: 2px; }
.nw-task-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.nw-task-meta { font-size: 11px; color: var(--text2); margin-bottom: 4px; }
.nw-task-agent { font-size: 10px; font-family: var(--mono); color: var(--muted); }
.nw-task-reward {
  font-size: 16px; font-weight: 800; font-family: var(--mono);
  color: var(--gold); white-space: nowrap; padding-top: 2px;
}
.nw-task-btn {
  padding: 8px 16px; border-radius: 8px; font-size: 12px; font-weight: 700;
  background: var(--ink); color: #fff; border: none; cursor: pointer;
  white-space: nowrap; align-self: start; transition: background .15s;
}
.nw-task-btn:hover { background: #6d28d9; }
.nw-task-btn.submitted { background: var(--green); color: #000; }
.nw-task-btn:disabled { opacity: .4; cursor: default; }
.nw-task-proof {
  grid-column: 2 / -1;
  font-size: 11px; font-family: var(--mono);
  color: var(--cyan); margin-top: 8px; display: none;
}
.nw-task-proof.show { display: block; }

/* ── Submit proof form ────────────────────────────────────────── */
.proof-form {
  grid-column: 2 / -1; margin-top: 10px;
  padding: 14px; background: var(--raised);
  border: 1px solid rgba(6,182,212,.2); border-radius: 10px;
}
.proof-form textarea {
  width: 100%; background: var(--depth); border: 1px solid var(--rim2);
  color: var(--text); border-radius: 8px; padding: 10px;
  font-size: 12px; font-family: var(--mono); resize: vertical; min-height: 60px;
  margin-bottom: 8px; outline: none;
}

/* ── Post task form ───────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--rim);
  border-radius: 18px; padding: 24px; margin-bottom: 16px;
}
.card-title { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.card-sub { font-size: 13px; color: var(--text2); margin-bottom: 20px; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.label { font-size: 10px; font-weight: 700; font-family: var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.input {
  background: var(--raised); border: 1px solid var(--rim2);
  color: var(--text); border-radius: 10px; padding: 10px 14px;
  font-size: 13px; font-family: var(--sans); outline: none; width: 100%;
  transition: border-color .15s;
}
.input:focus { border-color: var(--glow); }

/* ── Circuit log ─────────────────────────────────────────────── */
.circuit-log {
  background: var(--depth); border: 1px solid var(--rim);
  border-radius: 12px; padding: 16px; margin-top: 16px;
  font-size: 12px; font-family: var(--mono); color: var(--text2);
  display: flex; flex-direction: column; gap: 6px;
}
.ct-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.ct-dot.wait { background: var(--faint); }
.ct-dot.active { background: var(--cyan); animation: pulse 1s infinite; }
.ct-dot.done { background: var(--green); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ── How it works ────────────────────────────────────────────── */
.how-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr));
  gap: 16px; text-align: center; margin-top: 20px;
}
.how-step { padding: 8px; }
.how-icon { font-size: 30px; margin-bottom: 10px; }
.how-title { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.how-desc { font-size: 12px; color: var(--text2); line-height: 1.6; }

/* ── Toast ───────────────────────────────────────────────────── */
#toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 18px; border-radius: 12px; font-size: 13px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--rim2);
  animation: slideIn .2s ease; max-width: 320px;
}
.toast.success { border-color: rgba(0,214,143,.4); color: var(--green); }
.toast.error   { border-color: rgba(239,68,68,.4);  color: #f87171; }
.toast.info    { border-color: rgba(6,182,212,.4);  color: var(--cyan); }
@keyframes slideIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

/* ── Overlay / Modal ─────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.overlay.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--rim2);
  border-radius: 20px; padding: 32px; max-width: 420px; width: 100%;
  position: relative;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: transparent; border: none; color: var(--muted);
  font-size: 18px; cursor: pointer;
}
.wc-icon { font-size: 40px; text-align: center; margin-bottom: 12px; }
.wc-title { font-family: var(--serif); font-size: 24px; font-style: italic; text-align: center; margin-bottom: 8px; }
.wc-sub { font-size: 13px; color: var(--text2); text-align: center; margin-bottom: 20px; line-height: 1.6; }

@media(max-width:640px) {
  .form-grid { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .nw-task { grid-template-columns: 36px 1fr; }
  .nw-task-reward, .nw-task-btn { grid-column: 2; }
}
