/* ═══ SHARED ONBOARDING OVERLAY ═══
   Same visual pattern as BM Voice's onboarding (first tool to have
   one) — reused here for BM Words, BM Career, and Better Me so a
   student sees a consistent style across every tool. Relies on the
   --navy/--white/--muted/--serif/--sans variables already provided by
   css/design-tokens.css, which every ai-lab page already links. */
.onboard-overlay {
  position: fixed; inset: 0;
  background: rgba(17,27,62,.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000; padding: 1.25rem;
  animation: obFadeIn .3s ease;
}
@keyframes obFadeIn { from{opacity:0} to{opacity:1} }
.onboard-box {
  background: var(--white); border-radius: 22px;
  padding: 2rem 2rem 1.75rem;
  width: 100%; max-width: 420px;
  box-shadow: 0 24px 64px rgba(28,43,94,.3);
  animation: obSlideUp .3s ease;
}
@keyframes obSlideUp { from{transform:translateY(20px);opacity:0} to{transform:translateY(0);opacity:1} }
.ob-logo { height: 36px; margin-bottom: 1.1rem; }
.ob-title { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; color: var(--navy); margin-bottom: .3rem; }
.ob-sub { font-size: .84rem; color: var(--muted); margin-bottom: 1.5rem; line-height: 1.6; }
.ob-steps { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.6rem; }
.ob-step { display: flex; align-items: flex-start; gap: .85rem; }
.ob-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--navy); color: var(--white);
  font-family: var(--serif); font-size: 1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ob-step-body { flex: 1; padding-top: 4px; }
.ob-step-title { font-size: .88rem; font-weight: 700; color: var(--navy); margin-bottom: 2px; }
.ob-step-desc { font-size: .79rem; color: var(--muted); line-height: 1.55; }
.ob-btn {
  width: 100%; padding: .85rem; background: var(--navy); color: var(--white);
  border: none; border-radius: 30px; font-size: .92rem; font-weight: 700;
  cursor: pointer; font-family: var(--sans); transition: filter .2s;
}
.ob-btn:hover { filter: brightness(1.1); }
.ob-skip {
  display: block; text-align: center; margin-top: .6rem;
  font-size: .76rem; color: var(--muted); cursor: pointer;
  background: none; border: none; font-family: var(--sans); width: 100%;
}
.ob-skip:hover { color: var(--navy); }

/* ═══ ONBOARDING MINI-ANIMATIONS ═══
   Small self-contained "scenes" (56x56px) replacing the plain numbered
   circle — each mimics the actual action of its step (tap a card,
   speak, listen, type, save, upload, scan, score, check in, tick a
   checklist, grow a chart). Deliberately NOT tied to any real element
   on the page (no coordinates, no selectors into the live UI) — this
   is Option B from the earlier design discussion: less flashy than a
   full product-tour-style spotlight, but immune to breaking whenever
   the real page's layout changes later. */
.ob-scene {
  width: 52px; height: 52px; border-radius: 14px;
  background: rgba(28,43,94,.055);
  display: flex; align-items: center; justify-content: center;
  position: relative; flex-shrink: 0; overflow: hidden;
}

/* 1. Tap/select — cursor taps a mock card, ripple pulses out */
.ob-scene.tap .tap-card { width: 28px; height: 20px; background: #fff; border: 1.5px solid var(--beige-dk, #D8D0C4); border-radius: 5px; }
.ob-scene.tap .tap-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--navy); animation: obTapMove 1.6s ease-in-out infinite; }
.ob-scene.tap .tap-ring { position: absolute; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--accent); opacity: 0; animation: obTapRing 1.6s ease-out infinite; }
@keyframes obTapMove { 0%,20%{transform:translate(10px,-10px)} 45%,65%{transform:translate(0,2px) scale(.85)} 100%{transform:translate(10px,-10px)} }
@keyframes obTapRing { 0%,40%{opacity:0;transform:translate(0,2px) scale(.6)} 55%{opacity:.8;transform:translate(0,2px) scale(1)} 75%{opacity:0;transform:translate(0,2px) scale(1.8)} 100%{opacity:0} }

