:root {
  --rie-brand: #4057CB;
  --rie-brand-dark: #2d3aa0;
  --rie-ink: #18222e;
  --rie-muted: #5b6675;
  --rie-line: #e9ecf1;
  --rie-bg: #f7f8fa;
  --rie-ok: #1f9d61;
  --rie-font: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.rie-intake-head { text-align: center; margin: 0 auto 1.2em; max-width: 880px; }
.rie-intake-head .rie-logo { max-height: 64px; width: auto; }
.rie-form {
  max-width: 880px; margin: 0 auto;
  font-family: var(--rie-font);
  color: var(--rie-ink); font-size: 15px; line-height: 1.45;
}
.rie-form h3 {
  margin: 1.6em 0 .4em; font-size: 1.08rem; font-weight: 700; color: var(--rie-ink);
  letter-spacing: -0.01em;
}
.rie-form h3:first-child { margin-top: 0; }

/* ---------- Algemene velden: compacte grid ---------- */
.rie-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 14px; }
.rie-field { display: flex; flex-direction: column; gap: 3px; }
.rie-field.rie-wide { grid-column: 1 / -1; }
.rie-field > label { font-weight: 600; font-size: .8rem; color: var(--rie-muted); }
.rie-field input[type="text"], .rie-field input[type="number"], .rie-field textarea, .rie-field select {
  padding: 7px 10px; border: 1px solid var(--rie-line); border-radius: 8px; font: inherit; font-size: .92rem;
  width: 100%; background: #fff; color: var(--rie-ink); transition: border-color .15s, box-shadow .15s;
}
.rie-field input:focus, .rie-field textarea:focus, .rie-field select:focus {
  outline: none; border-color: var(--rie-brand); box-shadow: 0 0 0 3px rgba(64,87,203,.12);
}

