:root {
  --teal: #0B4F4C; --brand: #0B6E69; --paper: #FBFAF7; --ink: #1C2321;
  --mist: #DCEBE8; --line: #C9D3D1; --muted: #55625F; --red: #B42E24;
  --radius-btn: 14px; --radius-slot: 8px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  min-height: 100dvh; display: flex; flex-direction: column;
}
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
button, select, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px; background: var(--teal); color: #fff;
}
.mark { font-weight: 800; font-size: 21px; letter-spacing: -0.3px; }

/* The checklist made visible: one slot per document, filled when received. */
.slots {
  list-style: none; margin: 0; padding: 14px 16px 0; display: flex; gap: 8px;
  max-width: 520px; width: 100%; align-self: center;
}
.slot {
  flex: 1; aspect-ratio: 3 / 4; max-height: 64px; border: 1.5px solid var(--line); border-radius: var(--radius-slot);
  display: grid; place-items: center; color: var(--line); background: #fff; position: relative;
}
.slot svg { width: 60%; height: 60%; }
.slot.current { border-color: var(--brand); color: var(--brand); border-width: 2px; }
.slot.done { background: var(--brand); border-color: var(--brand); color: #fff; }
.slot.skipped { border-style: dashed; }
.slot.done::after {
  content: ""; position: absolute; right: -5px; bottom: -5px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.5 16.2 5.3 12l-1.4 1.4 5.6 5.6 11-11-1.4-1.4z' fill='%230B6E69'/%3E%3C/svg%3E") center/14px no-repeat;
  box-shadow: 0 0 0 1.5px var(--brand);
}

main { flex: 1; width: 100%; max-width: 520px; align-self: center; padding: 20px 16px 8px; }
h1 { font-size: 26px; line-height: 1.2; margin: 4px 0 10px; letter-spacing: -0.4px; text-wrap: balance; }
.lead { margin: 0 0 18px; color: var(--ink); }
.counter { color: var(--muted); font-size: 15px; margin: 0 0 4px; }
.hint { margin: 0 0 16px; }

.consent {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-btn); padding: 16px; margin: 0 0 16px;
}
.consent p { margin: 0 0 14px; font-size: 16px; }
.check { display: flex; gap: 12px; align-items: center; font-weight: 700; cursor: pointer; }
.check input { width: 26px; height: 26px; accent-color: var(--brand); margin: 0; flex: none; }

.example {
  display: grid; place-items: center; background: var(--mist); border-radius: var(--radius-btn);
  height: 150px; margin: 0 0 18px; color: var(--teal);
}
.example svg { height: 112px; width: auto; }
.preview { margin: 0 0 16px; border-radius: var(--radius-btn); overflow: hidden; background: #fff; border: 1px solid var(--line); }
.preview img { display: block; width: 100%; max-height: 34vh; object-fit: contain; background: #f1f3f2; }
.preview .file { padding: 20px 16px; font-weight: 600; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px;
  border-radius: var(--radius-btn); border: 0; background: var(--brand); color: #fff; font-weight: 700; font-size: 18px;
  margin: 0 0 10px; cursor: pointer; text-decoration: none;
}
.btn[disabled] { background: #9DB5B2; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--teal); border: 1.5px solid var(--brand); }
.btn.danger-fill { background: var(--red); }
.btn svg { width: 24px; height: 24px; flex: none; }
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; }
.linkish {
  background: none; border: 0; padding: 10px 0; color: var(--teal); text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer; font-size: 16px; display: block; margin: 0 auto;
}
.linkish.danger { color: var(--red); font-size: 15px; }

.status { display: flex; align-items: center; gap: 10px; font-weight: 700; margin: 0 0 14px; }
.status.ok { color: var(--brand); }
.status.err { color: var(--red); font-weight: 600; }
.bar-progress { height: 6px; background: var(--mist); border-radius: 3px; overflow: hidden; margin: 0 0 14px; }
.bar-progress i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }

.field { margin: 0 0 18px; }
.field > span { display: block; font-weight: 700; margin: 0 0 8px; }
.field .row select, .field textarea {
  width: 100%; min-height: 50px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; padding: 10px 12px;
}
.field textarea { min-height: 96px; resize: vertical; }
.missing { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-btn); padding: 14px 16px; margin: 0 0 16px; }
.missing ul { margin: 6px 0 0; padding-left: 20px; }

.foot { width: 100%; max-width: 520px; align-self: center; padding: 8px 16px max(18px, env(safe-area-inset-bottom)); color: var(--muted); font-size: 14px; }
.lockline { display: flex; gap: 6px; align-items: center; color: var(--teal); font-weight: 600; margin: 8px 0 4px; }
.privacy { margin: 0 0 4px; }

dialog { border: 0; border-radius: 16px; padding: 20px; max-width: 420px; width: calc(100% - 32px); color: var(--ink); }
dialog::backdrop { background: rgba(28,35,33,.5); }
dialog p { margin: 0 0 16px; }
@media (prefers-reduced-motion: reduce) { .bar-progress i { transition: none; } }
