/* IMNext intakeformulier — knop + formulier (telefoon, tablet, laptop, desktop) */

.imx-root {
  --imx-ink: #141414;
  --imx-muted: #625f5b;
  --imx-line: #e4dfd9;
  --imx-soft: #faf4ef;
  --imx-accent: #e2692f;
  --imx-accent-ink: #b24f1d;
  --imx-accent-ink-hover: #983f13;
  --imx-error: #b3261e;
  --imx-bg: #ffffff;
  --imx-focus: 0 0 0 3px rgba(226, 105, 47, 0.32);
}

.imx-lock { overflow: hidden; }
.imx-root [hidden] { display: none !important; }

/* ---------- zwevende knop ---------- */
.imx-fab {
  --imx-fab-size: 56px;
  position: fixed;
  z-index: 900;
  right: max(20px, env(safe-area-inset-right, 0px));
  bottom: calc(20px + 2 * (var(--imx-fab-size) + 12px) + env(safe-area-inset-bottom, 0px));
  width: var(--imx-fab-size);
  height: var(--imx-fab-size);
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--imx-ink);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(20, 20, 20, 0.24);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.imx-fab svg { width: 46%; height: 46%; }
.imx-fab:hover { background: #2b2b2b; transform: translateY(-2px); }
.imx-fab:active { transform: translateY(0); }
.imx-fab:focus-visible { outline: 3px solid var(--imx-accent); outline-offset: 3px; }
.imx-fab__tip {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translate(6px, -50%);
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--imx-ink);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
@media (hover: hover) {
  .imx-fab:hover .imx-fab__tip,
  .imx-fab:focus-visible .imx-fab__tip { opacity: 1; transform: translate(0, -50%); }
}

/* ---------- venster ---------- */
.imx-dialog {
  box-sizing: border-box;
  width: min(780px, calc(100vw - 48px));
  max-width: none;
  max-height: min(900px, calc(100vh - 48px));
  max-height: min(900px, calc(100dvh - 48px));
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--imx-bg);
  color: var(--imx-ink);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.imx-dialog[open] { display: flex; flex-direction: column; }
.imx-dialog::backdrop { background: rgba(17, 17, 17, 0.55); }
.imx-dialog *, .imx-dialog *::before, .imx-dialog *::after { box-sizing: border-box; }
.imx-dialog[open] { animation: imx-in 0.22s ease-out; }
@keyframes imx-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.imx-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 34px 0;
}
.imx-brand { margin: 0 0 6px; font-weight: 800; font-size: 17px; letter-spacing: -0.02em; line-height: 1; }
.imx-brand b { color: var(--imx-accent); font-weight: 800; }
.imx-head h2 { margin: 0; font-size: 28px; line-height: 1.12; font-weight: 800; letter-spacing: -0.025em; }
.imx-count { margin: 6px 0 0; font-size: 14px; color: var(--imx-muted); display: none; }
.imx-close {
  flex: none;
  width: 44px;
  height: 44px;
  margin: -4px -8px 0 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--imx-soft);
  color: var(--imx-ink);
  cursor: pointer;
}
.imx-close svg { width: 20px; height: 20px; }
.imx-close:hover { background: #f2e7dd; }

/* voortgang */
.imx-steps {
  list-style: none;
  margin: 20px 34px 0;
  padding: 0 0 18px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  border-bottom: 1px solid var(--imx-line);
}
.imx-steps__item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 6px; min-width: 0; font-size: 13.5px; color: var(--imx-muted); }
.imx-steps__label { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imx-steps__item::before { content: ""; flex: 0 0 100%; height: 4px; border-radius: 4px; background: var(--imx-line); transition: background-color 0.2s ease; }
.imx-steps__item.is-done::before,
.imx-steps__item.is-current::before { background: var(--imx-accent); }
.imx-steps__item.is-current { color: var(--imx-ink); font-weight: 700; }
.imx-steps__n { font-variant-numeric: tabular-nums; }

/* ---------- inhoud ---------- */
.imx-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin: 0; }
.imx-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 24px 34px 30px; }
.imx-step h3 { margin: 0; font-size: 21px; line-height: 1.2; font-weight: 800; letter-spacing: -0.015em; outline: none; }
.imx-lead { margin: 6px 0 22px; color: var(--imx-muted); max-width: 60ch; }
.imx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; align-items: start; }
.imx-field--wide { grid-column: 1 / -1; }
.imx-field, .imx-choice, .imx-check { min-width: 0; }

