/* ═══════════════════════════════════════════════════════════════
   SALES ONBOARDING  —  onboarding.css
   First-run guided setup wizard for BOSRAI. Cream design system
   (oklch + IBM Plex + Instrument Serif) — matches css/styles.css :root.
   All colors pull from the shared tokens so it stays in sync.
═══════════════════════════════════════════════════════════════ */

#salesOnboarding {
  position: fixed; inset: 0; z-index: 4000;
  display: flex; align-items: stretch;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  animation: so-fade 0.25s ease;
}
#salesOnboarding.hidden { display: none; }
@keyframes so-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes so-slide { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Left rail: step progress ───────────────────────────── */
.so-rail {
  width: 300px; flex: 0 0 300px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 40px 32px;
  display: flex; flex-direction: column;
}
.so-brand {
  font-family: var(--font-mono);
  font-size: 13px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--text3); margin-bottom: 6px;
}
.so-brand b { color: var(--accent); font-weight: 600; }
.so-rail-title {
  font-family: var(--font-serif);
  font-size: 30px; line-height: 1.1; color: var(--text);
  margin-bottom: 36px;
}
.so-steps { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.so-step {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-md);
  font-size: 14px; color: var(--text3);
  transition: background 0.15s, color 0.15s;
}
.so-step .so-dot {
  width: 22px; height: 22px; flex: 0 0 22px;
  border-radius: 50%; border: 1.5px solid var(--border2);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--text3);
  background: var(--bg);
}
.so-step.active { background: var(--accent-wash); color: var(--accent-ink); font-weight: 500; }
.so-step.active .so-dot { border-color: var(--accent); color: var(--accent); }
.so-step.done { color: var(--text2); }
.so-step.done .so-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.so-rail-foot { margin-top: auto; font-size: 12px; color: var(--text3); }
.so-rail-foot a { color: var(--text3); text-decoration: underline; cursor: pointer; }

/* ── Right: content panel ───────────────────────────────── */
.so-panel {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center;
  padding: 56px 40px;
}
.so-content { width: 100%; max-width: 560px; animation: so-slide 0.3s ease; }
.so-eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent-ink); margin-bottom: 12px;
}
.so-h1 { font-family: var(--font-serif); font-size: 40px; line-height: 1.08; margin-bottom: 14px; }
.so-sub { font-size: 16px; line-height: 1.5; color: var(--text2); margin-bottom: 32px; }

/* tour cards */
.so-tour { display: grid; gap: 12px; margin-bottom: 32px; }
.so-tour-card {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.so-tour-ic { font-size: 22px; line-height: 1; }
.so-tour-card h4 { font-size: 14px; margin-bottom: 3px; }
.so-tour-card p { font-size: 13px; color: var(--text2); line-height: 1.45; }

/* forms */
.so-field { margin-bottom: 18px; }
.so-field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.so-field .so-hint { font-size: 12px; color: var(--text3); margin-top: 5px; }
.so-input, .so-textarea, .so-select {
  width: 100%; padding: 11px 13px;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--radius-md); font-family: var(--font-sans);
  font-size: 14px; color: var(--text);
}
.so-input:focus, .so-textarea:focus, .so-select:focus { outline: none; border-color: var(--accent); }
.so-textarea { resize: vertical; min-height: 72px; }
.so-row { display: flex; gap: 12px; }
.so-row > * { flex: 1; }

/* chips */
.so-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.so-chip {
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  background: var(--bg2); border: 1px solid var(--border2);
  font-size: 13px; color: var(--text2); user-select: none;
}
.so-chip.on { background: var(--accent-wash); border-color: var(--accent); color: var(--accent-ink); font-weight: 500; }

/* option cards (mailbox, goal) */
.so-options { display: grid; gap: 12px; }
.so-opt {
  display: flex; gap: 14px; align-items: flex-start; text-align: left;
  padding: 16px 18px; background: var(--bg2);
  border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  cursor: pointer; width: 100%; font-family: inherit; color: var(--text);
}
.so-opt:hover { border-color: var(--border2); }
.so-opt.on { border-color: var(--accent); background: var(--accent-wash); }
.so-opt-ic { font-size: 22px; }
.so-opt h4 { font-size: 14px; margin-bottom: 3px; }
.so-opt p { font-size: 13px; color: var(--text2); line-height: 1.45; }
.so-opt .so-badge { margin-left: auto; align-self: center; }

.so-badge {
  font-family: var(--font-mono); font-size: 11px; padding: 3px 8px;
  border-radius: 999px; background: var(--bg3); color: var(--text3);
}
.so-badge.ok { background: var(--accent-wash); color: var(--accent-ink); }

