:root {
  --bg: #F8F8F6;
  --surface: #FFFFFF;
  --ink: #1F2A44;
  --soft: #6B6F7A;
  --line: #E3E3E0;
  --hover: #F0F0EC;
  --accent: #1F2A44;
  --accent-soft: #E8EBF2;
  --gold: #B8893B;
  --error: #B3261E;
  --error-soft: #FBEDEC;
  --radius: 14px;
  --col: 520px;
  --gutter: 20px;
  --sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- topo ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  padding-top: env(safe-area-inset-top);
}
.top-row {
  max-width: var(--col); margin: 0 auto;
  height: 52px; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 18px; letter-spacing: -.01em; text-transform: lowercase; }
.brand-mark { height: 27px; width: auto; }
.back {
  position: absolute; left: calc(var(--gutter) - 10px);
  width: 40px; height: 40px; border: 0; background: none; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
}
.back[hidden] { display: none; }
.back:hover { background: var(--hover); }
.back svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.progress { height: 3px; background: var(--line); }
.progress-fill { height: 100%; width: 0; background: var(--gold); transition: width .3s ease; }

/* ---------- conteúdo ---------- */
.wrap {
  max-width: var(--col); margin: 0 auto;
  padding: 36px var(--gutter) calc(120px + env(safe-area-inset-bottom));
  outline: none;
}
h1, h2 { margin: 0 0 10px; font-weight: 700; letter-spacing: -.01em; }
h1 { font-weight: 600; font-size: 36px; line-height: 1.1; letter-spacing: -.02em; }
h2 { font-size: 25px; line-height: 1.25; }
.lead { margin: 0 0 28px; color: var(--soft); font-size: 17px; }
.muted { color: var(--soft); font-size: 15px; }
.count { margin: 0 0 6px; color: var(--soft); font-size: 14px; font-weight: 500; }

/* ---------- campos ---------- */
.field { margin: 0 0 20px; border: 0; padding: 0; min-width: 0; }
.field label.input-label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.help { display: block; color: var(--soft); font-size: 14px; margin: -2px 0 8px; }
input[type=text], input[type=email], input[type=tel], input[type=number], textarea {
  width: 100%; padding: 14px 16px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface); font-size: 17px;
  transition: border-color .15s;
}
input:focus, textarea:focus { border-color: var(--accent); outline: none; }
textarea { min-height: 120px; resize: vertical; }

/* opções: linhas largas, fáceis de tocar */
.options { display: grid; gap: 10px; }
.option { position: relative; display: block; cursor: pointer; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option span {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 14px 16px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  font-weight: 500;
  transition: border-color .15s, background .15s;
}
.option span::before {
  content: ""; flex: none; width: 20px; height: 20px;
  border: 1.5px solid #C9C6CF; background: var(--bg);
}
.option input[type=radio] + span::before { border-radius: 50%; }
.option input[type=checkbox] + span::before { border-radius: 6px; }
.option:hover span { background: var(--hover); }
.option input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.option input[type=radio]:checked + span::before { border: 6px solid var(--accent); }
.option input[type=checkbox]:checked + span::before {
  border-color: var(--accent);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3L15 7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;
}
.option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* termos: caixas de confirmação com texto longo */
.confirm span { align-items: flex-start; font-weight: 400; font-size: 15px; line-height: 1.45; }
.confirm span::before { margin-top: 1px; }

.has-error .option span, .has-error input, .has-error textarea { border-color: var(--error); }
.error-text { color: var(--error); font-size: 14px; margin: 8px 0 0; }
.notice { padding: 14px 16px; border-radius: var(--radius); background: var(--hover); }
.notice.warn { background: var(--error-soft); color: var(--error); }

/* ---------- barra de ação ---------- */
.actions {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: linear-gradient(to top, var(--bg) 70%, rgba(255,255,255,0));
  padding: 24px var(--gutter) calc(16px + env(safe-area-inset-bottom));
}
.actions-inner { max-width: var(--col); margin: 0 auto; display: grid; gap: 8px; }
.btn {
  display: flex; align-items: center; justify-content: center; width: 100%;
  min-height: 54px; padding: 0 20px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--bg);
  font-weight: 600; font-size: 17px; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #162036; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-link { border: 0; background: none; min-height: 44px; color: var(--accent); }

/* ---------- boas-vindas ---------- */
.steps-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 14px; }
.steps-list li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.steps-list b {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 15px;
}
.steps-list p { margin: 4px 0 0; }

/* ---------- fotos ---------- */
.camera {
  position: relative; margin: 4px 0 16px;
  aspect-ratio: 3 / 4; max-height: 50vh; width: auto; max-width: 100%; margin-left: auto; margin-right: auto;
  border-radius: 22px; overflow: hidden;
  background: #1D1B22;
}
.camera img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.guide-stroke { fill: none; stroke: rgba(255,255,255,.85); stroke-width: .8; stroke-dasharray: 2.4 1.6; }
.camera.has-photo .guide-stroke { stroke: rgba(255,255,255,.45); }
.camera-hint {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 40px 18px 16px; color: #fff; font-size: 15px; line-height: 1.4;
  background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0));
}
.camera.busy::after {
  content: "Conferindo a foto…"; position: absolute; inset: 0;
  display: grid; place-items: center; color: #fff; font-weight: 600;
  background: rgba(29,27,34,.55);
}

.checks { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.checks li { display: flex; gap: 10px; align-items: baseline; font-size: 15px; }
.checks li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; transform: translateY(-1px); }
.checks .ok { color: var(--soft); }
.checks .ok::before { background: var(--gold); }
.checks .bad { color: var(--error); font-weight: 500; }
.checks .bad::before { background: var(--error); }

.photo-dots { display: flex; gap: 6px; margin: 0 0 14px; }
.photo-dots i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.photo-dots i.done { background: var(--gold); }
.photo-dots i.now { background: var(--ink); }

.tips { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 16px; }
.tips li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center; }
.tips svg { width: 44px; height: 44px; }
.tips .ic { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- revisar / fim ---------- */
.summary { margin: 0 0 24px; border-top: 1px solid var(--line); }
.summary div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.summary dt { color: var(--soft); }
.summary dd { margin: 0; font-weight: 500; word-break: break-word; }
.thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 0 0 20px; }
.thumbs img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; }

.done-mark {
  width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft);
  display: grid; place-items: center; margin: 12px 0 20px;
}
.done-mark svg { width: 30px; height: 30px; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.code { font-weight: 700; letter-spacing: .02em; }

.spinner {
  width: 40px; height: 40px; margin: 40px 0 24px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: 0s !important; }
}
@media (min-width: 640px) {
  .wrap { padding-top: 56px; }
  h2 { font-size: 28px; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Proporcia: líneas de proporción ---------- */
.option span { background: var(--surface); }
.btn { background: var(--surface); }
.btn-primary { background: var(--accent); }
.ratio { display: block; height: 73px; width: auto; margin: 0 0 24px; }
.ic-bg { fill: var(--accent-soft); }
.steps-list b { background: transparent; border: 1.5px solid var(--gold); color: var(--ink); }
.actions { background: linear-gradient(to top, var(--bg) 70%, rgba(248,248,246,0)); }