.imx-field label,
.imx-choice legend { display: block; margin: 0 0 7px; padding: 0; font-size: 15px; font-weight: 650; line-height: 1.3; color: var(--imx-ink); }
.imx-req { color: var(--imx-accent-ink); }
.imx-hint { margin: 6px 0 0; font-size: 13.5px; color: var(--imx-muted); line-height: 1.4; }
.imx-err { margin: 6px 0 0; font-size: 13.5px; line-height: 1.35; color: var(--imx-error); font-weight: 600; }
.imx-err:empty { display: none; }

.imx-dialog input[type="text"],
.imx-dialog input[type="email"],
.imx-dialog input[type="tel"],
.imx-dialog input[type="number"],
.imx-dialog input[type="time"],
.imx-dialog select,
.imx-dialog textarea {
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 12px 14px;
  border: 1.5px solid var(--imx-line);
  border-radius: 12px;
  background: #fff;
  color: var(--imx-ink);
  font: inherit;
  font-size: 16px; /* voorkomt inzoomen op iPhone */
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.imx-dialog textarea { resize: vertical; min-height: 80px; }
.imx-dialog select {
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23141414' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}
.imx-dialog input::placeholder,
.imx-dialog textarea::placeholder { color: #a19c96; }
.imx-dialog input:hover, .imx-dialog select:hover, .imx-dialog textarea:hover { border-color: #cfc8c0; }
.imx-dialog input:focus, .imx-dialog select:focus, .imx-dialog textarea:focus { outline: none; border-color: var(--imx-accent); box-shadow: var(--imx-focus); }
.imx-dialog [aria-invalid="true"] { border-color: var(--imx-error) !important; }
.imx-dialog input:disabled { background: #f6f4f2; color: #aaa49e; }

/* keuzeknoppen */
.imx-choice { margin: 0; padding: 0; border: 0; }
.imx-choice__opts { display: flex; flex-wrap: wrap; gap: 8px; }
.imx-pill { position: relative; display: inline-flex; margin: 0 !important; }
.imx-pill input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.imx-pill span {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1.5px solid var(--imx-line);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 550;
  background: #fff;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.imx-pill:hover span { border-color: #cfc8c0; }
.imx-pill input:checked + span { background: var(--imx-ink); border-color: var(--imx-ink); color: #fff; }
.imx-pill input:focus-visible + span { box-shadow: var(--imx-focus); }
.imx-pill input[aria-invalid="true"] + span { border-color: var(--imx-error); }

/* vinkjes */
.imx-toggle { position: relative; display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: 15.5px; font-weight: 550; line-height: 1.4; padding: 4px 0; }
.imx-toggle input { position: absolute; left: 0; top: 4px; opacity: 0; width: 24px; height: 24px; margin: 0; }
.imx-toggle__box {
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: -1px;
  border: 1.5px solid #cbc4bc;
  border-radius: 7px;
  background: #fff center / 16px no-repeat;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.imx-toggle input:checked + .imx-toggle__box {
  background-color: var(--imx-accent-ink);
  border-color: var(--imx-accent-ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
.imx-toggle input:focus-visible + .imx-toggle__box { box-shadow: var(--imx-focus); }
.imx-toggle input[aria-invalid="true"] + .imx-toggle__box { border-color: var(--imx-error); }
.imx-toggle a { color: var(--imx-accent-ink); text-underline-offset: 2px; }
.imx-check .imx-err { margin-left: 36px; }

/* bestanden */
.imx-file input[type="file"] {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1.5px dashed #cfc8c0;
  border-radius: 12px;
  background: var(--imx-soft);
  font: inherit;
  font-size: 14.5px;
  color: var(--imx-muted);
  cursor: pointer;
}
.imx-file input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--imx-ink);
  color: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.imx-file input[type="file"]:focus-visible { outline: none; box-shadow: var(--imx-focus); border-color: var(--imx-accent); }
.imx-file__list { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; }
.imx-file__list:empty { display: none; }
.imx-file__list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 2px; border-bottom: 1px solid var(--imx-line); }
.imx-file__list li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imx-file__list li span:last-child { color: var(--imx-muted); flex: none; font-variant-numeric: tabular-nums; }

/* openingstijden */
.imx-days { display: grid; gap: 8px; }
.imx-day { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.imx-day__name { font-weight: 650; font-size: 15px; }
.imx-day__sep { font-size: 14px; color: var(--imx-muted); }
.imx-day input[type="time"] { min-height: 46px; padding: 10px 12px; }
.imx-day__closed { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; cursor: pointer; padding: 0 4px; min-height: 44px; }
.imx-day__closed input { width: 20px; height: 20px; margin: 0; accent-color: var(--imx-accent-ink); }
.imx-link {
  justify-self: start;
  margin-top: 4px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--imx-accent-ink);
  font: inherit;
  font-size: 14.5px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.imx-sub h4 { margin: 10px 0 0; padding-top: 18px; border-top: 1px solid var(--imx-line); font-size: 17px; font-weight: 750; }
.imx-note { padding: 14px 16px; border-radius: 12px; background: var(--imx-soft); font-size: 14.5px; line-height: 1.5; color: #3b3835; }
.imx-note strong { color: var(--imx-ink); }
.imx-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- onderbalk ---------- */
.imx-foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 34px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--imx-line);
  background: #fff;
}
.imx-status { flex: 1; margin: 0; font-size: 14px; line-height: 1.4; font-weight: 600; color: var(--imx-error); }
.imx-foot__btns { display: flex; gap: 10px; margin-left: auto; }
.imx-btn {
  min-height: 50px;
  padding: 0 24px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.imx-btn--primary { background: var(--imx-accent-ink); color: #fff; }
.imx-btn--primary:hover { background: var(--imx-accent-ink-hover); }
.imx-btn--primary:disabled { opacity: 0.7; cursor: progress; }
.imx-btn--ghost { background: #fff; border-color: var(--imx-line); color: var(--imx-ink); }
.imx-btn--ghost:hover { border-color: #cfc8c0; }
.imx-btn:focus-visible, .imx-close:focus-visible, .imx-link:focus-visible { outline: none; box-shadow: var(--imx-focus); }

/* ---------- verzonden ---------- */
.imx-done { padding: 32px 0 10px; text-align: center; max-width: 440px; margin: 0 auto; outline: none; }
.imx-done__mark { width: 64px; height: 64px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 50%; background: var(--imx-accent-ink); color: #fff; }
.imx-done__mark svg { width: 32px; height: 32px; }
.imx-done h3 { margin: 0 0 8px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.imx-done p { margin: 0 0 24px; color: var(--imx-muted); }
.imx-done p strong { color: var(--imx-ink); overflow-wrap: anywhere; }

/* ---------- tablet ---------- */
@media (max-width: 900px) {
  .imx-dialog { width: calc(100vw - 32px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
  .imx-steps__item { font-size: 12.5px; }
}

/* ---------- telefoon ---------- */
@media (max-width: 640px) {
  .imx-fab { --imx-fab-size: 52px; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + 2 * (var(--imx-fab-size) + 12px) + env(safe-area-inset-bottom, 0px)); }
  .imx-dialog,
  .imx-dialog[open] {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
    animation-name: imx-up;
  }
  @keyframes imx-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
  .imx-head { padding: calc(16px + env(safe-area-inset-top, 0px)) 18px 0; }
  .imx-head h2 { font-size: 23px; }
  .imx-count { display: block; }
  .imx-steps { margin: 14px 18px 0; padding-bottom: 14px; gap: 5px; }
  .imx-steps__item { gap: 0; }
  .imx-steps__n, .imx-steps__label { display: none; }
  .imx-body { padding: 20px 18px 28px; }
  .imx-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .imx-step h3 { font-size: 19px; }
  .imx-lead { margin-bottom: 18px; font-size: 15px; }
  .imx-day { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 10px; padding-bottom: 10px; border-bottom: 1px solid var(--imx-line); }
  .imx-day__name { grid-row: 1; grid-column: 1; }
  .imx-day__closed { grid-row: 1; grid-column: 2; justify-self: end; }
  .imx-day__sep { display: none; }
  .imx-foot { flex-wrap: wrap; gap: 10px; padding: 12px 18px; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .imx-status { flex-basis: 100%; order: -1; }
  .imx-status:empty { display: none; }
  .imx-foot__btns { width: 100%; }
  .imx-foot__btns .imx-btn { flex: 1; padding: 0 16px; }
  .imx-foot__btns .imx-btn--ghost { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .imx-dialog[open] { animation: none; }
  .imx-fab, .imx-fab__tip, .imx-steps__item::before { transition: none; }
}