/* 2. Mic — pulsing mic with expanding sound rings */
.ob-scene.mic .mic-body { font-size: 1.3rem; animation: obMicPulse 1.4s ease-in-out infinite; }
.ob-scene.mic .mic-ring { position: absolute; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--accent); opacity: 0; animation: obMicRing 1.4s ease-out infinite; }
.ob-scene.mic .mic-ring.r2 { animation-delay: .4s; }
@keyframes obMicPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.12)} }
@keyframes obMicRing { 0%{opacity:.7;transform:scale(.5)} 100%{opacity:0;transform:scale(1.7)} }

/* 3. Listen — speaker with equalizer bars */
.ob-scene.listen .listen-icon { font-size: 1.1rem; margin-right: 3px; }
.ob-scene.listen .eq-bars { display: flex; align-items: center; gap: 2px; height: 20px; }
.ob-scene.listen .eq-bar { width: 3px; background: var(--accent); border-radius: 2px; animation: obEq 1s ease-in-out infinite; }
.ob-scene.listen .eq-bar:nth-child(1) { animation-delay: 0s; }
.ob-scene.listen .eq-bar:nth-child(2) { animation-delay: .15s; }
.ob-scene.listen .eq-bar:nth-child(3) { animation-delay: .3s; }
@keyframes obEq { 0%,100%{height:5px} 50%{height:18px} }