/* ---------- Inklapbare secties ---------- */
.rie-sec { border: 1px solid var(--rie-line); border-radius: 10px; margin: 0 0 8px; background: #fff; overflow: hidden; }
.rie-sec-head {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: #fff; border: 0; cursor: pointer; font: inherit; color: var(--rie-ink);
  padding: 11px 14px; font-weight: 700; font-size: .92rem;
}
.rie-sec-head:hover { background: #fafbfd; }
.rie-sec-title { flex: 1; }
.rie-sec-badge {
  font-size: .75rem; font-weight: 700; color: var(--rie-muted);
  background: #eef0f5; border-radius: 999px; padding: 2px 9px; font-variant-numeric: tabular-nums;
}
.rie-sec.done .rie-sec-badge { background: #e2f5ea; color: var(--rie-ok); }
.rie-sec.done .rie-sec-badge::after { content: " ✓"; }
.rie-sec-chev { color: var(--rie-muted); transition: transform .18s; font-size: .85rem; }
.rie-sec.open .rie-sec-chev { transform: rotate(180deg); }
.rie-sec-body { display: none; border-top: 1px solid var(--rie-line); }
.rie-sec.open .rie-sec-body { display: block; }

/* ---------- Compacte vraagrijen ---------- */
.rie-question { border-bottom: 1px solid var(--rie-line); }
.rie-question:last-child { border-bottom: 0; }
.rie-qmain {
  display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px;
  padding: 7px 12px; min-height: 40px;
}
.rie-qmain:hover { background: #fafbfd; }
.rie-qnr { color: var(--rie-muted); font-size: .78rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.rie-qtext { font-size: .92rem; line-height: 1.35; }
.rie-qright { display: inline-flex; align-items: center; gap: 7px; }

.rie-options { display: inline-flex; gap: 0; border: 1px solid var(--rie-line); border-radius: 8px; overflow: hidden; background: #fff; flex: none; }
.rie-options input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.rie-opt {
  padding: 6px 13px; cursor: pointer; font-size: .8rem; font-weight: 600; color: var(--rie-muted);
  border-right: 1px solid var(--rie-line); transition: background .12s, color .12s; user-select: none; white-space: nowrap;
}
.rie-opt:last-of-type { border-right: 0; }
.rie-options input[type="radio"]:checked + .rie-opt { background: var(--rie-brand); color: #fff; }
.rie-options input[type="radio"]:focus-visible + .rie-opt { box-shadow: inset 0 0 0 2px rgba(64,87,203,.35); }

/* Markering bij "ga naar eerste open vraag" */
@keyframes rieFlash { 0% { background: #fff3cd; } 100% { background: transparent; } }
.rie-question.rie-flash .rie-qmain { animation: rieFlash 1.8s ease-out 1; }

/* ---------- Opmerking achter 💬-knop ---------- */
.rie-note-btn {
  border: 1px solid var(--rie-line); background: #fff; border-radius: 8px; cursor: pointer;
  font-size: .85rem; line-height: 1; padding: 6px 8px; color: var(--rie-muted); flex: none;
  transition: border-color .12s, background .12s; filter: grayscale(1); opacity: .75;
}
.rie-note-btn:hover { border-color: var(--rie-brand); opacity: 1; }
.rie-note-btn.rie-has-note { filter: none; opacity: 1; border-color: var(--rie-brand); background: #eef1fc; }
.rie-note-wrap { display: none; padding: 0 12px 9px 64px; }
.rie-note-wrap.open { display: block; }
.rie-note {
  width: 100%; border: 1px solid var(--rie-line); border-radius: 8px; padding: 7px 10px;
  font: inherit; font-size: .88rem; color: var(--rie-ink); resize: vertical; background: #fcfcfd; min-height: 50px;
}
.rie-note:focus { outline: none; border-color: var(--rie-brand); box-shadow: 0 0 0 3px rgba(64,87,203,.1); }

/* ---------- Voortgang (sticky) ---------- */
.rie-progress { position: sticky; top: 0; background: #fff; padding: 9px 0 10px; margin-bottom: 10px; border-bottom: 1px solid var(--rie-line); z-index: 5; }
.rie-progress-top { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.rie-progress-text { font-size: .82rem; color: var(--rie-muted); font-weight: 600; }
.rie-jump {
  border: 0; background: none; color: var(--rie-brand); font: inherit; font-size: .82rem; font-weight: 700;
  cursor: pointer; padding: 0;
}
.rie-jump:hover { text-decoration: underline; }
.rie-autosave { font-size: .76rem; color: var(--rie-muted); margin-left: auto; }
.rie-progress-bar { height: 6px; background: #eef0f4; border-radius: 999px; overflow: hidden; }
.rie-progress-fill { height: 100%; width: 0; background: var(--rie-brand); border-radius: 999px; transition: width .3s ease; }

/* ---------- Knoppen & status ---------- */
.rie-submit {
  margin-top: 22px; background: var(--rie-brand); color: #fff; border: 0;
  padding: 12px 24px; border-radius: 10px; font-size: .98rem; font-weight: 700; cursor: pointer;
  transition: background .15s, transform .1s; font-family: inherit;
}
.rie-submit:hover { background: var(--rie-brand-dark); }
.rie-submit:active { transform: translateY(1px); }
.rie-submit:disabled { opacity: .55; cursor: default; }
.rie-status { margin-top: 12px; font-weight: 600; color: var(--rie-brand-dark); }

.rie-maillink { margin-left: 10px; background: #fff; color: var(--rie-brand); border: 1.5px solid var(--rie-brand); border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.rie-maillink:hover { background: var(--rie-brand); color: #fff; }
.rie-maillink:disabled { opacity: .6; cursor: default; }

/* ---------- Mobiel ---------- */
@media (max-width: 660px) {
  .rie-qmain { grid-template-columns: 34px 1fr; }
  .rie-qright { grid-column: 1 / -1; justify-content: flex-start; margin: 2px 0 2px 34px; }
  .rie-note-wrap { padding-left: 12px; }
  .rie-opt { padding: 8px 14px; }
}

/* ---------- Logo-upload in de vragenlijst ---------- */
.rie-logo-upload { margin-top: 1.4em; }
.rie-logo-hint { color: var(--rie-muted); font-size: .85rem; margin: 0 0 8px; }
.rie-logo-row { display: flex; align-items: center; gap: 16px; }
.rie-logo-preview {
  width: 120px; height: 80px; border: 1px dashed var(--rie-line); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; background: #fff; overflow: hidden; flex: none;
}
.rie-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.rie-logo-placeholder { color: var(--rie-faint, #8a93a1); font-size: .78rem; }
.rie-logo-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rie-logo-btn {
  background: var(--rie-brand); color: #fff; border: 0; border-radius: 9px;
  padding: 9px 16px; font: inherit; font-weight: 700; cursor: pointer;
}
.rie-logo-btn:hover { background: var(--rie-brand-dark); }
.rie-logo-btn:disabled { opacity: .6; cursor: default; }
.rie-logo-clear {
  background: #fff; color: var(--rie-muted); border: 1px solid var(--rie-line);
  border-radius: 9px; padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer;
}
.rie-logo-clear:hover { border-color: var(--rie-brand); color: var(--rie-brand); }
.rie-logo-status { font-size: .82rem; color: var(--rie-brand-dark); font-weight: 600; }