/* status / connected card */
.so-status {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-lg);
  background: var(--accent-wash); border: 1px solid var(--accent);
  color: var(--accent-ink); font-size: 14px; margin-bottom: 18px;
}
.so-status .so-spin {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--accent); border-top-color: transparent;
  animation: so-rot 0.8s linear infinite;
}
@keyframes so-rot { to { transform: rotate(360deg); } }

/* cadence preview */
.so-preview { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 4px 0; margin-bottom: 24px; }
.so-preview-step { padding: 12px 18px; border-bottom: 1px solid var(--hair-2); }
.so-preview-step:last-child { border-bottom: none; }
.so-preview-step .so-when { font-family: var(--font-mono); font-size: 11px; color: var(--text3); text-transform: uppercase; }
.so-preview-step .so-subj { font-size: 14px; font-weight: 500; margin-top: 2px; }

/* footer actions */
.so-actions { display: flex; gap: 12px; align-items: center; margin-top: 32px; }
.so-btn {
  padding: 11px 22px; border-radius: var(--radius-md); cursor: pointer;
  font-family: var(--font-sans); font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
}
.so-btn-primary { background: var(--accent); color: #fff; }
.so-btn-primary:hover { background: var(--accent-hover); }
.so-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.so-btn-ghost { background: transparent; border-color: var(--border2); color: var(--text2); }
.so-btn-ghost:hover { background: var(--bg3); }
.so-actions .so-skip { margin-left: auto; font-size: 13px; color: var(--text3); cursor: pointer; background: none; border: none; }
.so-actions .so-skip:hover { color: var(--text2); text-decoration: underline; }
.so-err { color: var(--red); font-size: 13px; margin-top: 12px; }

/* upgrade nudge */
.so-nudge {
  margin-top: 18px; padding: 14px 16px; border-radius: var(--radius-lg);
  background: var(--bg2); border: 1px dashed var(--border2);
  font-size: 13px; color: var(--text2);
}
.so-nudge a { color: var(--accent-ink); font-weight: 500; cursor: pointer; }

/* ═══ Persistent quest checklist (Lead Gen) ═══════════════ */
.bq-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px; margin: 4px 0 18px;
  font-family: var(--font-sans); color: var(--text);
}
.bq-head { display: flex; align-items: flex-start; justify-content: space-between; }
.bq-h { font-family: var(--font-serif); font-size: 22px; line-height: 1.1; }
.bq-sub { font-size: 13px; color: var(--text3); margin-top: 2px; }
.bq-dismiss { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 14px; padding: 4px; }
.bq-dismiss:hover { color: var(--text); }
.bq-bar { height: 5px; background: var(--bg3); border-radius: 999px; margin: 14px 0 16px; overflow: hidden; }
.bq-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s; }
.bq-items { display: grid; gap: 8px; }
.bq-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg);
}
.bq-item.done { opacity: 0.65; }
.bq-check {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%;
  border: 1.5px solid var(--border2); display: grid; place-items: center;
  font-size: 12px; color: #fff;
}
.bq-item.done .bq-check { background: var(--accent); border-color: var(--accent); }
.bq-body { flex: 1; }
.bq-title { font-size: 14px; font-weight: 500; }
.bq-desc { font-size: 12px; color: var(--text3); }
.bq-go {
  padding: 7px 16px; border-radius: var(--radius-md); border: 1px solid var(--accent);
  background: var(--accent); color: #fff; font-family: var(--font-sans);
  font-size: 13px; font-weight: 500; cursor: pointer;
}
.bq-go:hover { background: var(--accent-hover); }
.bq-tag { font-family: var(--font-mono); font-size: 11px; color: var(--accent-ink); background: var(--accent-wash); padding: 3px 9px; border-radius: 999px; }
.bq-optional { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bq-optlabel { font-size: 12px; color: var(--text3); }
.bq-chip { font-size: 12px; padding: 5px 11px; border-radius: 999px; background: var(--bg3); color: var(--text2); border: 1px solid var(--border); }
.bq-chip.on { background: var(--accent-wash); color: var(--accent-ink); border-color: var(--accent); }
.bq-chip-btn { cursor: pointer; font-family: var(--font-sans); color: var(--accent-ink); border-color: var(--accent); background: var(--bg2); }
.bq-chip-btn:hover { background: var(--accent-wash); }

@media (max-width: 760px) {
  #salesOnboarding { flex-direction: column; }
  .so-rail { width: auto; flex: none; padding: 24px; }
  .so-rail-title { margin-bottom: 16px; font-size: 24px; }
  .so-steps { flex-direction: row; flex-wrap: wrap; }
  .so-step .so-lbl { display: none; }
  .so-panel { padding: 32px 24px; }
}
