/* ThuisVolt — multi-step offerteformulier (laadpaal-installeren), overgenomen uit landing.html
   Ports the working 5-stappen wizard + Make.com-koppeling (via /.netlify/functions/submit-lead)
   naar de laadpaal-installeren pagina. Kleuren herbruiken de bestaande site-variabelen uit styles.css. */

:root {
  --form-border: #e5e0d6;
}

/* ─── FORM CARD ─── */
/* container-type: dit formulier staat in een smalle sticky sidebar op desktop (~350px) en
   op volle breedte op mobiel — beide zijn "smal". De compacte opmaak hieronder reageert dus
   op de kaart z'n eigen breedte (container query), niet op de viewportbreedte. */
.form-card {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  container-type: inline-size;
}

/* ─── MULTI-STEP FORM ─── */
.mf-wrap { padding: 0; }

/* Stepper */
.mf-stepper {
  display: flex; align-items: flex-start;
  padding: 20px 20px 16px; gap: 0;
}
.mf-step {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px;
  position: relative;
}
.mf-step:not(:last-child)::after {
  content: '';
  position: absolute; top: 13px; left: 50%; right: -50%;
  height: 2px; background: #e0e0e0; z-index: 0;
  transition: background .3s;
}
.mf-step.done:not(:last-child)::after { background: var(--bordeaux); }
.mf-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: #e0e0e0; color: #999;
  font-weight: 800; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
  transition: background .3s, color .3s;
}
.mf-step.active .mf-num { background: var(--bordeaux); color: #fff; }
.mf-step.done .mf-num { background: var(--bordeaux); color: #fff; }
.mf-lbl { font-size: 10px; color: #bbb; font-weight: 500; white-space: nowrap; }
.mf-step.active .mf-lbl { color: var(--bordeaux); font-weight: 700; }
.mf-step.done .mf-lbl { color: var(--bordeaux); }

/* Panels */
.mf-panel { display: none; padding: 4px 20px 8px; }
.mf-panel.active { display: block; }
.mf-q { font-size: 14px; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.mf-sublabel {
  font-size: 12px; font-weight: 700; color: var(--text);
  margin-bottom: 10px; margin-top: 14px;
  display: flex; align-items: center; gap: 5px;
}
.mf-sublabel .info-dot {
  width: 15px; height: 15px; border-radius: 50%;
  background: #e0e0e0; color: #888; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; cursor: help;
}

/* Option cards 2-col */
.opt-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px;
}
/* Option cards 4-col */
.opt-grid-4 {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 6px;
}

.opt-card { display: block; position: relative; cursor: pointer; }
.opt-card input[type="radio"],
.opt-card input[type="checkbox"] { display: none; }
.opt-inner {
  border: 2px solid var(--form-border); border-radius: 10px;
  padding: 14px 8px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; transition: border-color .15s, background .15s;
  font-size: 12px; font-weight: 600; color: var(--text); text-align: center;
  min-height: 80px; justify-content: center;
}
.opt-inner svg { color: var(--bordeaux); flex-shrink: 0; }
.opt-card input:checked + .opt-inner {
  border-color: var(--bordeaux);
  background: #fdf3f3;
}
.opt-inner:hover { border-color: var(--bordeaux); }

/* Check badge top-right */
.opt-card input:checked + .opt-inner::before {
  content: '✓';
  position: absolute; top: 6px; right: 8px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--bordeaux); color: #fff;
  font-size: 10px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}
.opt-card input:checked + .opt-inner { position: relative; }

/* Connection circle icons */
.conn-circle {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid #e0e0e0;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s;
}
.opt-card input:checked + .opt-inner .conn-circle { border-color: var(--bordeaux); }

/* Full-width option */
.opt-full { grid-column: 1 / -1; }
.opt-full .opt-inner {
  flex-direction: row; gap: 12px; padding: 12px 16px; min-height: 0;
}
.opt-full .conn-circle { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #e0e0e0; display: flex; align-items: center; justify-content: center; }

/* Compact 4-col for distances */
.opt-grid-4 .opt-inner {
  padding: 10px 4px 8px; gap: 5px; font-size: 11px; min-height: 64px;
}
.opt-grid-4 .opt-inner svg { width: 22px; height: 22px; }

/* Laadpaal step layout: list left, image right */
.laad-step-wrap { display: flex; gap: 14px; align-items: flex-start; }
.laad-step-left { flex: 1; min-width: 0; }
.laad-step-right {
  width: 150px; flex-shrink: 0;
}
.laad-img-box {
  border: 1.5px solid var(--form-border); border-radius: 12px;
  overflow: hidden; background: #f9f9f9;
  aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center;
}
.laad-img-box img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  transition: opacity .25s;
}
.laad-img-caption {
  font-size: 11px; color: var(--text-muted); text-align: center;
  margin-top: 6px; font-weight: 600; line-height: 1.3;
}

/* Laadpaal radio list */
.laad-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.laad-card { display: block; cursor: pointer; }
.laad-card input[type="radio"] { display: none; }
.laad-inner {
  border: 2px solid var(--form-border); border-radius: 10px; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  transition: border-color .15s, background .15s;
  color: var(--text);
}
.laad-card input:checked + .laad-inner { border-color: var(--bordeaux); background: #fdf3f3; }
.laad-inner:hover { border-color: var(--bordeaux); }
.laad-radio {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid #ccc; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s;
}
.laad-card input:checked + .laad-inner .laad-radio {
  border-color: var(--bordeaux);
  background: radial-gradient(var(--bordeaux) 40%, transparent 41%);
}
.laad-info { flex: 1; }
.laad-name { font-size: 12px; font-weight: 700; line-height: 1.3; }
.laad-spec { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.laad-price { font-size: 13px; font-weight: 800; color: var(--bordeaux); margin-top: 3px; }

/* Extra opties */
.extras-title {
  font-size: 12px; font-weight: 700; color: var(--text);
  margin: 12px 0 8px; border-top: 1px solid var(--form-border); padding-top: 12px;
}
.extra-list { display: flex; flex-direction: column; gap: 8px; }
.extra-card { display: block; cursor: pointer; }
.extra-card input[type="checkbox"] { display: none; }
.extra-inner {
  border: 2px solid var(--form-border); border-radius: 10px; padding: 11px 14px;
  display: flex; align-items: center; gap: 12px;
  transition: border-color .15s, background .15s;
  color: var(--text);
}
.extra-card input:checked + .extra-inner { border-color: var(--bordeaux); background: #fdf3f3; }
.extra-inner:hover { border-color: var(--bordeaux); }
.extra-check {
  width: 18px; height: 18px; border-radius: 4px;
  border: 2px solid #ccc; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.extra-card input:checked + .extra-inner .extra-check {
  border-color: var(--bordeaux); background: var(--bordeaux);
}
.extra-card input:checked + .extra-inner .extra-check::after {
  content: '✓'; color: #fff; font-size: 11px; font-weight: 900;
}
.extra-info { flex: 1; }
.extra-name { font-size: 12px; font-weight: 700; }
.extra-desc { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.extra-price { font-size: 12px; font-weight: 800; color: var(--bordeaux); }

/* Contact form */
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.cf-field { margin-bottom: 10px; }
.cf-label { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 5px; display: block; }
.cf-input, .cf-textarea {
  width: 100%; border: 1.5px solid #e0e0e0; border-radius: 8px;
  padding: 10px 12px; font-size: 13px; font-family: inherit;
  color: var(--text); outline: none; transition: border-color .15s;
  background: #fff;
}
.cf-input:focus, .cf-textarea:focus { border-color: var(--bordeaux); }
.cf-textarea { resize: vertical; min-height: 80px; }

/* File upload area */
.upload-area {
  border: 2px dashed #ccc; border-radius: 10px; padding: 20px 16px;
  cursor: pointer; transition: border-color .15s, background .15s;
  margin-bottom: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; background: #fafafa;
}
.upload-area:hover { border-color: var(--bordeaux); background: #fdf7f7; }
.upload-area input { display: none; }
.upload-area svg { color: #555; }
.upload-area p { font-size: 12px; color: #555; line-height: 1.55; text-align: center; }

/* Privacy */
.privacy-row {
  display: flex; align-items: flex-start; gap: 9px;
  margin-bottom: 14px; font-size: 12px; color: var(--text-muted); cursor: pointer;
}
.privacy-row input[type="checkbox"] {
  width: 16px; height: 16px; margin-top: 1px;
  accent-color: var(--bordeaux); flex-shrink: 0;
}
.privacy-row a { color: var(--bordeaux); text-decoration: none; }
.privacy-row a:hover { text-decoration: underline; }

/* Navigation */
.mf-nav {
  display: flex; gap: 10px; padding: 6px 20px 16px;
}
.mf-nav-prev {
  display: flex; align-items: center; gap: 6px;
  border: 2px solid #e0e0e0; border-radius: 8px;
  padding: 11px 16px; font-size: 13px; font-weight: 700;
  background: #fff; color: var(--text); cursor: pointer;
  transition: border-color .15s; white-space: nowrap;
}
.mf-nav-prev:hover { border-color: var(--bordeaux); color: var(--bordeaux); }
.mf-nav-next {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bordeaux); color: #fff; border: none; border-radius: 8px;
  padding: 13px 20px; font-size: 14px; font-weight: 800; cursor: pointer;
  transition: background .2s;
}
.mf-nav-next:hover { background: var(--bordeaux-dark); }
.mf-nav-next:disabled { opacity: .7; cursor: default; }

/* Security note */
.mf-security {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11px; color: #aaa; padding: 0 20px 16px; text-align: center;
}
.mf-security svg { color: #ccc; }

/* Thank you screen */
.mf-thanks {
  display: none; padding: 36px 20px; text-align: center;
}
.mf-thanks svg { color: #2e7d32; margin-bottom: 16px; }
.mf-thanks h3 { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.mf-thanks p { font-size: 14px; color: var(--text-muted); line-height: 1.65; }

/* ── SMALLE KAART (sticky desktop-sidebar ~350px èn mobiel) ── */
@container (max-width: 480px) {
  .mf-stepper     { padding: 12px 8px 8px; overflow-x: auto; }
  .mf-lbl         { font-size: 9px; white-space: nowrap; }
  .mf-num         { width: 22px; height: 22px; font-size: 10px; }
  .mf-step:not(:last-child)::after { top: 11px; }

  .mf-panel       { padding: 4px 12px 6px; }
  .mf-q           { font-size: 13px; margin-bottom: 12px; }
  .mf-sublabel    { font-size: 11px; margin-top: 12px; margin-bottom: 8px; }

  .opt-grid-2     { gap: 8px; }
  .opt-inner      { padding: 12px 6px 10px; font-size: 11px; gap: 6px; min-height: 72px; }
  .opt-grid-4     { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .opt-grid-4 .opt-inner { font-size: 10px; padding: 8px 4px; min-height: 58px; }

  .laad-step-wrap  { flex-direction: column; gap: 14px; }
  .laad-step-right { width: 100%; order: -1; }
  .laad-img-box    { max-width: 160px; margin: 0 auto; }
  .laad-img-caption{ font-size: 11px; }
  .laad-inner      { padding: 10px 12px; gap: 10px; }
  .laad-name       { font-size: 12px; }
  .laad-spec       { font-size: 10px; }
  .laad-price      { font-size: 12px; }
  .extras-title    { font-size: 11px; }
  .extra-inner     { padding: 10px 12px; gap: 10px; }
  .extra-name      { font-size: 12px; }
  .extra-desc      { font-size: 10px; }
  .extra-price     { font-size: 11px; }

  .cf-row          { grid-template-columns: 1fr; gap: 0; }
  .cf-input, .cf-textarea { font-size: 16px; min-height: 48px; }
  .cf-textarea     { min-height: 80px; }

  .mf-nav          { padding: 4px 12px 12px; gap: 8px; }
  .mf-nav-next     { font-size: 13px; padding: 12px 14px; }
  .mf-nav-prev     { font-size: 13px; padding: 10px 12px; white-space: nowrap; }
  .mf-security     { font-size: 10px; padding: 0 12px 12px; }
}
