:root {
  --green: #007b62;
  --dark: #123a34;
  --brand: #0aac87;
  --muted: #51675f;
  --line: #d7e4df;
  --bg: #f3f7f5;
  --paper: #ffffff;
  --field: #7f968d;       /* borda de campo: 3:1 sobre branco (WCAG 1.4.11) */
  --placeholder: #647a72; /* 4,6:1 sobre branco */
  --soft: #e8f3ef;
  --error: #8a1c1c;
  --radius: 8px;
  --radius-card: 16px;
  --font: Arial, "Helvetica Neue", sans-serif;
  --gutter: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--dark);
  font: 16px/1.5 var(--font); -webkit-text-size-adjust: 100%;
  min-height: 100vh; display: flex; flex-direction: column;
}
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--dark); color: #fff; padding: 10px 14px; border-radius: var(--radius); z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- Cabeçalho: foto escurecida como identidade; logo grande, texto só de apoio ---------- */
.top {
  position: relative; isolation: isolate; color: #fff;
  /* celular: recorte com rolos etiquetados; telas largas: faixa panorâmica (regra no @media abaixo) */
  background: var(--dark) url("/assets/img/cabecalho-mobile.jpg") center 30% / cover;
}
.top::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(18,58,52,.88) 0%, rgba(18,58,52,.62) 55%, rgba(18,58,52,.34) 100%);
}
.top-inner { max-width: calc(680px + 2 * var(--gutter)); margin: 0 auto; padding: 26px var(--gutter) 70px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.logo { width: 196px; height: auto; display: block; }
.top-label { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #dcece6; }

/* ---------- Cartão ---------- */
.card {
  width: calc(100% - 2 * var(--gutter)); max-width: 680px; margin: -48px auto 0; position: relative;
  background: var(--paper); border-radius: var(--radius-card); border: 1px solid var(--line);
  padding: 20px 20px 24px; min-width: 0;
  box-shadow: 0 1px 2px rgba(18,58,52,.05), 0 16px 40px rgba(18,58,52,.10);
}
.progress-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.progress-name { font-weight: 700; color: var(--dark); letter-spacing: .02em; }
.progress { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin-bottom: 28px; }
.progress i { height: 4px; border-radius: 99px; background: var(--line); }
.progress i.on { background: var(--green); }

.stage { outline: none; }
.stage.enter { animation: enter .2s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.step-title { font-size: 24px; line-height: 1.2; margin: 0; letter-spacing: -.02em; outline: none; text-wrap: balance; }
.step-help { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.stage > form { margin-top: 24px; }

.fields { display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > label, .field > .label { font-weight: 700; font-size: 15px; display: flex; gap: 8px; align-items: baseline; }
.tag { font-size: 13px; font-weight: 400; color: var(--muted); }
.help { font-size: 14px; color: var(--muted); margin: -4px 0 0; }
.msg { font-size: 14px; color: var(--error); margin: 0; font-weight: 700; }
.msg::before { content: "⚠ "; }

input[type=text], input[type=password], input[type=email], input[type=number], input[type=url], input[type=date], select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--dark); background: #fff;
  border: 1px solid var(--field); border-radius: var(--radius); padding: 13px 14px; min-height: 50px;
}
select { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23123a34' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center; padding-right: 40px; }
textarea { resize: none; overflow: hidden; min-height: 132px; line-height: 1.5; }
::placeholder { color: var(--placeholder); opacity: 1; }
.has-error input, .has-error select, .has-error textarea, .has-error .choices, .has-error .dropzone { border-color: var(--error); }
.has-error input, .has-error select, .has-error textarea { border-width: 2px; padding: 12px 13px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--brand); outline-offset: 0; border-color: var(--green); }

/* Escolhas */
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 10px; text-align: left; font: inherit; font-size: 15px; font-weight: 700; color: var(--dark);
  background: #fff; border: 1px solid var(--field); border-radius: var(--radius); padding: 12px; min-height: 52px; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.choice .check { flex: none; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--field); display: grid; place-items: center; color: transparent; }
@media (hover: hover) { .choice:hover { border-color: var(--green); } }
.choice[aria-pressed=true] { border-color: var(--green); background: var(--soft); box-shadow: inset 0 0 0 1px var(--green); }
.choice[aria-pressed=true] .check { background: var(--green); border-color: var(--green); color: #fff; }
.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 320px; }
.yesno .choice { justify-content: center; }
.yesno .choice .check { display: none; }

.shortcuts { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 14px; font-weight: 700; color: var(--green); background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 8px 14px; min-height: 40px; cursor: pointer; }
.chip:hover { border-color: var(--green); background: var(--soft); }
.date-wrap { display: flex; flex-direction: column; gap: 10px; }

.sub { display: flex; flex-direction: column; gap: 22px; padding: 18px; background: var(--bg); border-radius: var(--radius); }

/* Links e arquivos */
.links { display: flex; flex-direction: column; gap: 8px; }
.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; min-width: 0; }
.ghost { font: inherit; font-size: 15px; font-weight: 700; color: var(--dark); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 14px; min-height: 50px; cursor: pointer; }
.ghost:hover { border-color: var(--field); }
.link-add { align-self: flex-start; min-height: 44px; color: var(--green); border-color: transparent; background: none; padding-left: 0; }

.dropzone { border: 1.5px dashed var(--field); border-radius: var(--radius); padding: 24px 16px; text-align: center; background: var(--bg); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.dropzone.over { border-color: var(--green); background: var(--soft); }
.dropzone p { margin: 0; font-size: 15px; color: var(--muted); }
.files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.files:empty { display: none; }
.file { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 6px 8px 14px; }
.file.bad { border-color: var(--error); }
.file-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.file-name { flex: 1 1 140px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 15px; }
.file-size { font-size: 13px; color: var(--muted); white-space: nowrap; }
.file-err { flex: 1 1 100%; font-size: 13px; color: var(--error); font-weight: 700; }
.file-bar { flex: 1 1 100%; height: 4px; border-radius: 99px; background: var(--line); position: relative; overflow: hidden; margin-top: 4px; }
.file-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--pct, 0%); background: var(--green); transition: width .15s; }
.file .ghost { min-height: 44px; border-color: transparent; color: var(--error); }

/* Navegação */
.nav { display: flex; align-items: center; gap: 12px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.nav .spacer { flex: 1; }
.btn { font: inherit; font-weight: 700; font-size: 16px; border-radius: var(--radius); min-height: 50px; padding: 0 24px; cursor: pointer; border: 1px solid transparent; }
.btn.primary { background: var(--green); color: #fff; min-width: 168px; }
.btn.primary:hover { background: #00664f; }
.btn.back { white-space: nowrap; background: none; color: var(--muted); padding: 0 8px; min-width: 0; }
.btn.back:hover { color: var(--dark); }
.btn.skip-btn { background: none; color: var(--muted); padding: 0 12px; text-decoration: underline; text-underline-offset: 3px; }
.btn[disabled] { opacity: .65; cursor: progress; }
.privacy { font-size: 13px; color: var(--muted); margin: 16px 0 0; }

.notice { display: flex; gap: 12px; justify-content: space-between; align-items: center; background: var(--soft); border-radius: var(--radius); padding: 4px 6px 4px 14px; font-size: 14px; margin-bottom: 20px; }
.notice button { font: inherit; font-size: 14px; background: none; border: 0; color: var(--green); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; }

/* Revisão: lista corrida, sem caixas dentro de caixa */
.review { display: flex; flex-direction: column; }
.rev-block { padding: 16px 0; border-top: 1px solid var(--line); }
.rev-block:first-child { border-top: 0; padding-top: 0; }
.rev-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.rev-head h3 { margin: 0; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rev-head .edit { font: inherit; font-size: 14px; font-weight: 700; color: var(--green); background: none; border: 0; min-height: 44px; padding: 0 4px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.rev-list { margin: 0; display: grid; gap: 12px; }
.rev-list div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; }
.rev-list dt { font-size: 14px; color: var(--muted); }
.rev-list dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.rev-empty { color: var(--muted); font-size: 14px; margin: 0; }

/* Sucesso */
.success { display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; padding-top: 8px; }
.ok-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--soft); color: var(--green); display: grid; place-items: center; }
.success .step-title { margin-top: 4px; }
.success p { margin: 0; color: var(--muted); }
.protocol-box { background: var(--bg); border-radius: var(--radius); padding: 14px 28px; display: flex; flex-direction: column; gap: 2px; }
.protocol-box span { font-size: 13px; color: var(--muted); }
.protocol-box strong { font-size: 28px; letter-spacing: -.02em; color: var(--green); }
.demo { background: #fff6e0; color: #5c4200 !important; border-radius: var(--radius); padding: 8px 12px; font-size: 13px; }
details.summary { width: 100%; text-align: left; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 6px; }
details.summary summary { cursor: pointer; font-weight: 700; font-size: 15px; color: var(--green); min-height: 44px; display: flex; align-items: center; }
details.summary .review { margin-top: 12px; }
.success .nav { width: 100%; border-top: 0; margin-top: 8px; padding-top: 0; justify-content: center; flex-wrap: wrap; }
.btn.outline { background: #fff; border-color: var(--line); color: var(--dark); }
.btn.outline:hover { border-color: var(--field); }

.loading { color: var(--muted); }
.foot { text-align: center; font-size: 13px; color: var(--muted); padding: 28px var(--gutter) 32px; margin-top: auto; }

/* ---------- Telas maiores ---------- */
@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .top { background-image: url("/assets/img/cabecalho.jpg"); background-position: 50% 50%; }
  .top::before { background: linear-gradient(90deg, rgba(18,58,52,.95) 0%, rgba(18,58,52,.82) 34%, rgba(18,58,52,.4) 62%, rgba(18,58,52,.22) 100%); }
  .top-inner { padding-top: 34px; padding-bottom: 112px; align-items: flex-start; text-align: left; gap: 14px; }
  .logo { width: 172px; }
  .card { padding: 28px 40px 36px; margin-top: -56px; }
}
@media (max-width: 560px) {
  .choices { grid-template-columns: 1fr 1fr; }
  .rev-list div { grid-template-columns: 1fr; gap: 2px; }
  .nav { flex-wrap: wrap; gap: 4px 12px; }
  .nav .btn.primary { order: -1; flex: 1 1 100%; min-width: 0; margin-bottom: 8px; }
  .success .nav .btn { flex: 1 1 100%; }
}
@media (max-width: 360px) { .choices { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage.enter { animation: none; }
  .choice { transition: none; }
}

/* isca anti-robô: fora da tela, invisível para quem usa o formulário */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
