/* ==========================================================
   WEBLOX — formulário multi-etapas + página de sucesso
   Reutiliza os tokens de styles.css (não duplica a base)
   ========================================================== */

:root {
  --error: #C0392B;
}

/* O atributo hidden nunca pode ser sobreposto pelos displays da identidade */
[hidden] { display: none !important; }

/* ---------- Link "Voltar ao site" ---------- */
.back-link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color .18s var(--ease);
}
.back-link::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--green);
  flex: none;
}
.back-link:hover { color: var(--ink); }

/* ---------- Barra de progresso fina no topo ---------- */
.header .progress-track {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 3px;
  background: var(--line);
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--green);
  transition: width .45s steps(6);
}

/* ---------- Área principal: pergunta centralizada ---------- */
.form-main {
  position: relative;
  min-height: calc(100svh - 76px);
  display: grid;
  place-items: center;
  padding: 110px 0 80px;
}
.qform {
  width: min(760px, calc(100% - 40px));
  margin-inline: auto;
  position: relative;
  min-width: 0;
}

/* ---------- Painéis das etapas (um por vez) ----------
   A primeira etapa já vem com .active no HTML:
   se o JS falhar, a pergunta 1 continua visível. */
.steps-panels { display: grid; }
.step-panel {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transform: translateX(30px);
  transition: opacity .38s var(--ease), transform .38s var(--ease), visibility 0s linear .38s;
}
.step-panel.before { transform: translateX(-30px); }
.step-panel.active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .38s var(--ease) .1s, transform .38s var(--ease) .1s, visibility 0s;
}

.step-count {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .22em;
  color: var(--green-deep);
  margin-bottom: 18px;
}
.step-question {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin-bottom: 34px;
}
.step-question label { cursor: text; }

/* ---------- Campo minimalista grande ---------- */
.field { margin-bottom: 8px; }
.qinput {
  width: 100%;
  font-family: var(--font-body);
  font-size: clamp(17px, 2.2vw, 22px);
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  padding: 14px 4px;
  min-height: 56px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.qinput::placeholder { color: rgba(102,98,93,.55); }
.qinput:focus {
  border-bottom-color: var(--green);
  box-shadow: 0 6px 0 -4px var(--green-light);
}
.qinput[aria-invalid="true"] { border-bottom-color: var(--error); }

.label-opt {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .08em;
}
.field-hint {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

/* Mensagens de erro */
.field-error {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--error);
  display: flex;
  align-items: center;
  gap: 8px;
}
.field-error::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--error);
  flex: none;
}

/* ---------- Ações da etapa ---------- */
.step-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 36px;
}
.enter-hint {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--muted);
}

/* Voltar discreto */
.step-back {
  margin-top: 28px;
  background: none;
  border: none;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--muted);
  cursor: pointer;
  transition: color .18s var(--ease);
}
.step-back:hover { color: var(--ink); }

/* ---------- Opções clicáveis (faturamento) ---------- */
.opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}
.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--graphite);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 14px 16px;
  min-height: 50px;
  cursor: pointer;
  transition: border-color .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.opt::before {
  content: "";
  flex: none;
  width: 10px; height: 10px;
  background: var(--line);
  transition: background .15s steps(2);
}
.opt:hover {
  border-color: var(--ink);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 rgba(17,17,17,.12);
}
.opt:focus-visible {
  outline: none;
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--green-light);
}
.opt.selected {
  border-color: var(--ink);
  background: var(--bone-2);
  box-shadow: 4px 4px 0 var(--green);
  font-weight: 600;
  color: var(--ink);
}
.opt.selected::before { background: var(--green); }

/* Honeypot: invisível para humanos, visível para bots */
.hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 0;
  overflow: hidden;
}

/* Checkbox de consentimento (pixel) */
.field-check { margin-bottom: 10px; }
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--graphite);
  line-height: 1.5;
}
.check input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}
.check-box {
  flex: none;
  width: 22px; height: 22px;
  margin-top: 1px;
  border: 1px solid var(--ink);
  background: var(--bone);
  position: relative;
  transition: background .15s steps(2), box-shadow .15s var(--ease);
}
.check-box::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--green);
  transform: scale(0);
  transition: transform .15s steps(3);
}
.check input:checked + .check-box::after { transform: scale(1); }
.check input:focus-visible + .check-box { box-shadow: 3px 3px 0 var(--green-light); }
.check input[aria-invalid="true"] + .check-box { border-color: var(--error); }

/* ---------- Botão de envio + loading ---------- */
.btn-submit .btn-loading { display: none; gap: 6px; }
.btn-submit .btn-loading i {
  width: 8px; height: 8px;
  background: currentColor;
  animation: loadPixel 0.9s steps(3) infinite;
}
.btn-submit .btn-loading i:nth-child(2) { animation-delay: .15s; }
.btn-submit .btn-loading i:nth-child(3) { animation-delay: .3s; }
@keyframes loadPixel { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
.btn-submit.loading { pointer-events: none; opacity: .85; }
.btn-submit.loading .btn-label { display: none; }
.btn-submit.loading .btn-loading { display: inline-flex; }
.btn-submit:disabled { cursor: not-allowed; }

/* Status do formulário (erro de envio) */
.form-status {
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .03em;
  padding: 14px 16px;
  border: 1px solid var(--error);
  color: var(--error);
  background: rgba(192,57,43,.06);
}

.form-micro {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Setas de navegação ---------- */
.form-arrows {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 50;
}
.form-arrows button {
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  background: var(--bone-2);
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(17,17,17,.15);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), opacity .15s var(--ease);
}
.form-arrows button:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--green);
}
.form-arrows button:disabled {
  opacity: .3;
  cursor: default;
}

/* ---------- Página de sucesso ---------- */
.thanks {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 0 100px;
}
.thanks-inner {
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
}
#confirmCanvas {
  display: block;
  margin: 0 auto 36px;
}
.thanks-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.08;
  margin-bottom: 18px;
}
.thanks-text {
  font-size: 17px;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 40px;
}
.thanks-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

/* ---------- Responsivo ---------- */
@media (max-width: 768px) {
  .form-main { padding: 100px 0 110px; align-items: start; }
  .step-actions { flex-wrap: wrap; }
  .step-actions .btn { flex: 1 1 auto; min-height: 52px; }
  .opts .opt { width: 100%; }
  /* setas na região inferior, respeitando safe-area */
  .form-arrows {
    top: auto;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    transform: none;
    flex-direction: row;
  }
  .thanks-actions .btn { width: 100%; }
}
