/* TBIM Forms — motor de formulário estilo "uma pergunta por tela" */
:root {
  --bg: #000;
  --text: #fff;
  --muted: #9a9a9a;
  --answer: #d9d9d9;
  --btn-bg: #fff;
  --btn-text: #000;
  --accent: #fff;
  --line: rgba(255,255,255,.35);
  --choice-bg: rgba(255,255,255,.06);
  --choice-border: rgba(255,255,255,.28);
  --radius: 6px;
  --font: "Arimo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --xp: #f5c542;
  --good: #3ddc84;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
#app { position: fixed; inset: 0; }

/* fundo de imagem opcional por pergunta */
.bgimg { position: fixed; inset: 0; background-size: cover; background-position: center top;
  opacity: 0; transition: opacity .6s ease; z-index: 0; }
.bgimg.on { opacity: 1; }
.bgimg::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.45); }

/* barra de progresso */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 5; background: rgba(255,255,255,.08); }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .5s cubic-bezier(.2,.8,.2,1); }

/* palco */
.stage { position: absolute; inset: 0; z-index: 1; overflow-y: auto; display: flex; }
.step { margin: auto; width: 100%; max-width: 640px; padding: 72px 20px 110px; }
.step.enter { animation: stepIn .45s cubic-bezier(.2,.8,.2,1) both; }
.step.leave-up { animation: stepOutUp .3s ease both; }
.step.leave-down { animation: stepOutDown .3s ease both; }
@keyframes stepIn { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes stepOutUp { to { opacity: 0; transform: translateY(-40px); } }
@keyframes stepOutDown { to { opacity: 0; transform: translateY(40px); } }

.q-title { font-size: clamp(20px, 3.2vw, 26px); line-height: 1.35; font-weight: 400; margin: 0 0 8px; }
.q-title .req { opacity: .8; margin-left: 2px; }
.q-desc { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 0 0 22px; }
.q-help { color: var(--muted); font-size: 12px; margin: 6px 0 12px; }

input.ans, textarea.ans {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line);
  color: var(--answer); font: inherit; font-size: clamp(20px, 3vw, 26px); padding: 8px 0; outline: none;
  resize: none; transition: border-color .2s;
}
input.ans:focus, textarea.ans:focus { border-color: var(--text); }
input.ans::placeholder, textarea.ans::placeholder { color: rgba(255,255,255,.28); }
.phone-row { display: flex; gap: 8px; align-items: flex-end; }
.phone-row .ddi { font-size: 18px; color: var(--answer); border-bottom: 1px solid var(--line); padding: 10px 6px; white-space: nowrap; }

.choices { display: grid; gap: 8px; max-width: 460px; }
.choice {
  display: flex; align-items: center; gap: 10px; text-align: left; width: 100%;
  background: var(--choice-bg); border: 1px solid var(--choice-border); border-radius: var(--radius);
  color: var(--answer); font: inherit; font-size: 15px; padding: 9px 10px; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.choice:hover { background: rgba(255,255,255,.12); }
.choice:active { transform: scale(.98); }
.choice .key { flex: none; width: 22px; height: 22px; display: grid; place-items: center; font-size: 11px; font-weight: 700;
  border: 1px solid var(--choice-border); border-radius: 4px; }
.choice.sel { border-color: var(--text); background: rgba(255,255,255,.16); color: var(--text); }
.choice.sel .key { background: var(--btn-bg); color: var(--btn-text); border-color: var(--btn-bg); }
.choice.blink { animation: blink .25s ease 2; }
@keyframes blink { 50% { background: rgba(255,255,255,.3); } }
.choice .check { margin-left: auto; opacity: 0; }
.choice.sel .check { opacity: 1; }

.actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.btn {
  background: var(--btn-bg); color: var(--btn-text); border: 0; border-radius: var(--radius);
  font: inherit; font-weight: 700; font-size: 17px; padding: 9px 14px; cursor: pointer;
  transition: opacity .2s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn.big { font-size: 19px; padding: 13px 22px; }
.hint { font-size: 12px; color: var(--muted); }
.hint b { color: var(--text); }
.err { color: #ff8a80; font-size: 14px; margin-top: 10px; min-height: 18px; }

.nav { position: fixed; right: 18px; bottom: 18px; z-index: 6; display: flex; gap: 4px; }
.nav button { width: 30px; height: 30px; border: 0; border-radius: 4px; background: var(--btn-bg); color: var(--btn-text); cursor: pointer; font-size: 15px; }
.nav button[disabled] { opacity: .4; cursor: default; }

.embed { width: 100%; height: min(680px, 72vh); border: 0; border-radius: var(--radius); background: #fff; }

.welcome .q-title { font-size: clamp(26px, 4.4vw, 40px); font-weight: 700; }

/* ===== modo quiz / jogo ===== */
.hud { position: fixed; top: 14px; left: 16px; right: 16px; z-index: 6; display: none; align-items: center; gap: 12px; pointer-events: none; }
.quiz .hud { display: flex; }
.hud .lvl { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--xp); }
.hud .xpbar { flex: 1; max-width: 220px; height: 10px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.hud .xpbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--xp), #ff8f3d); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.hud .pts { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.hud .pts.bump { animation: bump .4s ease; }
@keyframes bump { 40% { transform: scale(1.35); color: var(--xp); } }
.float-pts { position: fixed; z-index: 9; font-weight: 800; font-size: 22px; color: var(--xp); pointer-events: none;
  animation: floatUp 1s ease-out forwards; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
@keyframes floatUp { from { opacity: 1; transform: translateY(0) scale(.8); } to { opacity: 0; transform: translateY(-70px) scale(1.2); } }
.badge-toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); z-index: 9; background: #1c1c1c; border: 1px solid var(--xp);
  color: var(--text); border-radius: 12px; padding: 10px 16px; font-size: 15px; display: flex; gap: 10px; align-items: center;
  animation: toast 2.6s ease forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 20px); } 12%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
.result-score { font-size: clamp(56px, 12vw, 96px); font-weight: 800; line-height: 1; color: var(--xp); font-variant-numeric: tabular-nums; }
.result-tier { display: inline-block; margin: 10px 0 18px; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--xp); color: var(--xp); font-weight: 700; font-size: 14px; }
.ring { width: 160px; height: 160px; margin-bottom: 10px; }
#confetti { position: fixed; inset: 0; z-index: 8; pointer-events: none; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 560px) {
  .step { padding: 64px 16px 100px; }
  .choices { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .step.enter, .step.leave-up, .step.leave-down, .float-pts, .badge-toast { animation: none; }
}
