/* ==========================================================
   FORMULÁRIOS PÚBLICOS · PANTA RHEI
   Visual aprovado do formulário de início (Instrument + #F26A10).
   Todo formulário do motor usa este arquivo.
   Cada opção é um input nativo (radio/checkbox) escondido;
   a "roupa" muda com label:has(:checked). Teclado e leitor de tela funcionam sozinhos.
   ========================================================== */

@font-face { font-family: 'Instrument Sans'; src: url(fontes/instrument-sans.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url(fontes/instrument-serif-italico.woff2) format('woff2'); font-style: italic; font-weight: 400; font-display: swap; }

:root {
  --papel: #F7F5F1;
  --branco: #FFFFFF;
  --tinta: #110E09;
  --tinta-2: #3A342C;
  --apoio: #5E574E;
  --placeholder: #857E74;
  --linha: #DCD8D1;
  --linha-suave: #E6E2DB;
  --marcador: #A9A298;
  --laranja: #F26A10;
  --laranja-tx: #C2500A;   /* laranja para texto no claro (4,9:1) */
  --laranja-wash: #FFF3EA;
  --erro: #B42318;
  --erro-wash: #FEF3F2;
  --sans: 'Instrument Sans', system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body { margin: 0; background: var(--papel); color: var(--tinta); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, p, fieldset, legend { margin: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
a { color: var(--laranja-tx); }
i { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; font-size: 1.12em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--laranja); outline-offset: 2px; }

/* Input nativo escondido, mas acessível */
.vo { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
label:has(.vo:focus-visible) { outline: 2px solid var(--laranja); outline-offset: 2px; }
.so-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.armadilha { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Topo ---------- */
.topo { position: relative; overflow: hidden; background: var(--tinta); color: #FFF; padding: 22px 20px 44px; }
.topo-luz { position: absolute; right: -60px; top: 20px; width: 260px; height: 260px; border-radius: 50%; background: var(--laranja); opacity: .18; filter: blur(70px); }
.topo-in { position: relative; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.topo-logo { width: 120px; height: 36px; object-fit: contain; }
.topo-cursor { position: absolute; right: -6px; top: 28px; width: 120px; height: 120px; transform: rotate(-4deg); }
.topo-rotulo { margin-top: 40px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #BDB6AC; }
.topo h1 { max-width: 520px; font-size: clamp(40px, 9vw, 52px); line-height: .98; font-weight: 600; letter-spacing: -.05em; word-spacing: .08em; }
.topo p { max-width: 480px; font-size: 16px; line-height: 1.55; color: #CFC9C0; }

/* ---------- Progresso (gruda no topo ao rolar) ---------- */
.progresso { position: sticky; top: 0; z-index: 5; display: flex; justify-content: center; padding: 12px 20px; background: rgba(247, 245, 241, .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--linha-suave); }
.progresso-in { width: 100%; max-width: 640px; display: flex; align-items: center; gap: 12px; }
.progresso-trilho { position: relative; flex: 1; height: 3px; border-radius: 3px; background: var(--linha-suave); }
.progresso-barra { position: absolute; inset: 0 auto 0 0; width: var(--pct, 0%); border-radius: 3px; background: var(--laranja); transition: width .35s var(--ease); }
.progresso-texto { min-width: 96px; text-align: right; font-size: 13px; color: var(--apoio); font-variant-numeric: tabular-nums; }

/* ---------- Corpo ---------- */
.corpo { max-width: 680px; margin: 0 auto; padding: 24px 16px 64px; }
.formulario { display: flex; flex-direction: column; gap: 16px; }

.block { display: flex; flex-direction: column; gap: 26px; padding: 28px 22px; border-radius: 24px; background: var(--branco); border: 1px solid var(--linha-suave); animation: surgir .4s var(--ease) both; }
.bh { display: flex; flex-direction: column; gap: 6px; }
.bh h2 { font-size: 30px; font-weight: 600; letter-spacing: -.04em; line-height: 1; word-spacing: .06em; }
.bh p { font-size: 14.5px; line-height: 1.5; color: var(--apoio); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--laranja-tx); }
@keyframes surgir { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Pergunta ---------- */
.q { display: flex; flex-direction: column; gap: 10px; }
.ql { font-size: 16px; font-weight: 500; line-height: 1.35; }
.qh { margin-top: -4px; font-size: 13px; color: var(--apoio); }
.input { width: 100%; height: 54px; padding: 0 16px; border: 1px solid var(--linha); border-radius: 12px; background: var(--branco); font: inherit; font-size: 16px; color: var(--tinta); transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--placeholder); }
.input:focus { outline: none; border-color: var(--tinta); box-shadow: 0 0 0 3px rgba(242, 106, 16, .18); }
textarea.input { height: 108px; padding: 14px 16px; resize: vertical; }
.q-erro { display: flex; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--erro); }
.q-erro::before { content: "!"; display: inline-grid; place-items: center; flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--erro); color: #FFF; font-size: 11px; font-weight: 700; }
.q.com-erro .input { border-color: var(--erro); box-shadow: 0 0 0 3px var(--erro-wash); }

/* ---------- Opções ---------- */
.ops { display: flex; flex-wrap: wrap; gap: 8px; }
.ops-opcao, .ops-classe, .ops-servico { display: flex; flex-direction: column; gap: 8px; }
.ops-servico { gap: 10px; }
.ops-pacote, .ops-cartao, .ops-bloco, .ops-opcao[style] { display: grid; grid-template-columns: repeat(var(--colunas, 2), minmax(0, 1fr)); gap: 10px; }
.ops-bloco { gap: 8px; }
label { cursor: pointer; }

.chip { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--linha); border-radius: 999px; background: var(--branco); font-size: 15px; transition: all .15s; }
.chip:has(:checked) { background: var(--tinta); border-color: var(--tinta); color: #FFF; }

.opt { position: relative; display: flex; align-items: center; min-height: 56px; padding: 14px 16px; border: 1px solid var(--linha); border-radius: 14px; background: var(--branco); font-size: 15.5px; font-weight: 500; transition: all .15s; }
.opt:has(:checked), .pk:has(:checked), .tile:has(:checked) { border-color: var(--laranja); background: var(--laranja-wash); box-shadow: 0 0 0 1px var(--laranja) inset; }

.day { position: relative; display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid var(--linha); border-radius: 50%; background: var(--branco); font-size: 15px; font-weight: 600; transition: all .15s; }
.day:has(:checked) { background: var(--laranja); border-color: var(--laranja); }

.svc { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--linha); border-radius: 16px; background: var(--branco); transition: all .15s; }
.svc strong { display: block; font-size: 17px; font-weight: 600; }
.svc .d { display: block; margin-top: 2px; font-size: 13.5px; color: var(--apoio); }
.svc .box { display: grid; place-items: center; flex-shrink: 0; width: 24px; height: 24px; border: 1.5px solid var(--marcador); border-radius: 7px; color: transparent; transition: all .15s; }
.svc:has(:checked) { background: var(--tinta); border-color: var(--tinta); color: #FFF; }
.svc:has(:checked) .d { color: #CFC9C0; }
.svc:has(:checked) .box { background: var(--laranja); border-color: var(--laranja); color: var(--tinta); }

.ops-segmento { display: flex; gap: 0; border: 1px solid var(--linha); border-radius: 16px; overflow: hidden; }
.seg { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; border-right: 1px solid var(--linha); background: var(--branco); transition: background .15s; }
.seg:last-child { border-right: 0; }
.seg strong { font-size: 16px; font-weight: 600; }
.seg small { font-size: 11px; font-weight: 500; }
.seg:has(:checked) { background: var(--laranja); }

.cls { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 58px; padding: 12px 16px; border: 1px solid var(--linha); border-radius: 14px; background: var(--branco); transition: all .15s; }
.cls strong { font-size: 16px; font-weight: 600; }
.cls span { font-size: 13px; opacity: .75; text-align: right; }
.cls:has(:checked) { background: var(--tinta); border-color: var(--tinta); color: #FFF; }

.pk { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--linha); border-radius: 16px; background: var(--branco); transition: all .15s; }
.pk .pontos { display: flex; gap: 4px; }
.pk .pontos i { width: 12px; height: 16px; border-radius: 3px; background: var(--laranja); }
.pk strong { font-size: 16px; font-weight: 600; }
.pk > span:last-child { font-size: 13px; color: var(--apoio); }

.bigc { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 100px; padding: 16px; border: 1px solid var(--linha); border-radius: 16px; background: var(--branco); transition: all .15s; }
.bigc strong { font-size: 16px; font-weight: 600; }
.bigc:has(:checked) { background: var(--tinta); border-color: var(--tinta); color: #FFF; }
.bigc:has(:checked) svg { color: var(--laranja); }

.tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 86px; padding: 12px 6px; border: 1px solid var(--linha); border-radius: 14px; background: var(--branco); font-size: 13.5px; font-weight: 600; text-align: center; transition: all .15s; }
.tile:has(:checked) svg { color: var(--laranja-tx); }

/* Linha do tempo e faixa: pontos numa trilha; o cursor laranja marca a escolha */
.trilha { position: relative; display: flex; padding-top: 30px; }
.trilha-linha, .trilha-cheia { position: absolute; left: calc(50% / var(--total)); right: calc(50% / var(--total)); top: 38px; height: 2px; background: var(--linha); }
.node { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--apoio); font-size: 12.5px; line-height: 1.2; text-align: center; }
.node .dot { position: relative; z-index: 1; width: 18px; height: 18px; border: 2px solid #CFC9C0; border-radius: 50%; background: var(--branco); transition: all .15s; }
.node .cursor { position: absolute; top: -26px; left: calc(50% - 2px); display: none; }
.node:has(:checked) { color: var(--tinta); font-weight: 600; }
.node:has(:checked) .dot, .node.antes .dot { border-color: var(--laranja); background: var(--laranja); }
.node:has(:checked) .dot { transform: scale(1.25); }
.node:has(:checked) .cursor { display: block; }

.faixa-caixa { display: flex; flex-direction: column; gap: 18px; padding: 18px 14px 14px; border: 1px solid var(--linha-suave); border-radius: 16px; background: var(--branco); }
.faixa-valor { font-size: 24px; font-weight: 600; letter-spacing: -.03em; text-align: center; color: var(--placeholder); }
.faixa-valor.cheio { color: var(--tinta); }
.faixa { padding-top: 4px; }
.faixa .trilha-linha, .faixa .trilha-cheia { top: 12px; height: 4px; border-radius: 4px; background: var(--linha-suave); }
.faixa .trilha-cheia { right: auto; width: calc((100% - 100% / var(--total)) * var(--fracao, 0)); background: var(--laranja); transition: width .25s var(--ease); }

.ops-barras { display: flex; align-items: flex-end; gap: 6px; height: 130px; }
.st { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; height: 100%; color: var(--apoio); font-size: 11.5px; line-height: 1.25; text-align: center; }
.st .bar { display: block; width: 100%; border-radius: 8px; background: var(--linha-suave); transition: background .15s; }
.st:has(:checked) { color: var(--tinta); font-weight: 600; }
.st:has(:checked) .bar { background: var(--laranja); }

/* ---------- Alternar ---------- */
.toggle { position: relative; flex-direction: row; align-items: center; gap: 14px; width: 100%; padding: 16px; border: 1px dashed var(--marcador); border-radius: 16px; background: var(--papel); }
.toggle strong { display: block; font-size: 15.5px; font-weight: 600; }
.toggle span span { font-size: 13px; color: var(--apoio); }
.chave { position: relative; flex-shrink: 0; width: 46px; height: 28px; border-radius: 999px; background: #CFC9C0; transition: background .2s; }
.chave::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #FFF; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); transition: transform .2s var(--ease); }
.toggle:has(:checked) .chave { background: var(--laranja); }
.toggle:has(:checked) .chave::after { transform: translateX(18px); }

/* ---------- Agrupamentos ---------- */
.grupo { display: flex; flex-direction: column; gap: 26px; }
.reveal { display: flex; flex-direction: column; gap: 22px; padding-left: 14px; border-left: 2px solid var(--laranja); animation: surgir .3s var(--ease) both; }
.reveal > .eyebrow { margin-bottom: -10px; }
.linha { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sub, .dark { display: flex; flex-direction: column; gap: 22px; padding: 20px 16px; border-radius: 20px; }
.sub { background: var(--papel); }
.dark { gap: 16px; background: var(--tinta); color: #FFF; }
.subh { display: flex; align-items: center; gap: 10px; }
.subn { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--tinta); color: #FFF; font-size: 12.5px; font-weight: 700; }
.dark .subn { background: var(--laranja); color: var(--tinta); }
.subt { font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.sub-texto { margin-top: -6px; font-size: 13.5px; line-height: 1.5; color: var(--apoio); }
.dark .sub-texto { color: #BDB6AC; }
.dark .q { padding-bottom: 14px; border-bottom: 1px solid #2A241E; }
.dark .q:last-child { padding-bottom: 0; border-bottom: 0; }
.dark .ql { font-size: 15px; font-weight: 600; }
.dark .ops { gap: 6px; }
.dark .q-erro { color: #FDA29B; }
.mini { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 13px; border: 1px solid var(--tinta-2); border-radius: 999px; color: #E6DACA; font-size: 13.5px; transition: all .15s; }
.mini:has(:checked) { background: var(--laranja); border-color: var(--laranja); color: var(--tinta); font-weight: 600; }
.etapas-tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.stepk { min-width: 0; padding: 8px 2px; border-radius: 10px; background: var(--papel); color: var(--apoio); font-size: 10px; line-height: 1.35; letter-spacing: .03em; text-transform: uppercase; text-align: center; overflow-wrap: anywhere; }

.note { padding: 14px 16px; border: 1px dashed var(--laranja); border-radius: 14px; background: var(--papel); color: var(--tinta-2); font: inherit; font-size: 14px; line-height: 1.5; text-align: left; }
button.atalho { cursor: pointer; width: 100%; }
@media (hover: hover) { button.atalho:hover { background: var(--laranja-wash); } }

/* ---------- Arquivos ---------- */
.upload { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; border: 1.5px dashed var(--marcador); border-radius: 14px; background: var(--papel); font-size: 15px; font-weight: 500; transition: border-color .15s, background .15s; }
.upload.arrastando { border-color: var(--laranja); background: var(--laranja-wash); }
.arquivos-lista { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.arquivos-lista:empty { display: none; }
.arquivos-lista li { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border: 1px solid var(--linha-suave); border-radius: 12px; background: var(--branco); font-size: 14px; }
.arquivos-lista .nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arquivos-lista small { color: var(--apoio); font-variant-numeric: tabular-nums; }
.arquivos-lista button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--apoio); font-size: 18px; cursor: pointer; }
@media (hover: hover) { .arquivos-lista button:hover { background: var(--papel); color: var(--tinta); } }

/* ---------- Aceite e envio ---------- */
.aceite { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; line-height: 1.5; color: var(--apoio); }
.aceite input { flex-shrink: 0; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--laranja); }
.envio { display: flex; flex-direction: column; gap: 12px; }
.envio-erro { padding: 12px 16px; border-radius: 14px; background: var(--erro-wash); color: var(--erro); font-size: 14px; font-weight: 500; }
.botao-enviar { display: flex; align-items: center; justify-content: center; gap: 10px; height: 60px; border: 0; border-radius: 999px; background: var(--tinta); color: #FFF; font: inherit; font-size: 17px; font-weight: 600; cursor: pointer; transition: transform .15s, opacity .15s; }
.botao-enviar:active { transform: scale(.98); }
.botao-enviar[aria-busy="true"] { opacity: .7; pointer-events: none; }
.botao-enviar[aria-busy="true"] svg { animation: girar 1s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

.sucesso { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 48px 24px; border-radius: 24px; background: var(--branco); border: 1px solid var(--linha-suave); text-align: center; animation: surgir .5s var(--ease) both; }
.sucesso:focus { outline: none; }
.sucesso h2 { font-size: 36px; font-weight: 600; letter-spacing: -.04em; line-height: 1.05; word-spacing: .06em; }
.sucesso p { max-width: 420px; color: var(--apoio); }

.rodape { padding-top: 32px; text-align: center; font-size: 13px; color: var(--apoio); }

/* ---------- Páginas simples (erro, privacidade) ---------- */
.pagina-simples { min-height: 100dvh; }
.simples { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 100dvh; padding: 24px; text-align: center; }
.simples h1 { font-size: 32px; font-weight: 600; letter-spacing: -.04em; }
.simples p { max-width: 380px; color: var(--apoio); }
.politica { max-width: 720px; margin: 0 auto; padding: 48px 20px 80px; }
.politica-data { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--apoio); }
.politica h1 { margin: 12px 0 8px; font-size: clamp(36px, 6vw, 52px); font-weight: 600; letter-spacing: -.05em; line-height: 1; word-spacing: .08em; }
.politica h2 { margin: 40px 0 12px; font-size: 22px; font-weight: 600; letter-spacing: -.03em; }
.politica p, .politica li { color: var(--tinta-2); line-height: 1.7; }
.politica p + p { margin-top: 12px; }
.politica ul { margin: 8px 0 0; padding-left: 20px; }
.politica li + li { margin-top: 6px; }

@media (min-width: 640px) {
  .block { padding: 36px 32px; }
  .sub, .dark { padding: 24px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
