/* Tour guiado (v2): card flutuante no desktop, bottom-sheet no celular.
   O fundo escuro só aparece nos passos centrais (boas-vindas) — nos demais a tela
   fica livre para o usuário executar a ação guiada. */

.tour-fundo {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 18, 0.55);
  z-index: 950;
}

/* So contorno, sem trocar fundo nem cor do alvo (botoes coloridos continuam
   legiveis). position + z-index tiram o contorno de baixo de cabecalhos sticky. */
.tour-alvo {
  position: relative;
  z-index: 150;
  border-radius: var(--radius);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* "Canhao de luz" das fases do modal: um sombreado gigante escurece tudo em
   volta e so o topico da vez fica iluminado. */
.tour-foco {
  position: relative;
  z-index: 10;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 0 0 8px var(--surface), 0 0 0 100vmax rgba(15, 15, 14, 0.62);
  outline: 2px solid var(--accent);
  outline-offset: 8px;
}

/* Item do menu lateral da tela atual: a pessoa sabe onde esta e onde clicar. */
.menu button.tour-menu-ativo {
  background: var(--accent-soft);
  color: var(--accent-strong);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius);
  animation: tour-pulso 1s ease-in-out 2;
}

/* Acima do modal de transacao (z 2000): o mini tutorial acontece com o modal aberto. */
.tour {
  position: fixed;
  z-index: 2100;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  padding: 16px 18px;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.tour-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.tour-etapa {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.tour-pular {
  background: transparent;
  border: none;
  padding: 2px 4px;
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: underline;
  cursor: pointer;
}

.tour-icone {
  color: var(--accent);
  margin-bottom: 8px;
}

.tour-icone svg {
  width: 22px;
  height: 22px;
  display: block;
}

.tour-titulo {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.tour-texto {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

/* Faixa de estado dos passos com ação: aguardando (tracejada) ou sucesso (verde). */
.tour-status {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.tour-sucesso .tour-status {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.tour-acoes {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}

.tour-acoes button {
  font-family: var(--font);
  font-size: 13px;
  border-radius: var(--radius);
  padding: 8px 14px;
  cursor: pointer;
  border: 1px solid transparent;
}

.tour-voltar {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.tour-avancar {
  background: var(--accent);
  color: #fff;
}

.tour-avancar:hover {
  background: var(--accent-hover);
}

.tour-acoes button:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Realce rápido no controle que a simulação está prestes a acionar. */
.tour-clique {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  transform: scale(0.97);
  transition: transform 0.15s ease;
}

/* Chama atenção para um botão revelado pela demonstração (ex.: a lixeira). */
.tour-pulso {
  animation: tour-pulso 1s ease-in-out 3;
}

@keyframes tour-pulso {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(63, 157, 82, 0.55);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(63, 157, 82, 0);
  }
}

/* "Dedo" da demonstração do gesto de swipe no celular. */
.tour-dedo {
  position: fixed;
  z-index: 2200;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  background: rgba(63, 157, 82, 0.35);
  border: 2px solid var(--accent);
  box-shadow: var(--shadow);
  pointer-events: none;
  animation: tour-dedo-surgir 0.3s ease;
  transition: transform 0.7s ease, opacity 0.3s ease;
}

.tour-dedo-sumir {
  opacity: 0;
}

@keyframes tour-dedo-surgir {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 650px) {
  /* Compacto no celular: sem icone, tipografia menor e altura contida, para o
     card nao esconder o que acontece na tela. */
  .tour {
    left: 8px;
    right: 8px;
    bottom: 8px;
    top: auto;
    width: auto;
    max-height: 34dvh;
    padding: 12px 14px calc(10px + env(safe-area-inset-bottom));
  }

  .tour-icone {
    display: none;
  }

  .tour-topo {
    margin-bottom: 6px;
  }

  .tour-titulo {
    font-size: 14px;
    margin-bottom: 4px;
  }

  .tour-texto {
    font-size: 12.5px;
    line-height: 1.45;
  }

  .tour-status {
    margin-top: 8px;
    padding: 6px 10px;
  }

  .tour-acoes {
    margin-top: 10px;
  }

  .tour-acoes button {
    flex: 1;
    min-height: 40px;
  }

  .tour-acoes .tour-voltar {
    flex: 0 0 auto;
  }

  /* Durante uma simulacao o card vira so uma faixa de status: a tela fica livre
     para a pessoa acompanhar o que esta acontecendo. */
  .tour.tour-min .tour-topo,
  .tour.tour-min .tour-titulo,
  .tour.tour-min .tour-texto,
  .tour.tour-min .tour-acoes {
    display: none;
  }

  .tour.tour-min .tour-status {
    margin-top: 0;
  }
}
