:root {
  --laranja: #f26524;
  --laranja-escuro: #d9541a;
  --azul-escuro: #05328f;
  --texto: #14213d;
  --suave: #5b6784;
  --borda: #d6dcea;
  --erro: #c62828;
  --ok: #1b8a4b;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--texto);
  background: var(--azul-escuro) url("/img/fundo.webp") center / cover fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topo { padding: 28px 16px 8px; text-align: center; }
.logo { max-width: 260px; width: 70%; height: auto; }
.container { width: 100%; max-width: 720px; margin: 0 auto; padding: 8px 16px 32px; flex: 1; }

.passos { list-style: none; display: flex; gap: 8px; padding: 0; margin: 16px 0; justify-content: center; }
.passos li { color: rgba(255,255,255,.65); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.passos li + li::before { content: ""; width: 24px; height: 1px; background: rgba(255,255,255,.35); margin-right: 2px; }
.passos span { width: 24px; height: 24px; border-radius: 50%; border: 1px solid currentColor; display: inline-grid; place-items: center; font-size: 12px; }
.passos li.ativo { color: #fff; font-weight: 600; }
.passos li.ativo span { background: var(--laranja); border-color: var(--laranja); }
.passos li.feito span { background: #fff; color: var(--azul-escuro); border-color: #fff; }

.cartao { background: #fff; border-radius: 14px; padding: 28px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.cartao h1 { margin: 0 0 8px; font-size: 26px; line-height: 1.2; }
.intro { color: var(--suave); margin: 0 0 20px; }
.centro { text-align: center; }

.grade { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.campo { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.campo.cheio { grid-column: 1 / -1; }
.campo input, .campo select, textarea {
  font: inherit; font-weight: 400; color: var(--texto);
  padding: 11px 12px; border: 1px solid var(--borda); border-radius: 8px; background: #fff; width: 100%;
}
.campo input:focus, .campo select:focus, textarea:focus { outline: 2px solid var(--laranja); outline-offset: 0; border-color: var(--laranja); }
.campo.invalido input, .campo.invalido select { border-color: var(--erro); }
.erro { color: var(--erro); font-size: 13px; font-weight: 400; min-height: 0; margin: 0; }
.dica { color: var(--suave); font-size: 13px; margin: 14px 0; }

.botao {
  font: inherit; font-weight: 700; cursor: pointer; border: 0; border-radius: 8px;
  background: var(--laranja); color: #fff; padding: 13px 22px; width: 100%;
}
.botao:hover { background: var(--laranja-escuro); }
.botao:disabled { opacity: .6; cursor: wait; }
.botao.secundario { background: #fff; color: var(--texto); border: 1px solid var(--borda); }
.botao.secundario:hover { background: #f3f5fa; }
.acoes { display: flex; gap: 12px; margin-top: 16px; }
.acoes .botao { width: auto; flex: 1; }
.acoes .secundario { flex: 0 0 auto; }

.contrato { max-height: 420px; overflow: auto; border: 1px solid var(--borda); border-radius: 10px; padding: 16px 18px; background: #f8f9fd; }
.contrato h2 { font-size: 20px; margin: 0 0 4px; }
.contrato h3 { font-size: 15px; margin: 18px 0 6px; color: var(--azul-escuro); text-transform: uppercase; letter-spacing: .04em; }
.contrato p { margin: 0; }
.contrato ul { margin: 0; padding-left: 20px; }
.contrato li { margin: 4px 0; }
.aceite { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; cursor: pointer; font-weight: 600; }
.aceite input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--laranja); flex: 0 0 auto; }

.pix { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.qr { width: 220px; height: 220px; border: 1px solid var(--borda); border-radius: 10px; display: grid; place-items: center; background: #fff; padding: 8px; }
.qr img { width: 100%; height: 100%; object-fit: contain; }
.qr .qr-vazio { font-size: 13px; color: var(--suave); text-align: center; padding: 12px; }
.rotulo { margin: 0 0 6px; font-weight: 600; font-size: 14px; }
textarea { resize: none; font-size: 13px; word-break: break-all; margin-bottom: 10px; background: #f8f9fd; }
.status { display: flex; align-items: center; gap: 8px; color: var(--suave); font-size: 14px; margin: 14px 0 10px; }
.ponto { width: 10px; height: 10px; border-radius: 50%; background: var(--laranja); animation: pulsa 1.2s infinite; }
@keyframes pulsa { 50% { opacity: .25; } }

.check { width: 72px; height: 72px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 40px; display: grid; place-items: center; margin: 0 auto 16px; }

.rodape { text-align: center; color: rgba(255,255,255,.8); padding: 16px 16px 28px; font-size: 13px; }
.rodape img { max-width: 200px; height: auto; opacity: .95; }
.rodape p { margin: 8px 0 0; }


/* Base mobile-friendly */
.topo { padding-top: max(28px, env(safe-area-inset-top)); }
.container { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.rodape { padding-bottom: max(28px, env(safe-area-inset-bottom)); }
.campo input, .campo select, textarea { min-height: 48px; }
.botao { min-height: 48px; -webkit-tap-highlight-color: transparent; }
.passos em { font-style: normal; }
.contrato { max-height: min(420px, 55dvh); -webkit-overflow-scrolling: touch; }
.aceite { padding: 12px; border: 1px solid var(--borda); border-radius: 10px; }
.aceite input { width: 24px; height: 24px; }
.qr { width: min(100%, 260px); height: auto; aspect-ratio: 1; }
.pix { grid-template-columns: minmax(0, 260px) 1fr; }
img, textarea, input, select { max-width: 100%; }
body { overflow-x: hidden; }

@media (max-width: 720px) {
  body { background-attachment: scroll; }
  .topo { padding-bottom: 0; }
  .logo { max-width: 200px; }
  .container { padding-top: 0; padding-bottom: 20px; }
  .cartao { padding: 22px 18px; border-radius: 16px; }
  .cartao h1 { font-size: 23px; }
  .intro { font-size: 15px; }

  /* etapas compactas: só o rótulo da etapa atual */
  .passos { gap: 6px; margin: 14px 0; }
  .passos li { font-size: 13px; }
  .passos li em { display: none; }
  .passos li.ativo em { display: inline; }
  .passos li + li::before { width: 14px; }

  .grade { grid-template-columns: repeat(6, 1fr); gap: 14px 10px; }
  .grade .campo { grid-column: 1 / -1; font-size: 15px; }
  /* número/bairro e cidade/estado lado a lado */
  .grade .campo.curto { grid-column: span 2; }
  .grade .campo.longo { grid-column: span 4; }

  .contrato { max-height: 42dvh; }
  .acoes { flex-direction: column-reverse; gap: 10px; }
  .acoes .botao, .acoes .secundario { width: 100%; flex: none; }

  /* PIX: no celular o copia-e-cola vem primeiro (o cliente paga no próprio aparelho) */
  .pix { grid-template-columns: 1fr; justify-items: stretch; gap: 18px; }
  .pix-dados { order: -1; width: 100%; }
  .qr { margin: 0 auto; }
  textarea { font-size: 14px; }
}

@media (max-width: 360px) {
  .cartao { padding: 18px 14px; }
  .passos li.ativo em { display: none; }
}

/* Respiro entre os campos e o botão principal dos formulários */
form > .botao { margin-top: 28px; }
form > .dica + .botao, form > .erro + .botao { margin-top: 10px; }
#form-basico .grade { gap: 20px 16px; }
#t1 + .intro { margin-bottom: 26px; }
