/* ============================================================
   anfrage.css — 4-step Umzugsanfrage (assets/anfrage.js)
   Self-contained so it looks the same on every page type.
   ============================================================ */
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/barlow-condensed-800.woff2") format("woff2");
}

form.anfrage {
  --af-ink: #101522;
  --af-text: #2a2f3a;
  --af-muted: #5d6577;
  --af-line: #d5dae0;
  --af-yellow: #f6c02d;
  --af-pave: #eef0f1;
  --af-red: #c41e1e;
  --af-display: "Barlow Condensed", "DIN Condensed", "Arial Narrow", sans-serif;
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: clamp(20px, 3vw, 30px);
  border: 3px solid var(--af-ink);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 0 0 6px var(--af-yellow), 0 24px 60px rgba(16, 21, 34, 0.14);
  color: var(--af-text);
  font-size: 1rem;
  line-height: 1.45;
  text-align: left;
}
form.anfrage *,
form.anfrage *::before,
form.anfrage *::after { box-sizing: border-box; }
form.anfrage [hidden] { display: none !important; }

.af-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.af-title { margin: 0; color: var(--af-ink); font-family: var(--af-display); font-size: 1.6rem; font-weight: 800; line-height: 1; }
.af-count { margin: 0; color: var(--af-muted); font-size: 0.85rem; font-weight: 700; white-space: nowrap; }

