/* ============================================================
   Tour guiado in-app — estilos compartilhados (index + admin)
   Paleta do app: accent var(--terra-texto, #ac4e2d), texto var(--preto, #0f0f0e), fundo card #fff
   z-index: acima de tudo — o maior do app é 11000 (lightbox/chat) e a
   barra "vendo como" do org-switch.js é 99999; o tour tem que cobrir
   as duas, senão dá para trocar de organização no meio do tour.
   ============================================================ */

/* ---- Botão "?" no header ---- */
.tour-help-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  border: 1px solid var(--grafite, #57534b);
  background: none;
  color: var(--fumo, #a9a296);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color 0.15s, color 0.15s;
}
.tour-help-btn:hover {
  border-color: var(--terra-texto, #ac4e2d);
  color: var(--terra-texto, #ac4e2d);
}
/* variante menor para dentro de drawers/painéis claros */
.tour-help-btn--light {
  border-color: var(--fio-claro, #d8d2c6);
  color: var(--fumo, #a9a296);
}

/* ---- Overlay raiz ---- */
#site-tour-root {
  position: fixed;
  inset: 0;
  z-index: 100000;
  animation: tourFadeIn 0.2s ease;
}
@keyframes tourFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
#site-tour-root.tour-closing {
  opacity: 0;
  transition: opacity 0.18s ease;
}

/* Camada que bloqueia cliques na página durante o tour */
.tour-click-guard {
  position: absolute;
  inset: 0;
}

/* ---- Spotlight ----
   Caixa transparente sobre o elemento-alvo; o box-shadow gigante
   escurece todo o resto da tela. */
.tour-spotlight {
  position: fixed;
  border-radius: 10px;
  box-shadow: 0 0 0 200vmax rgba(15, 17, 32, 0.62);
  transition: top 0.25s ease, left 0.25s ease, width 0.25s ease, height 0.25s ease;
  pointer-events: none;
}
/* Passo sem alvo (intro): spotlight some, só escurece */
.tour-spotlight.tour-spotlight--none {
  top: 50% !important;
  left: 50% !important;
  width: 0 !important;
  height: 0 !important;
  border-radius: 50%;
}

/* ---- Card do passo ---- */
.tour-card {
  position: fixed;
  width: 340px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 18px 20px 14px;
  color: var(--preto, #0f0f0e);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  transition: top 0.25s ease, left 0.25s ease;
}
.tour-card--center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: none;
}
.tour-card-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border: none;
  background: #f0f2f5;
  border-radius: 50%;
  color: var(--grafite, #57534b);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tour-card-close:hover { background: #e2e5ea; color: var(--preto, #0f0f0e); }
.tour-card-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--terra-texto, #ac4e2d);
  margin-bottom: 6px;
}
.tour-card-title {
  margin: 0 18px 8px 0;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
}
.tour-card-text {
  margin: 0 0 14px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #444;
}
.tour-card-text b { color: var(--preto, #0f0f0e); }

/* rodapé: contador + botões */
.tour-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tour-card-count {
  font-size: 0.75rem;
  color: var(--fumo, #a9a296);
  margin-right: auto;
  white-space: nowrap;
}
.tour-btn {
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
  font-family: inherit;
}
.tour-btn-prev {
  background: #fff;
  border: 1px solid #d0d3d9;
  color: var(--grafite, #57534b);
}
.tour-btn-prev:hover { border-color: var(--fumo, #a9a296); color: var(--preto, #0f0f0e); }
.tour-btn-prev:disabled { opacity: 0.4; cursor: default; }
.tour-btn-next {
  background: var(--terra-texto, #ac4e2d);
  border: 1px solid var(--terra-texto, #ac4e2d);
  color: #fff;
}
.tour-btn-next:hover { background: var(--terra-forte, #8f3a20); border-color: var(--terra-forte, #8f3a20); }

/* ---- Balão de dica (1ª visita) ---- */
.tour-hint {
  position: fixed;
  z-index: 99998;
  background: var(--preto, #0f0f0e);
  color: #fff;
  border-radius: 12px;
  padding: 10px 34px 10px 14px;
  font-size: 0.8rem;
  line-height: 1.4;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  max-width: 240px;
  cursor: pointer;
  animation: tourHintIn 0.3s ease;
}
@keyframes tourHintIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
/* setinha apontando para o botão "?" acima */
.tour-hint::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 18px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--preto, #0f0f0e);
}
.tour-hint-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: var(--fio-claro, #d8d2c6);
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
}

/* ---- Mobile (≤768px): card vira bottom sheet ---- */
@media (max-width: 768px) {
  /* No celular o ✕ de 20x20 é pequeno demais para o dedo, e este balão
     aparece em quase toda tela — errar o alvo custa caro. */
  .tour-hint-close {
    width: 44px;
    height: 44px;
    top: 0;
    right: 0;
    font-size: 0.95rem;
  }

  .tour-card,
  .tour-card--center {
    top: auto !important;
    left: 0 !important;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    transform: none;
    border-radius: 14px 14px 0 0;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    transition: none;
  }
  .tour-hint {
    left: 12px !important;
    right: 12px;
    max-width: none;
  }
  .tour-hint::before { right: 30px; }
}
