/* Aanvraagformulier in stappen. Gebruikt de variabelen uit style.css
   (--red, --steel, --line, --text, --muted, --dim, --mono, --display). */

.aanvraag { display: grid; gap: 22px; position: relative; }
.aanvraag *, .aanvraag *::before, .aanvraag *::after { box-sizing: border-box; }

/* ------------------------------------------------------------ voortgang -- */

.af-voortgang {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.af-vg {
  position: relative; padding: 12px 0 0; min-width: 0;
  color: var(--dim); font-size: 12px; line-height: 1.3;
  display: grid; gap: 4px;
}
.af-vg::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: var(--line); transition: background .25s ease;
}
.af-vg-nr { font-size: 11px; letter-spacing: .22em; }
.af-vg-naam { font-weight: 600; color: var(--muted); overflow-wrap: anywhere; }
.af-vg.is-actief::before { background: var(--red); box-shadow: 0 0 12px rgba(224,27,36,.6); }
.af-vg.is-actief { color: var(--red); }
.af-vg.is-actief .af-vg-naam { color: var(--text); }
.af-vg.is-klaar::before { background: var(--red); opacity: .55; }
.af-vg.is-klaar .af-vg-nr::after { content: " ✓"; color: var(--red); letter-spacing: 0; }

/* -------------------------------------------------------------- stappen -- */

.af-stap {
  border: 1px solid var(--line); padding: 22px clamp(16px, 3vw, 28px) 26px; margin: 0;
  min-width: 0; background: rgba(255,255,255,.015);
  display: grid; gap: 18px;
}
.af-legend {
  float: left; width: 100%; padding: 0; margin: 0 0 4px;
  display: flex; flex-direction: column; gap: 4px;
}
.af-legend-nr { font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--red); }
.af-legend-naam { font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; text-transform: uppercase; line-height: .95; }

/* Met javascript: één stap tegelijk, met een zachte overgang. */
.aanvraag.af-js .af-stap:not(.is-actief) { display: none; }
.aanvraag.af-js .af-stap.is-actief { animation: af-in .28s ease both; }
@keyframes af-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .aanvraag.af-js .af-stap.is-actief { animation: none; }
}

/* --------------------------------------------------------------- velden -- */

.af-rij { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.af-veld { display: grid; gap: 7px; min-width: 0; position: relative; }
.af-veld > label {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
  display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline;
}
.af-veld > label small { font-size: 10.5px; letter-spacing: .08em; text-transform: none; color: var(--dim); font-weight: 500; }

.af-veld input[type=text], .af-veld input[type=email], .af-veld input[type=tel],
.af-veld select, .af-veld textarea {
  width: 100%; padding: 13px 14px;
  background: var(--steel); color: var(--text);
  border: 1px solid var(--line); border-radius: 0;
  font: inherit; font-size: 16px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.af-veld textarea { resize: vertical; min-height: 150px; line-height: 1.55; }
.af-veld select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 49%, var(--muted) 50%), linear-gradient(-45deg, transparent 49%, var(--muted) 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%;
  background-size: 6px 6px; background-repeat: no-repeat;
}
.af-veld select option { background: var(--steel); color: var(--text); }
.af-veld input:focus, .af-veld select:focus, .af-veld textarea:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(224,27,36,.18);
}
.af-veld input::placeholder, .af-veld textarea::placeholder { color: var(--dim); }
.af-kenteken { text-transform: uppercase; font-family: var(--mono); letter-spacing: .08em; }

.af-veld.is-fout input, .af-veld.is-fout select, .af-veld.is-fout textarea,
.af-veld.is-fout .af-upload { border-color: var(--red); }
.af-veld.is-fout > label { color: var(--red); }
.af-veld.is-goed input:not(:placeholder-shown), .af-veld.is-goed select { border-color: rgba(255,255,255,.28); }