/* progress */
.af-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 22px; padding: 0; list-style: none; }
.af-steps li { display: flex; align-items: center; gap: 7px; padding-top: 9px; border-top: 5px solid var(--af-pave); color: var(--af-muted); font-size: 0.82rem; font-weight: 700; }
.af-steps li.is-done { border-top-color: var(--af-ink); color: var(--af-ink); }
.af-steps li.is-current { border-top-color: var(--af-yellow); color: var(--af-ink); }
.af-dot {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
}
.af-steps li.is-current .af-dot { border-color: var(--af-ink); background: var(--af-yellow); }
.af-steps li.is-done .af-dot { border-color: var(--af-ink); background: var(--af-ink); color: #fff; }

.af-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* panels */
.af-panel { min-width: 0; margin: 0; padding: 0; border: 0; }
.af-panel > legend { display: block; width: 100%; margin: 0 0 16px; padding: 0; }
.af-h { display: block; margin: 0; color: var(--af-ink); font-family: var(--af-display); font-size: clamp(1.6rem, 3vw, 2rem); font-weight: 800; line-height: 1.05; outline: none; }

/* service tiles */
.af-services { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 4px; border-radius: 12px; }
.af-services.has-error { outline: 2px solid var(--af-red); outline-offset: 4px; }
.af-service { position: relative; display: block; overflow: hidden; border: 2px solid var(--af-line); border-radius: 12px; background: #fff; cursor: pointer; transition: border-color 120ms ease, box-shadow 120ms ease; }
.af-service input { position: absolute; opacity: 0; pointer-events: none; }
.af-service img { display: block; width: 100%; height: 84px; object-fit: cover; }
.af-service__text { display: block; padding: 8px 10px 10px; }
.af-service__text b { display: block; color: var(--af-ink); font-family: var(--af-display); font-size: 1.2rem; font-weight: 800; line-height: 1.05; }
.af-service__text small { display: block; margin-top: 2px; color: var(--af-muted); font-size: 0.78rem; line-height: 1.3; }
.af-service:hover { border-color: var(--af-ink); }
.af-service:has(input:checked) { border-color: var(--af-ink); box-shadow: 0 0 0 4px var(--af-yellow); }
.af-service:has(input:checked)::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 2px solid var(--af-ink);
  border-radius: 6px;
  background: var(--af-yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23101522' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.af-service:has(input:focus-visible) { outline: 3px solid #005387; outline-offset: 2px; }

/* fields */
.af-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin-top: 16px; }
.af-grid--address { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); margin-top: 0; }
.af-grid--address .af-wide { grid-column: 1 / -1; }
.af-grid .af-wide { grid-column: 1 / -1; }
.af-field { display: grid; gap: 6px; margin: 0; }
.af-label { color: var(--af-ink); font-size: 0.9rem; font-weight: 700; }
.af-label small, .af-optional { color: var(--af-muted); font-weight: 600; }
form.anfrage input[type="text"],
form.anfrage input[type="tel"],
form.anfrage input[type="email"],
form.anfrage input[type="date"],
form.anfrage select,
form.anfrage textarea {
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 11px 14px;
  border: 2px solid var(--af-line);
  border-radius: 10px;
  background: #fff;
  color: var(--af-ink);
  font: inherit;
  font-size: 1rem;
  box-shadow: none;
  appearance: none;
}
form.anfrage select {
  padding-right: 40px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23101522' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") right 14px center / 16px no-repeat;
}
form.anfrage textarea { min-height: 110px; resize: vertical; }
form.anfrage input:focus,
form.anfrage select:focus,
form.anfrage textarea:focus { border-color: var(--af-ink); outline: 3px solid rgba(246, 192, 45, 0.7); outline-offset: 0; }
.af-field.has-error input,
.af-field.has-error select,
.af-field.has-error textarea { border-color: var(--af-red); }
.af-error { color: var(--af-red); font-size: 0.85rem; font-weight: 700; }
.af-error:empty { display: none; }

.af-address { min-width: 0; margin: 0 0 18px; padding: 14px 16px 16px; border: 0; border-radius: 12px; background: var(--af-pave); }
.af-address > legend { float: left; width: 100%; margin: 0 0 10px; padding: 0; color: var(--af-ink); font-family: var(--af-display); font-size: 1.35rem; font-weight: 800; }
.af-address > legend + * { clear: both; }

/* Ja / Nein buttons */
.af-choice { display: flex; gap: 8px; }
.af-choice label { flex: 1; position: relative; cursor: pointer; }
.af-choice input { position: absolute; opacity: 0; pointer-events: none; }
.af-choice span {
  display: grid;
  place-items: center;
  min-height: 50px;
  padding: 0 10px;
  border: 2px solid var(--af-line);
  border-radius: 10px;
  background: #fff;
  color: var(--af-ink);
  font-weight: 700;
}
.af-choice label:hover span { border-color: var(--af-ink); }
.af-choice input:checked + span { border-color: var(--af-ink); background: var(--af-yellow); }
.af-choice input:focus-visible + span { outline: 3px solid #005387; outline-offset: 2px; }
.af-field.has-error .af-choice span { border-color: var(--af-red); }

/* photos */
.af-photos { margin-bottom: 18px; }
.af-photos .af-label { margin: 0; }
.af-hint { margin: 4px 0 12px; color: var(--af-muted); font-size: 0.88rem; }
.af-photo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.af-photo-list li { position: relative; aspect-ratio: 1; }
.af-photo-list img { width: 100%; height: 100%; border-radius: 10px; object-fit: cover; }
.af-photo-list [data-remove] {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--af-ink);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.af-add {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  padding: 8px;
  border: 2px dashed var(--af-ink);
  border-radius: 10px;
  background: var(--af-pave);
  color: var(--af-ink);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}
.af-add:hover { background: #fff6d6; }
.af-add input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.af-add:has(input:focus-visible) { outline: 3px solid #005387; outline-offset: 2px; }
.af-add.is-busy { cursor: progress; opacity: 0.7; }
.af-add__icon {
  width: 30px;
  height: 30px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23101522' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l2-3h6l2 3h3v11H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.af-privacy { margin: 16px 0 0; color: var(--af-muted); font-size: 0.82rem; }
.af-privacy a, .af-hint a { color: var(--af-ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--af-yellow); text-decoration-thickness: 2px; }

/* navigation */
.af-form-error { margin: 16px 0 0; padding: 12px 14px; border-radius: 10px; background: #fdecec; color: var(--af-red); font-weight: 700; }
.af-nav { display: flex; gap: 10px; margin-top: 22px; }
.af-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 22px;
  border: 2px solid var(--af-ink);
  border-radius: 10px;
  color: var(--af-ink);
  font-family: var(--af-display);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  cursor: pointer;
  transition: background-color 120ms ease, transform 100ms ease;
}
.af-btn:active { transform: translateY(1px); }
.af-btn:disabled { cursor: progress; opacity: 0.7; }
.af-btn:focus-visible { outline: 3px solid #005387; outline-offset: 3px; }
.af-btn--go { flex: 1; background: var(--af-yellow); }
.af-btn--go:hover { background: #ffd04d; }
.af-btn--back { background: #fff; }
.af-btn--back:hover { background: var(--af-pave); }

/* success */
.af-done { display: grid; justify-items: start; gap: 10px; padding: 8px 0; }
.af-done p { margin: 0; }
.af-done__icon {
  width: 56px;
  height: 56px;
  border: 3px solid var(--af-ink);
  border-radius: 12px;
  background: var(--af-yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23101522' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 32px no-repeat;
}

@media (max-width: 620px) {
  form.anfrage { padding: 18px 14px 20px; border-radius: 14px; box-shadow: 0 0 0 4px var(--af-yellow), 0 18px 40px rgba(16, 21, 34, 0.12); }
  .af-steps li span:last-child { display: none; }
  .af-steps li { justify-content: center; }
  .af-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .af-service img { height: 72px; }
  .af-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .af-grid .af-field:not(.af-wide):only-child { grid-column: 1 / -1; }
  .af-grid > .af-field:has(.af-choice),
  .af-grid > .af-field:has(input[type="date"]),
  .af-grid > .af-field:has(input[type="tel"]),
  .af-grid > .af-field:has(input[type="email"]) { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .af-service, .af-btn { transition: none; }
}
