/* ==========================================================================
 * Dicas / tooltips (UI-05) — sigla ou campo com explicação ao passar o mouse.
 * CSS puro, sem JS (NFR-005). Acessível: o elemento recebe tabindex=0, então a
 * dica também aparece no foco por teclado. Tokens Vestra (tokens.css).
 * ========================================================================== */

.dica {
  border-bottom: 1px dotted var(--color-slate);
  cursor: help;
  position: relative;
  text-decoration: none;
}

/* A bolha da dica, acima do elemento. `attr(data-dica)` traz o texto. */
.dica[data-dica]:hover::after,
.dica[data-dica]:focus-visible::after {
  content: attr(data-dica);
  position: absolute;
  left: 0;
  bottom: calc(100% + 7px);
  z-index: 60;
  width: max-content;
  max-width: 280px;
  background: var(--purple-900);
  color: #fff;
  font-size: var(--text-caption);
  font-weight: var(--font-weight-regular);
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  padding: 7px 11px;
  border-radius: 8px;
  box-shadow: var(--shadow-xl-2);
  white-space: normal;
  pointer-events: none;
}

/* A setinha da bolha. */
.dica[data-dica]:hover::before,
.dica[data-dica]:focus-visible::before {
  content: "";
  position: absolute;
  left: 10px;
  bottom: calc(100% + 2px);
  z-index: 60;
  border: 5px solid transparent;
  border-top-color: var(--purple-900);
  pointer-events: none;
}

/* Ícone "?" ao lado de rótulos de campo/sigla técnica. */
.dica-icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--purple-100);
  color: var(--purple-700);
  font-size: 10px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
  border-bottom: 0;
  vertical-align: middle;
}
.dica-icone:hover { background: var(--purple-200); }
