/* ============================================================
   /typebot · conversa guiada · usa os tokens de style.css
   ============================================================ */
.tb-body { min-height: 100dvh; display: flex; flex-direction: column; }

.tb-top {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px 16px 0;
  background: color-mix(in srgb, var(--off-white) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.tb-top .brand { text-decoration: none; width: 100%; max-width: 640px; margin: 0 auto; }
.tb-progress { display: block; height: 3px; width: 100%; max-width: 640px; margin: 0 auto; background: var(--border); border-radius: 3px; overflow: hidden; }
.tb-progress-bar { display: block; height: 100%; width: 0; background: var(--accent-grad); transition: width .5s var(--ease); }

.tb-main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 24px 16px 40px; display: flex; flex-direction: column; }
.tb-chat { display: flex; flex-direction: column; gap: 10px; flex: 1; }

.tb-row { display: flex; align-items: flex-end; gap: 10px; animation: tb-in .35s var(--ease) both; }
.tb-user { justify-content: flex-end; }
.tb-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border-strong); }
.tb-bubble {
  max-width: min(82%, 480px);
  padding: 12px 16px;
  border-radius: 18px 18px 18px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--near-black);
  font-size: 1rem; line-height: 1.5;
  overflow-wrap: anywhere;
}
.tb-user .tb-bubble { border-radius: 18px 18px 6px 18px; background: var(--accent); border-color: transparent; color: #fff; }

.tb-typing { display: inline-flex; gap: 5px; padding: 16px 18px; }
.tb-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: tb-dot 1s infinite ease-in-out; }
.tb-typing span:nth-child(2) { animation-delay: .15s; }
.tb-typing span:nth-child(3) { animation-delay: .3s; }

.tb-input { position: sticky; bottom: 0; padding-top: 16px; padding-bottom: env(safe-area-inset-bottom); }
.tb-choices { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.tb-choice {
  font: inherit; font-size: .95rem; font-weight: 600;
  padding: 11px 16px; border-radius: var(--radius-btn);
  background: transparent; color: var(--accent-ink);
  border: 1.5px solid var(--accent); cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.tb-choice:hover, .tb-choice:focus-visible { background: var(--accent); color: #fff; transform: translateY(-1px); outline: none; }

.tb-form { display: flex; gap: 8px; }
.tb-form input {
  flex: 1; min-width: 0; font: inherit; font-size: 1rem;
  padding: 14px 18px; border-radius: var(--radius-btn);
  background: var(--surface); color: var(--near-black);
  border: 1.5px solid var(--border-strong);
}
.tb-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tb-form input[aria-invalid="true"] { border-color: var(--danger); }
.tb-send {
  width: 52px; height: 52px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--accent-grad); color: #fff; border: 0;
}
.tb-error { margin: 8px 4px 0; min-height: 1.2em; color: var(--danger); font-size: .9rem; }

.tb-cta { width: 100%; justify-content: center; text-align: center; }
.tb-back { display: block; margin-top: 14px; text-align: center; color: var(--muted); font-size: .95rem; }
.tb-noscript { max-width: 640px; margin: 40px auto; padding: 0 16px; }

@keyframes tb-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes tb-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .tb-row, .tb-typing span { animation: none; } }