.af-fout {
  margin: 0; font-size: 13.5px; color: #ff6b71; line-height: 1.4;
  display: flex; gap: 8px; align-items: flex-start;
}
.af-fout::before { content: "!"; flex: none; width: 16px; height: 16px; margin-top: 2px; border: 1px solid #ff6b71; font-family: var(--mono); font-size: 10px; font-weight: 700; display: grid; place-items: center; }

.af-teller { position: absolute; right: 0; top: 0; font-size: 11px; color: var(--dim); letter-spacing: .1em; }
.af-teller b { color: var(--muted); font-weight: 500; }
.af-teller.is-vol b { color: #ff6b71; }

.af-melding {
  border: 1px solid var(--red); border-left-width: 3px;
  background: rgba(224,27,36,.1); color: var(--text);
  padding: 12px 16px; margin: 0 0 18px; font-size: 14.5px;
}

/* --------------------------------------------------------------- tegels -- */

.af-tegels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.af-tegel { position: relative; display: block; cursor: pointer; min-width: 0; }
.af-tegel input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.af-tegel-in {
  display: grid; grid-template-rows: auto 1fr; height: 100%;
  background: var(--steel); border: 1px solid var(--line);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
  position: relative; overflow: hidden;
}
.af-tegel-foto { display: block; aspect-ratio: 4 / 3; background: var(--night); overflow: hidden; }
.af-tegel-foto img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.8) brightness(.85); transition: transform .35s ease, filter .35s ease; }
.af-tegel-icoon { display: grid; place-items: center; color: var(--muted); background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(255,255,255,.03) 8px 9px); }
.af-tegel-tekst { display: grid; gap: 3px; padding: 11px 12px 13px; align-content: start; }
.af-tegel-naam { font-size: 17px; font-weight: 800; text-transform: uppercase; line-height: 1; letter-spacing: .01em; overflow-wrap: break-word; hyphens: auto; }
.af-tegel-prijs { font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.af-tegel-vink {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px;
  border: 1px solid rgba(255,255,255,.35); background: rgba(6,6,7,.55);
  transition: background .18s ease, border-color .18s ease;
}
.af-tegel-vink::after {
  content: ""; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform .18s ease;
}
.af-tegel:hover .af-tegel-in { border-color: rgba(255,255,255,.3); }
.af-tegel:hover .af-tegel-foto img { transform: scale(1.04); filter: none; }
.af-tegel input:focus-visible + .af-tegel-in { outline: 2px solid var(--red); outline-offset: 3px; }
.af-tegel input:checked + .af-tegel-in { border-color: var(--red); box-shadow: 0 0 0 1px var(--red), 0 10px 30px rgba(224,27,36,.18); }
.af-tegel input:checked + .af-tegel-in .af-tegel-foto img { filter: none; }
.af-tegel input:checked + .af-tegel-in .af-tegel-vink { background: var(--red); border-color: var(--red); }
.af-tegel input:checked + .af-tegel-in .af-tegel-vink::after { transform: rotate(45deg) scale(1); }
.af-tegel input:checked + .af-tegel-in .af-tegel-prijs { color: var(--text); }

/* --------------------------------------------------------------- upload -- */

.af-upload {
  position: relative; border: 1px dashed rgba(255,255,255,.22); background: var(--steel);
  padding: 22px 16px; text-align: center; color: var(--muted); font-size: 14.5px;
  transition: border-color .18s ease, background .18s ease;
}
.af-upload input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.af-upload-tekst b { color: var(--text); font-weight: 600; }
.af-upload:hover, .af-upload.is-sleep { border-color: var(--red); background: rgba(224,27,36,.06); }
.af-upload input:focus-visible ~ .af-upload-tekst { outline: 2px solid var(--red); outline-offset: 6px; }

.af-previews { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.af-previews:empty { display: none; }
.af-preview { position: relative; aspect-ratio: 1; background: var(--night); border: 1px solid var(--line); overflow: hidden; }
.af-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.af-preview-naam {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px;
  font-size: 10px; color: var(--muted); background: rgba(6,6,7,.75);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.af-preview-weg {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px;
  background: rgba(6,6,7,.8); color: #fff; border: 1px solid rgba(255,255,255,.3);
  font: 16px/1 var(--mono); cursor: pointer; display: grid; place-items: center; padding: 0;
}
.af-preview-weg:hover { background: var(--red); border-color: var(--red); }

/* ------------------------------------------------------------ navigatie -- */

.af-nav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.af-nav-rest { flex: 1; }
.af-nav .btn { cursor: pointer; }
.af-nav .btn[hidden] { display: none; }
.af-verstuur:disabled { opacity: .6; cursor: progress; }
.af-verstuur.is-bezig::after {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 10px;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%;
  animation: af-draai .8s linear infinite; vertical-align: -2px;
}
@keyframes af-draai { to { transform: rotate(360deg); } }
.af-noot { margin: -8px 0 0; font-size: 12.5px; color: var(--dim); }
.af-hp { position: absolute; left: -9999px; top: -9999px; }

/* --------------------------------------------------------------- succes -- */

.af-succes {
  border: 1px solid var(--line-red); border-top: 3px solid var(--red);
  background: linear-gradient(180deg, rgba(224,27,36,.1), transparent 60%), var(--steel);
  padding: clamp(28px, 4vw, 48px) clamp(20px, 3vw, 40px); text-align: left;
  display: grid; gap: 12px; justify-items: start; outline: none;
}
.af-succes-icoon {
  width: 56px; height: 56px; border-radius: 50%; background: var(--red); color: #fff;
  display: grid; place-items: center; box-shadow: 0 0 34px rgba(224,27,36,.5); margin-bottom: 6px;
}
.af-succes .eyebrow { margin: 0; }
.af-succes-kop { margin: 0; font-size: clamp(30px, 4vw, 48px); font-weight: 800; text-transform: uppercase; line-height: .92; }
.af-succes-tekst { margin: 4px 0 0; font-size: 17px; color: var(--muted); max-width: 50ch; line-height: 1.55; }
.af-succes-links { margin: 14px 0 0; }

/* -------------------------------------------------------------- mobiel --- */

@media (max-width: 760px) {
  .af-rij { grid-template-columns: 1fr; }
  .af-tegels { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .af-tegel-naam { font-size: 16px; }
  .af-previews { grid-template-columns: repeat(3, 1fr); }
  .af-voortgang { gap: 4px; }
  .af-vg-naam { display: none; }
  .af-vg.is-actief .af-vg-naam { display: block; }
  .af-nav { flex-direction: column; align-items: stretch; }
  .af-nav .btn { width: 100%; text-align: center; justify-content: center; }
  .af-nav .af-vorige { order: 2; }
  .af-nav-rest { display: none; }
  .af-noot { text-align: center; }
}
@media (max-width: 380px) {
  .af-tegel-naam { font-size: 15px; }
  .af-stap { padding-left: 14px; padding-right: 14px; }
}