/* 4. Type — blinking cursor typing lines of text */
.ob-scene.type .type-lines { display: flex; flex-direction: column; gap: 4px; width: 32px; }
.ob-scene.type .type-line { height: 3px; background: var(--beige-dk, #D8D0C4); border-radius: 2px; transform-origin: left; animation: obTypeLine 1.8s ease-in-out infinite; }
.ob-scene.type .type-line:nth-child(1) { animation-delay: 0s; }
.ob-scene.type .type-line:nth-child(2) { animation-delay: .3s; width: 70%; }
.ob-scene.type .type-line:nth-child(3) { animation-delay: .6s; width: 45%; }
@keyframes obTypeLine { 0%,15%{transform:scaleX(0)} 40%,100%{transform:scaleX(1)} }

/* 5. Save — checkmark draws in with a pop */
.ob-scene.save .save-circle { width: 28px; height: 28px; border-radius: 50%; background: var(--green,#2E7D32); display: flex; align-items: center; justify-content: center; animation: obSavePop 1.8s ease-in-out infinite; }
.ob-scene.save .save-check { color: #fff; font-size: .85rem; font-weight: 900; opacity: 0; animation: obSaveCheck 1.8s ease-in-out infinite; }
@keyframes obSavePop { 0%,30%{transform:scale(0)} 45%{transform:scale(1.15)} 55%,100%{transform:scale(1)} }
@keyframes obSaveCheck { 0%,40%{opacity:0} 55%,100%{opacity:1} }

/* 6. Upload — a document slides up into a tray */
.ob-scene.upload .upload-tray { position: absolute; bottom: 10px; width: 30px; height: 2px; border-bottom: 2px dashed var(--beige-dk, #D8D0C4); }
.ob-scene.upload .upload-doc { font-size: 1.15rem; animation: obUpload 1.8s ease-in-out infinite; }
@keyframes obUpload { 0%{transform:translateY(14px);opacity:0} 35%,65%{transform:translateY(0);opacity:1} 100%{transform:translateY(-10px);opacity:0} }

/* 7. Scan — a gold line sweeps down a document */
.ob-scene.scan .scan-doc { width: 26px; height: 32px; background: #fff; border: 1.5px solid var(--beige-dk, #D8D0C4); border-radius: 3px; position: relative; overflow: hidden; }
.ob-scene.scan .scan-doc-line { display: block; height: 2px; background: var(--beige-dk, #D8D0C4); margin: 4px 4px 0; border-radius: 1px; }
.ob-scene.scan .scan-sweep { position: absolute; left: 0; right: 0; height: 2px; background: var(--accent); box-shadow: 0 0 4px var(--accent); animation: obScanSweep 1.6s ease-in-out infinite; }
@keyframes obScanSweep { 0%{top:2px} 100%{top:28px} }

/* 8. Score — a ring fills up like a progress meter */
.ob-scene.score .score-ring { width: 32px; height: 32px; border-radius: 50%; background: conic-gradient(var(--accent) 0deg, rgba(232,184,75,.15) 0deg); animation: obScoreFill 1.8s ease-out infinite; display: flex; align-items: center; justify-content: center; }
.ob-scene.score .score-ring::after { content: ''; width: 22px; height: 22px; border-radius: 50%; background: var(--white); }
@keyframes obScoreFill { 0%{background:conic-gradient(var(--accent) 0deg,rgba(232,184,75,.15) 0deg)} 70%,100%{background:conic-gradient(var(--accent) 260deg,rgba(232,184,75,.15) 260deg)} }

/* 9. Check-in — 5 small dots light up left to right */
.ob-scene.checkin .checkin-dots { display: flex; gap: 4px; }
.ob-scene.checkin .checkin-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--beige-dk, #D8D0C4); animation: obCheckinDot 2s ease-in-out infinite; }
.ob-scene.checkin .checkin-dot:nth-child(1) { animation-delay: 0s; }
.ob-scene.checkin .checkin-dot:nth-child(2) { animation-delay: .15s; }
.ob-scene.checkin .checkin-dot:nth-child(3) { animation-delay: .3s; }
.ob-scene.checkin .checkin-dot:nth-child(4) { animation-delay: .45s; }
.ob-scene.checkin .checkin-dot:nth-child(5) { animation-delay: .6s; }
@keyframes obCheckinDot { 0%,100%{background:var(--beige-dk, #D8D0C4);transform:scale(1)} 25%{background:var(--body-c,#2E7D32);transform:scale(1.25)} 60%{background:var(--body-c,#2E7D32)} }

/* 10. Checklist — checkboxes tick one after another */
.ob-scene.checklist .checklist-rows { display: flex; flex-direction: column; gap: 4px; }
.ob-scene.checklist .checklist-row { display: flex; align-items: center; gap: 4px; }
.ob-scene.checklist .checklist-box { width: 9px; height: 9px; border-radius: 3px; border: 1.5px solid var(--beige-dk, #D8D0C4); position: relative; }
.ob-scene.checklist .checklist-row:nth-child(1) .checklist-box { animation: obCheckboxTick 2.1s ease-in-out infinite; animation-delay: 0s; }
.ob-scene.checklist .checklist-row:nth-child(2) .checklist-box { animation: obCheckboxTick 2.1s ease-in-out infinite; animation-delay: .5s; }
.ob-scene.checklist .checklist-row:nth-child(3) .checklist-box { animation: obCheckboxTick 2.1s ease-in-out infinite; animation-delay: 1s; }
.ob-scene.checklist .checklist-line { width: 20px; height: 2px; background: var(--beige-dk, #D8D0C4); border-radius: 1px; }
@keyframes obCheckboxTick { 0%,20%{background:transparent;border-color:var(--beige-dk, #D8D0C4)} 35%,100%{background:var(--mind-c,#7B4FA3);border-color:var(--mind-c,#7B4FA3)} }

/* 11. Chart — bars grow up in sequence */
.ob-scene.chart .chart-bars { display: flex; align-items: flex-end; gap: 4px; height: 28px; }
.ob-scene.chart .chart-bar { width: 7px; background: var(--conn-c,#B8860B); border-radius: 2px 2px 0 0; animation: obChartGrow 1.8s ease-in-out infinite; }
.ob-scene.chart .chart-bar:nth-child(1) { animation-delay: 0s; }
.ob-scene.chart .chart-bar:nth-child(2) { animation-delay: .2s; }
.ob-scene.chart .chart-bar:nth-child(3) { animation-delay: .4s; }
@keyframes obChartGrow { 0%,10%{height:3px} 60%,100%{height:var(--h,26px)} }
