/* ====================================================================
   web/css/tour.css — o tour de primeira visita e as dicas (js/tour.js,
   08/10/2026). Padrão visual da casa (css/barra.css, selo Apple/ChatGPT):
   tokens --ds-*, fonte do sistema, pesos 400/500/600, popover com raio 16
   e a sombra --ds-sombra-pop, uma cor de ação (azul). Toques >= 44 px no
   toque, texto >= 12 px, prefers-reduced-motion desliga o movimento.
   Tudo aqui só existe quando js/tour.js põe os elementos na tela (v6).
   ==================================================================== */

/* ---------- o véu e o realce recortado em volta do alvo ---------- */
.tour-veu {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: transparent;
  touch-action: none;
}
.tour-foco {
  position: fixed;
  z-index: 5001;
  border-radius: 12px;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ds-azul, #152848), 0 0 0 200vmax rgba(10, 22, 40, 0.42);
  pointer-events: none;
  transition: left 220ms var(--ds-ease, ease), top 220ms var(--ds-ease, ease), width 220ms var(--ds-ease, ease), height 220ms var(--ds-ease, ease);
}

/* ---------- o balão ---------- */
.tour-balao {
  position: fixed;
  z-index: 5002;
  box-sizing: border-box;
  width: min(340px, calc(100vw - 32px));
  padding: 14px 16px 14px;
  background: #fff;
  color: var(--ds-ink, #0a1628);
  border: 1px solid var(--ds-hair, rgba(10, 22, 40, 0.08));
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(10, 22, 40, 0.18);
  font-family: var(--va-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  -webkit-font-smoothing: antialiased;
  transition: opacity 150ms ease, transform 220ms var(--ds-ease, ease);
}
.tour-balao.tour-trocando { opacity: 0; transform: translateY(4px); }
.tour-balao.tour-folha {
  left: 12px !important;
  right: 12px;
  top: auto !important;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  width: auto;
  max-width: 520px;
  margin: 0 auto;
}
.tour-balao.tour-folha.tour-folha-topo {
  top: calc(12px + env(safe-area-inset-top, 0px)) !important;
  bottom: auto;
}
.tour-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -4px -8px 4px 0;
}
.tour-passo {
  font-size: 12px;
  font-weight: 500;
  color: var(--ds-ink-3, #8a929e);
  font-variant-numeric: tabular-nums;
}
.tour-tit {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ds-ink, #0a1628);
}
.tour-txt {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ds-ink-2, #5b6472);
}
.tour-pe {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.tour-pontos { display: flex; gap: 5px; margin-right: auto; }
.tour-pontos i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(10, 22, 40, 0.16);
  transition: background-color 150ms ease, width 220ms var(--ds-ease, ease);
}
.tour-pontos i.on { width: 16px; border-radius: 3px; background: var(--ds-azul, #152848); }

.tour-balao button {
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tour-pular {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ds-ink-2, #5b6472);
  font-size: 13px !important;
  font-weight: 500;
  transition: background-color 150ms ease;
}
.tour-pular:hover { background: var(--ds-hover, rgba(10, 22, 40, 0.045)); color: var(--ds-ink, #0a1628); }
.tour-voltar,
.tour-prox {
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px !important;
  font-weight: 500;
  transition: background-color 150ms ease;
}
.tour-voltar {
  border: 1px solid var(--ds-hair, rgba(10, 22, 40, 0.08));
  background: #fff;
  color: var(--ds-ink, #0a1628);
}
.tour-voltar:hover { background: var(--ds-hover, rgba(10, 22, 40, 0.045)); }
.tour-prox {
  border: 1px solid var(--ds-azul, #152848);
  background: var(--ds-azul, #152848);
  color: #fff;
}
.tour-prox:hover { background: #0f1f3a; }
.tour-balao button:focus-visible,
.tour-q:focus-visible {
  outline: 2px solid var(--ds-azul, #152848);
  outline-offset: 2px;
}
/* toque: alvos de 44 px */
.tour-balao.tour-toque .tour-pular,
.tour-balao.tour-toque .tour-voltar,
.tour-balao.tour-toque .tour-prox { min-height: 44px; }
@media (pointer: coarse) {
  .tour-pular, .tour-voltar, .tour-prox { min-height: 44px; }
}

/* ---------- o "?" das dicas ---------- */
.tour-q {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0 0 0 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ds-ink-3, #8a929e);
  vertical-align: middle;
  cursor: help;
  -webkit-tap-highlight-color: transparent;
  flex: none;
}
.tour-q::after {
  content: "?";
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border: 1px solid currentColor;
  border-radius: 50%;
  font: 500 12px/1 var(--va-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  transition: color 150ms ease, background-color 150ms ease;
}
.tour-q:hover,
.tour-q[aria-expanded="true"] { color: var(--ds-azul, #152848); }
.tour-q[aria-expanded="true"]::after { background: var(--va-azul-06, #f1f4f9); }
/* no toque, a área de toque cresce para 44 px sem mudar o desenho */
@media (pointer: coarse) {
  .tour-q::before { content: ""; position: absolute; inset: -8px; }
}
/* onde o "?" mora */
.ck-legenda > .tour-q { margin-left: 0; height: 18px; }
.t1c:has(> .tour-q) { position: relative; }
.tour-q.tour-q-depois { position: absolute; margin: 0; }
.fe-lista:has(> .tour-q) { position: relative; }
.tour-q.tour-q-canto { position: absolute; top: 2px; right: 0; margin: 0; z-index: 1; }

/* ---------- o balão da dica ---------- */
.tour-dica {
  position: fixed;
  z-index: 4600;
  box-sizing: border-box;
  width: max-content;
  max-width: min(300px, calc(100vw - 32px));
  padding: 10px 12px;
  background: #fff;
  color: var(--ds-ink, #0a1628);
  border: 1px solid var(--ds-hair, rgba(10, 22, 40, 0.08));
  border-radius: 12px;
  box-shadow: var(--ds-sombra-pop, 0 12px 32px rgba(10, 22, 40, 0.12));
  font: 400 13px/1.5 var(--va-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  -webkit-font-smoothing: antialiased;
  animation: tour-dica-entra 150ms var(--ds-ease, ease);
}
.tour-dica[hidden] { display: none; }
.tour-dica.tour-toque { font-size: 14px; }
.tour-dica.tour-folha {
  left: 12px !important;
  right: 12px;
  top: auto !important;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  width: auto;
  max-width: 520px;
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
}
.tour-dica.tour-folha.tour-folha-topo { top: calc(12px + env(safe-area-inset-top, 0px)) !important; bottom: auto; }
@keyframes tour-dica-entra { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

/* ---------- menos movimento ---------- */
@media (prefers-reduced-motion: reduce) {
  .tour-foco, .tour-balao, .tour-pontos i, .tour-q::after, .tour-pular, .tour-voltar, .tour-prox { transition: none !important; }
  .tour-balao.tour-trocando { transform: none; }
  .tour-dica { animation: none !important; }
}
html.tour-sem-movimento .tour-foco,
html.tour-sem-movimento .tour-balao { transition: none !important; }

/* (09/10) "Agora não" na parte do chat: adia (não grava visto); texto discreto, antes do Voltar */
.tour-pe { flex-wrap: wrap; }
.tour-depois {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ds-ink-2, #5b6472);
  font-size: 14px !important;
  font-weight: 500;
}
.tour-depois:hover { background: var(--ds-hover, rgba(10, 22, 40, 0.045)); color: var(--ds-ink, #0a1628); }
.tour-balao.tour-toque .tour-depois { min-height: 44px; }
@media (pointer: coarse) { .tour-depois { min-height: 44px; } }
