:root {
  --bg: #0b0d10;
  --bg-elev: #14171c;
  --bg-input: #1a1e24;
  --border: #2a2f37;
  --border-strong: #3a4049;
  --text: #e8eaed;
  --text-dim: #9aa1ac;
  --text-faint: #6b7280;
  --accent: #ffffff;
  --accent-hover: #f1f3f5;
  --danger: #ff6b6b;
  --warning: #ffb347;
  --success: #66dca8;
  --radius: 6px;
  --radius-lg: 10px;
  --maxw: 720px;
  --font: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
a:hover { text-decoration-color: var(--text); }

/* --- Top bar --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.2px;
  color: var(--text-dim);
}
.topbar-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
}
.progress { white-space: nowrap; }
.timer {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius);
  min-width: 60px;
  text-align: center;
}
.timer.warning { color: var(--warning); border-color: var(--warning); }
.timer.danger { color: var(--danger); border-color: var(--danger); }

/* --- Main app --- */
.app {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 24px 80px;
}
@media (max-width: 640px) {
  .app { padding: 24px 18px 60px; }
  .topbar { padding: 12px 18px; }
}

.boot { color: var(--text-faint); text-align: center; padding: 80px 0; }

/* --- Section content --- */
.section h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin: 0 0 8px;
}
.section h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 12px;
}
.section h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.section .lede {
  color: var(--text-dim);
  font-size: 16px;
  margin: 0 0 24px;
}
.section p { margin: 12px 0; }
.section ul, .section ol { margin: 12px 0; padding-left: 22px; }
.section li { margin-bottom: 6px; }
.section blockquote {
  border-left: 3px solid var(--border-strong);
  padding: 8px 16px;
  margin: 16px 0;
  color: var(--text-dim);
  background: var(--bg-elev);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.section code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg-elev);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.section pre {
  background: #0a0c0f;
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-x: auto;
  color: #d8dde4;
}
.section pre code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: inherit;
}
.section .callout {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  border-radius: var(--radius);
  margin: 16px 0;
  font-size: 14.5px;
}
.section .callout strong { color: var(--text); }

/* --- Form fields --- */
.field { display: flex; flex-direction: column; gap: 6px; margin: 16px 0; }
.field label { font-size: 14px; font-weight: 500; color: var(--text); }
.field .hint { font-size: 13px; color: var(--text-faint); margin: -2px 0 0; }
.field .err { font-size: 13px; color: var(--danger); margin: 4px 0 0; }
.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field input[type="url"],
.field select,
.field textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius);
  font: inherit;
  width: 100%;
  outline: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--text);
}
.field textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 540px) { .field-grid { grid-template-columns: 1fr; } }

/* Radio + checkbox grouped lists */
.choices { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.1s;
}
.choice:hover { border-color: var(--border-strong); }
.choice.selected { border-color: var(--text); background: #1f242a; }
.choice input { margin-top: 3px; accent-color: var(--text); }
.choice .label { font-size: 14.5px; }
.choice .sublabel { font-size: 13px; color: var(--text-dim); margin-top: 2px; }

/* Multi-select chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.chip.selected { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Drag-match (vocab quiz, funnel stages) */
.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}
.match-term {
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 13px;
}
.match-grid select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 10px;
  border-radius: var(--radius);
  font: inherit;
}

/* Rating row (1-5) */
.rating-row {
  display: flex; align-items: center; gap: 10px;
  margin: 8px 0 14px;
}
.rating-row .rating-label {
  flex: 1; font-size: 14.5px; color: var(--text);
}
.rating-scale { display: flex; gap: 6px; }
.rating-scale button {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  width: 34px; height: 34px;
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}
.rating-scale button:hover { border-color: var(--border-strong); }
.rating-scale button.selected { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Char count under textarea */
.char-count {
  font-size: 12px;
  color: var(--text-faint);
  text-align: right;
  margin-top: 2px;
  font-family: var(--mono);
}
.char-count.over { color: var(--danger); }

/* --- Buttons --- */
.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.btn {
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  padding: 12px 24px;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s;
}
.btn:hover:not(:disabled) { background: var(--accent-hover); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border);
}
.btn.ghost:hover:not(:disabled) {
  background: var(--bg-elev);
  color: var(--text);
}

/* --- Upload widget --- */
.upload {
  border: 1px dashed var(--border-strong);
  background: var(--bg-elev);
  padding: 18px;
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.1s;
}
.upload:hover { border-color: var(--text-dim); }
.upload input { display: none; }
.upload .upload-label { font-size: 14px; color: var(--text-dim); }
.upload .files { margin-top: 12px; font-size: 13px; color: var(--text); }
.upload .file-row {
  display: flex; justify-content: space-between;
  background: var(--bg-input);
  padding: 6px 10px;
  border-radius: 4px;
  margin: 4px 0;
  font-family: var(--mono);
  font-size: 12px;
}
.upload .file-row.uploading { color: var(--text-dim); }
.upload .file-row.error { color: var(--danger); }

/* --- Code highlight box (anti-cheat code reveal) --- */
.code-reveal {
  background: var(--bg-elev);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  margin: 24px 0;
}
.code-reveal .code {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 1px;
  margin: 8px 0;
}
.code-reveal .label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

/* --- Privacy + footer --- */
.footer {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
}
.footer-sep { margin: 0 8px; color: var(--border-strong); }

/* --- Accessibility helpers --- */
.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;
}

/* --- $500 bonus banner --- */
.bonus-banner {
  background: linear-gradient(135deg, #1a2f1f 0%, #0f2014 100%);
  border: 1px solid #2d5c3a;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin: 0 0 32px;
  position: relative;
  overflow: hidden;
}
.bonus-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--success) 50%, transparent 100%);
}
.bonus-amount {
  font-size: 24px;
  font-weight: 700;
  color: var(--success);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.bonus-sub {
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.55;
}
.bonus-sub strong { color: var(--success); }

/* Inline closing pitch block (section 9) */
.closing-pitch {
  background: var(--bg-elev);
  border-left: 3px solid var(--success);
  padding: 18px 22px;
  border-radius: var(--radius);
  margin: 24px 0;
  font-size: 15px;
  line-height: 1.6;
}
.closing-pitch strong { color: var(--text); }

/* --- Loading / toast --- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  z-index: 100;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  animation: toastIn 0.2s ease;
}
.toast.error { border-color: var(--danger); color: var(--danger); }
@keyframes toastIn {
  from { transform: translate(-50%, 10px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
