:root {
  --bg: #F4F5F1; --card: #FFFFFF; --texto: #1E2128; --sub: #5E6372; --dim: #8A8F9C;
  --linha: #DADDE3; --linha-lt: #ECEEF1; --verde: #84E040; --verde-esc: #3F7A12; --verde-bg: #EEF8E4;
  --grafite: #16181D; --erro: #C62828; --erro-bg: #FDECEC; --r: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--texto);
  font-size: 16px; line-height: 1.5; min-height: 100vh; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--verde-esc); }

/* topo */
.topo { position: sticky; top: 0; z-index: 10; background: var(--grafite); color: #fff; padding-top: env(safe-area-inset-top); }
.topo-in { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.logo { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.marca { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.marca b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marca span { font-size: 12.5px; color: rgba(255,255,255,.65); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.salvo { font-size: 12.5px; color: rgba(255,255,255,.7); white-space: nowrap; }
.salvo.ok { color: var(--verde); }
.salvo.erro { color: #FF9A9A; }
.barra { height: 4px; background: rgba(255,255,255,.12); }
.barra-in { height: 100%; width: 0; background: var(--verde); transition: width .3s ease; }

.conteudo { max-width: 760px; margin: 0 auto; padding: 20px 16px 24px; }
.carregando { color: var(--sub); text-align: center; padding: 40px 0; }

/* blocos */
h1 { font-size: 24px; line-height: 1.25; font-weight: 650; margin-bottom: 8px; }
h2 { font-size: 21px; line-height: 1.3; font-weight: 650; margin-bottom: 4px; }
.lead { color: var(--sub); margin-bottom: 20px; }
.nota { color: var(--sub); font-size: 14px; margin: 2px 0 16px; }
.cartao { background: var(--card); border: 1px solid var(--linha-lt); border-radius: var(--r); padding: 18px 16px; margin-bottom: 14px; }
.aviso { background: var(--verde-bg); border-left: 3px solid var(--verde); border-radius: 8px; padding: 12px 14px; font-size: 14.5px; margin-bottom: 16px; }
.aviso.erro { background: var(--erro-bg); border-left-color: var(--erro); color: var(--erro); }

/* pergunta */
.q { margin-bottom: 22px; }
.q:last-child { margin-bottom: 4px; }
.q-titulo { font-weight: 600; font-size: 16px; display: flex; gap: 8px; }
.q-num { color: var(--verde-esc); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.q-ajuda { color: var(--sub); font-size: 14px; margin: 2px 0 0; }
.q-dica { color: var(--dim); font-size: 13px; }
.q-corpo { margin-top: 10px; }

input[type=text], input[type=tel], textarea {
  width: 100%; border: 1px solid var(--linha); border-radius: 10px; background: #fff; padding: 11px 12px; min-height: 46px;
  font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 88px; }
input:focus, textarea:focus { border-color: var(--verde-esc); box-shadow: 0 0 0 3px rgba(132,224,64,.25); }
.campo { margin-bottom: 14px; }
.campo label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.isca { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* opções */
.ops { display: grid; gap: 8px; }
.op { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid var(--linha); border-radius: 10px;
  background: #fff; cursor: pointer; min-height: 46px; }
.op:has(input:checked) { border-color: var(--verde-esc); background: var(--verde-bg); }
.op > input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--verde-esc); flex-shrink: 0; }
.op-txt { flex: 1; min-width: 0; }
.op-extra { display: block; margin-top: 8px; }
.op-extra[hidden] { display: none; }
.ops.inline { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.ops.inline .op { justify-content: center; }

/* tabela → cartões no celular, tabela no computador */
.tab { display: grid; gap: 10px; }
.tab-cab { display: none; }
.tab-lin { border: 1px solid var(--linha); border-radius: 10px; background: #fff; padding: 10px 12px; display: grid; gap: 8px 10px;
  grid-template-columns: 1fr 1fr; }  /* celular: campos 2 a 2 (abre | fecha) */
.tab-lin > .tab-rot, .tab-lin > .cel-check { grid-column: 1 / -1; }
.tab-lin > .cel:only-of-type, .tab-lin > .cel:last-child:nth-child(odd) { grid-column: 1 / -1; }
.tab-rot { font-weight: 600; font-size: 15px; }
.cel label { display: block; font-size: 13px; color: var(--sub); margin-bottom: 3px; }
.cel input[type=text] { min-height: 42px; padding: 8px 10px; }
.cel-check { display: flex; align-items: center; gap: 8px; }
.cel-check input { width: 22px; height: 22px; accent-color: var(--verde-esc); }
.mais-linha { justify-self: start; }
@media (min-width: 720px) {
  .tab { gap: 0; border: 1px solid var(--linha); border-radius: 10px; overflow: hidden; background: #fff; }
  .tab-cab, .tab-lin { display: grid; grid-template-columns: var(--cols); gap: 0; border: 0; border-radius: 0; padding: 0; }
  .tab-lin > .tab-rot, .tab-lin > .cel-check, .tab-lin > .cel { grid-column: auto !important; }
  .tab-cab { background: #F2F4EE; font-size: 13px; font-weight: 600; color: var(--sub); }
  .tab-cab > div { padding: 8px 10px; }
  .tab-lin { border-top: 1px solid var(--linha-lt); }
  .tab-lin > * { padding: 6px; }
  .tab-rot { padding: 10px; font-size: 14.5px; display: flex; align-items: center; }
  .cel label { position: absolute; left: -9999px; }
  .cel input[type=text] { border-color: var(--linha); background: #fff; }
  .cel input[type=text]:focus { border-color: var(--verde-esc); background: #fff; }
  .cel-check { justify-content: center; }
  .mais-linha { margin: 8px; }
}

/* escolha do tipo de negócio */
.tipos { display: grid; gap: 10px; margin: 6px 0 18px; }
.tipo { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px; border: 1px solid var(--linha); border-radius: var(--r);
  background: #fff; cursor: pointer; }
.tipo:has(input:checked) { border-color: var(--verde-esc); background: var(--verde-bg); }
.tipo > input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--verde-esc); flex-shrink: 0; }
.tipo b { display: block; font-size: 16px; font-weight: 600; }
.tipo small { display: block; color: var(--sub); font-size: 13.5px; }
.grupo-tit { font-size: 13px; color: var(--sub); font-weight: 600; margin: 14px 0 6px; }
@media (min-width: 620px) { .tipos { grid-template-columns: 1fr 1fr; } }

/* arquivos */
.arq-cat { margin-bottom: 16px; }
.arq-cat > b { display: block; font-size: 15px; }
.arq-cat > small { color: var(--sub); font-size: 13.5px; }
.arq-lista { list-style: none; margin-top: 8px; display: grid; gap: 6px; }
.arq-lista li { display: flex; align-items: center; gap: 8px; font-size: 14px; background: #F7F8F5; border-radius: 8px; padding: 6px 6px 6px 10px; }
.arq-lista span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arq-env { margin-top: 8px; }
.arq-env input[type=file] { display: none; }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid transparent; font-weight: 600; font-size: 15.5px; cursor: pointer; text-decoration: none; }
.btn-prim { background: var(--grafite); color: #fff; }
.btn-prim:disabled { opacity: .45; cursor: not-allowed; }
.btn-verde { background: var(--verde); color: var(--grafite); }
.btn-ghost { background: #fff; border-color: var(--linha); color: var(--texto); }
.btn-peq { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.btn-x { min-height: 34px; min-width: 34px; padding: 0; border-radius: 8px; background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 18px; }
.btn-x:hover { color: var(--erro); background: var(--erro-bg); }
.btn-largo { width: 100%; }

.rodape { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--linha); z-index: 10;
  padding-bottom: env(safe-area-inset-bottom); }
.rodape-in { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.rodape .btn { flex: 0 0 auto; }
.etapa { flex: 1; text-align: center; font-size: 13.5px; color: var(--sub); }

.retomar { display: flex; gap: 8px; margin-top: 8px; }
.retomar input { font-size: 14px; min-height: 40px; }
.fim { text-align: center; padding: 20px 0; }
.fim .icone { font-size: 44px; margin-bottom: 8px; }
.fim .btn { margin-top: 10px; }
