:root {
  --ink: #17212b;
  --muted: #5a6672;
  --paper: #ffffff;
  --surface: #f3f5f7;
  --line: #c5cdd5;
  --accent: #0b5cad;
  --accent-ink: #ffffff;
  --ok: #1e7b45;
  --err: #b42318;
  --radius: 6px;
  font-size: 106.25%; /* 17px: leesbaar buiten op een telefoon */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
}
[hidden] { display: none !important; }

.page { max-width: 34rem; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

.brand { margin-bottom: 1.25rem; }
.logo { display: block; max-width: 220px; max-height: 72px; margin-bottom: .75rem; }
h1 { font-size: 1.5rem; line-height: 1.2; margin: 0; font-weight: 700; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }

.field { margin-bottom: 1.25rem; }
label, .label { display: block; font-weight: 600; margin-bottom: .35rem; }
.req { color: var(--err); }
.hint { margin: -.15rem 0 .4rem; color: var(--muted); font-size: .88rem; }

input[type="text"], input[type="password"], input[type="date"] {
  display: block; width: 100%; min-height: 3rem;
  padding: .6rem .75rem; font: inherit; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
}
input[readonly] { background: var(--surface); color: var(--muted); }
input:focus-visible, button:focus-visible, .pick-btn:focus-within {
  outline: 3px solid var(--accent); outline-offset: 2px;
}

/* Foto kiezen: het belangrijkste deel van het formulier */
.pick {
  display: grid; grid-template-columns: 1fr 1fr; gap: .6rem;
  padding: .75rem; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface);
}
.pick.over { border-color: var(--accent); background: #e7f0fa; }
.pick-btn {
  display: flex; align-items: center; justify-content: center; min-height: 4.25rem; margin: 0;
  padding: .5rem; text-align: center; font-weight: 700; cursor: pointer;
  color: var(--accent); background: var(--paper); border: 2px solid var(--accent); border-radius: var(--radius);
}
.pick-btn:first-child { background: var(--accent); color: var(--accent-ink); }
.drop-hint { grid-column: 1 / -1; margin: 0; text-align: center; color: var(--muted); font-size: .88rem; }
@media (pointer: coarse) { .drop-hint { display: none; } }

.thumbs {
  list-style: none; margin: .75rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: .5rem;
}
.thumbs li {
  position: relative; aspect-ratio: 1; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.noprev { display: flex; align-items: center; justify-content: center; height: 100%; padding: .3rem; font-size: .7rem; color: var(--muted); word-break: break-all; text-align: center; }
.bar { position: absolute; left: 0; bottom: 0; height: 5px; width: 0; background: var(--accent); transition: width .2s linear; }
.state {
  position: absolute; left: 0; right: 0; bottom: 5px; padding: .1rem .3rem;
  font-size: .75rem; font-weight: 700; color: #fff; background: rgba(23, 33, 43, .75); text-align: center;
}
.state:empty { display: none; }
li[data-status="klaar"] { border-color: var(--ok); box-shadow: inset 0 0 0 2px var(--ok); }
li[data-status="klaar"] .bar { background: var(--ok); }
li[data-status="fout"] { border-color: var(--err); box-shadow: inset 0 0 0 2px var(--err); }
li[data-status="fout"] .state { background: var(--err); }
.rm {
  position: absolute; top: 3px; right: 3px; width: 1.9rem; height: 1.9rem; padding: 0;
  font-size: 1.2rem; line-height: 1; border: 0; border-radius: 50%;
  background: rgba(23, 33, 43, .7); color: #fff; cursor: pointer;
}
li[data-status="bezig"] .rm, li[data-status="klaar"] .rm { display: none; }

.msg { min-height: 1.2em; margin: 0 0 .75rem; color: var(--err); font-weight: 600; }
.msg:empty { margin: 0; }

button.primary {
  display: block; width: 100%; min-height: 3.25rem; font: inherit; font-weight: 700;
  color: var(--accent-ink); background: var(--accent); border: 0; border-radius: var(--radius); cursor: pointer;
}
button.primary:disabled { opacity: .6; cursor: progress; }

.done { padding: .25rem 0; }
.done-title { margin: 0 0 .25rem; font-size: 1.25rem; font-weight: 700; color: var(--ok); }
.done p { margin-top: 0; }

.foot { margin: 1.5rem 0 0; text-align: center; }
button.link { background: none; border: 0; padding: .25rem; font: inherit; font-size: .88rem; color: var(--muted); text-decoration: underline; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { .bar { transition: none; } }
