/* ============================================================
   onboarding.css â€” tÃ­tulo do mapa, boas-vindas e missÃ£o guiada
   Visual limpo: branco, cinza ardÃ³sia, Ã­cones SVG, sem emojis.
   ============================================================ */

/* Cards promocionais ficam ocultos atÃ© concluir/pular a 1Âª visita */
body.onb-first-run #btnChallengeSidebar,
body.onb-first-run #btnBusSidebar,
body.onb-first-run #btnFerrySidebar { display: none !important; }

/* ---------- TÃ­tulo do mapa ---------- */
body.challenge-mode .map-title-banner { display: none !important; }
.map-title-banner {
  position: absolute;
  top: 106px;
  left: 64px;
  z-index: 505;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(440px, calc(100% - 436px));
  padding: 7px 12px 7px 11px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease, top .15s ease;
}
body.mode-draft .map-title-banner { top: 62px; }
body.sb-closed .map-title-banner { max-width: min(500px, calc(100% - 436px)); }
.map-title-banner:hover { border-color: #94a3b8; box-shadow: 0 3px 12px rgba(15, 23, 42, 0.12); }
.map-title-banner .mtb-ico { display: inline-flex; color: #475569; flex: none; }
.map-title-banner .mtb-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.map-title-banner .mtb-label {
  font-size: 10px; font-weight: 700; letter-spacing: .55px; text-transform: uppercase; color: #64748b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.map-title-banner .mtb-name {
  font-size: 14px; font-weight: 700; color: #0f172a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.map-title-banner .mtb-edit {
  display: inline-flex; color: #94a3b8; flex: none; margin-left: 2px; transition: color .15s ease;
}
.map-title-banner:hover .mtb-edit { color: #334155; }

/* ---------- Boas-vindas ---------- */
.onb-welcome {
  position: fixed; inset: 0; z-index: 3500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  padding: 14px;
}
.onb-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  padding: 28px 26px 22px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
  color: #334155;
}
.onb-brand {
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #64748b;
  margin-bottom: 6px;
}
.onb-card h2 { margin: 0 0 8px; font-size: 22px; font-weight: 800; color: #0f172a; letter-spacing: -.3px; }
.onb-sub { margin: 0 0 18px; font-size: 13.5px; line-height: 1.5; color: #64748b; }
.onb-opts { display: flex; flex-direction: column; gap: 10px; }
.onb-opt {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 13px 14px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  text-align: left; cursor: pointer; font-family: inherit;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.onb-opt:hover { border-color: #94a3b8; background: #f8fafc; transform: translateY(-1px); }
.onb-opt.primary { border-color: #0f172a; box-shadow: 0 0 0 1px #0f172a inset; }
.onb-opt-ico {
  flex: none; width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: #f1f5f9; color: #334155;
}
.onb-opt.primary .onb-opt-ico { background: #0f172a; color: #fff; }
.onb-opt-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.onb-opt-txt b { font-size: 14px; font-weight: 700; color: #0f172a; }
.onb-opt-txt small { font-size: 12px; color: #64748b; line-height: 1.35; }
.onb-opt-go { flex: none; color: #94a3b8; display: inline-flex; }
.onb-opt:hover .onb-opt-go { color: #334155; }
.onb-skip {
  display: block; margin: 16px auto 0; padding: 4px 8px;
  background: none; border: 0; cursor: pointer; font-family: inherit;
  font-size: 12.5px; color: #64748b; text-decoration: underline;
}
.onb-skip:hover { color: #0f172a; }

/* ---------- Central de Tutoriais (Hub) ---------- */
.onb-hub-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.onb-hub-close {
  flex: none; width: 32px; height: 32px; border-radius: 8px; border: 1px solid #e2e8f0;
  background: #f8fafc; color: #475569; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s ease, color .15s ease;
}
.onb-hub-close:hover { background: #e2e8f0; color: #0f172a; }
.onb-opt-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 13px 14px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
}
.onb-opt-card-top { display: flex; align-items: center; gap: 14px; }
.onb-sub-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 54px; }
.onb-sub-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 8px; border: 1px solid #e2e8f0;
  background: #f8fafc; color: #334155; font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.onb-sub-btn:hover { border-color: #94a3b8; background: #f1f5f9; color: #0f172a; }

/* ---------- MissÃ£o guiada ---------- */
.onb-coach {
  position: fixed;
  top: 108px;
  right: 14px;
  bottom: auto;
  left: auto;
  z-index: 520;
  width: 312px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 12px 14px 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
  color: #334155;
  transition: right .18s ease, opacity .15s ease;
}
.onb-coach.onb-coach-shift-left { right: 374px; }
.onb-coach.onb-coach-occluded { opacity: 0; pointer-events: none; }
body:has(#modalRoot .modal-bg, #modalRoot .mobile-sheet-backdrop, #onbHub, #onbWelcome, #tutorialOverlay:not(.hidden), #guideDrawer.open) .onb-coach {
  display: none !important;
}
.onb-coach.hidden { display: none; }
.onb-coach-head { display: flex; align-items: center; justify-content: space-between; }
.onb-coach-badge { font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #64748b; }
.onb-coach-x {
  display: inline-flex; padding: 4px; background: none; border: 0; cursor: pointer; color: #94a3b8; border-radius: 6px;
}
.onb-coach-x:hover { color: #0f172a; background: #f1f5f9; }
.onb-bar { height: 3px; background: #e2e8f0; border-radius: 2px; margin: 8px 0 10px; overflow: hidden; }
.onb-bar i { display: block; height: 100%; background: #0f172a; border-radius: 2px; transition: width .25s ease; }
.onb-coach-title { margin: 0 0 4px; font-size: 14.5px; font-weight: 700; color: #0f172a; }
.onb-coach-text { margin: 0 0 10px; font-size: 12.5px; line-height: 1.5; color: #64748b; }
.onb-coach-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.onb-coach-skip {
  background: none; border: 0; padding: 4px 2px; cursor: pointer; font-family: inherit;
  font-size: 12px; color: #64748b; text-decoration: underline;
}
.onb-coach-skip:hover { color: #0f172a; }
.onb-coach-next {
  background: #0f172a; color: #fff; border: 1px solid #0f172a; border-radius: 8px;
  padding: 7px 16px; font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: background .15s ease;
}
.onb-coach-next:hover { background: #1e293b; }

/* Realce de alto contraste do elemento-alvo */
.onb-pulse {
  position: relative;
  z-index: 600;
  outline: 2.5px solid #2563eb !important;
  outline-offset: 2px;
  animation: onbPulse 1.4s ease-in-out infinite;
}
@keyframes onbPulse {
  0%, 100% {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #2563eb, 0 0 14px 3px rgba(37, 99, 235, 0.55);
  }
  50% {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 8px #38bdf8, 0 0 22px 6px rgba(56, 189, 248, 0.65);
  }
}

@media (max-width: 680px) {
  .map-title-banner, body.sb-closed .map-title-banner { top: 108px; left: 10px; right: auto; max-width: calc(100% - 20px); }
  body.mode-draft .map-title-banner { top: 62px; }
  .onb-coach, .onb-coach.onb-coach-shift-left { top: auto; left: 10px; right: 10px; width: auto; bottom: 80px; max-width: none; }
  .onb-card { padding: 22px 18px 18px; }
  .onb-sub-actions { padding-left: 0; }
}

/* ---------- Tema Escuro Contextual no Menu Principal ---------- */
body.start-menu-open .onb-welcome {
  background: rgba(4, 7, 15, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
body.start-menu-open .onb-card {
  background: #0f172a;
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 65px -10px rgba(0, 0, 0, 0.8);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
body.start-menu-open .onb-card::-webkit-scrollbar { width: 5px; height: 5px; }
body.start-menu-open .onb-card::-webkit-scrollbar-track { background: transparent; }
body.start-menu-open .onb-card::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.25); border-radius: 999px; }
body.start-menu-open .onb-brand { color: #38bdf8; }
body.start-menu-open .onb-card h2 { color: #f8fafc; }
body.start-menu-open .onb-sub { color: #94a3b8; }
body.start-menu-open .onb-hub-close {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: #94a3b8;
}
body.start-menu-open .onb-hub-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}
body.start-menu-open .onb-opt,
body.start-menu-open .onb-opt-card {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(255, 255, 255, 0.1);
}
body.start-menu-open .onb-opt:hover {
  background: rgba(51, 65, 85, 0.78);
  border-color: rgba(125, 211, 252, 0.35);
}
body.start-menu-open .onb-opt.primary {
  border-color: #e11d48;
  box-shadow: 0 0 0 1px rgba(225, 29, 72, 0.55) inset;
  background: rgba(225, 29, 72, 0.12);
}
body.start-menu-open .onb-opt-ico {
  background: rgba(15, 23, 42, 0.75);
  color: #7dd3fc;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
body.start-menu-open .onb-opt.primary .onb-opt-ico {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  color: #ffffff;
  border-color: transparent;
}
body.start-menu-open .onb-opt-txt b { color: #f8fafc; }
body.start-menu-open .onb-opt-txt small { color: #94a3b8; }
body.start-menu-open .onb-opt-go { color: #64748b; }
body.start-menu-open .onb-opt:hover .onb-opt-go { color: #f8fafc; }
body.start-menu-open .onb-sub-btn {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
}
body.start-menu-open .onb-sub-btn:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.38);
  color: #ffffff;
}
body.start-menu-open .onb-skip { color: #94a3b8; }
body.start-menu-open .onb-skip:hover { color: #ffffff; }
