/* Brennholz Portz: Formulare. Gehoert zu assets/brennholz-form.js. */

/* Platz reservieren, bis das Formular nach der Hydration eingehaengt ist (kein Layoutsprung). */
[data-id="kmMAGTj7i-RrGMQVmN-Hy"] > .con-kit-component-atom-list:empty,
[data-id="VOSAmzdOh90jdSR3UTDIg"] > .con-kit-component-atom-list:empty,
[data-id="1e41ff75-212a-4084-b214-20e779b7bbc0"] > .con-kit-component-atom-list:empty { min-height: 560px; }
[data-id="e0c197f4-ecab-4245-b422-ad0cad434ea3"] > .con-kit-component-atom-list:empty { min-height: 600px; }

.bp-host { width: 100%; }

.bp {
  --bp-amber: #F0A62B;
  --bp-amber-hover: #F5B547;
  --bp-petrol: #0E2A3B;
  --bp-ink: #04151F;
  --bp-cream: #F9F5EE;
  --bp-radius: 8px;
  --bp-ease: cubic-bezier(.2, .7, .2, 1);
  --bp-font-head: Manrope, "Helvetica Neue", Arial, sans-serif;
  --bp-font: Roboto, "Helvetica Neue", Arial, sans-serif;
  box-sizing: border-box;
  width: 100%;
  margin: 0 auto;
  font-family: var(--bp-font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--bp-text);
  text-align: left;
  -webkit-font-smoothing: antialiased;
}
.bp *, .bp *::before, .bp *::after { box-sizing: border-box; }
.bp [hidden] { display: none !important; }

/* Dunkel: Bestell-Quiz auf schwarzem Grund oder Holzbild (wie bisher). */
.bp[data-theme="dark"] {
  --bp-text: #FFFFFF;
  --bp-muted: rgba(255, 255, 255, .78);
  --bp-surface: rgba(16, 16, 16, .86);
  --bp-surface-hover: rgba(34, 34, 34, .92);
  --bp-field: rgba(38, 38, 38, .94);
  --bp-line: rgba(255, 255, 255, .16);
  --bp-line-strong: rgba(255, 255, 255, .42);
  --bp-on-amber: var(--bp-petrol);
  --bp-focus: var(--bp-amber);
  --bp-error: #FFB4A6;
  --bp-link: var(--bp-amber);
  max-width: 780px;
}
/* Hell: Kontaktformular in der weissen Karte. */
.bp[data-theme="light"] {
  --bp-text: var(--bp-ink);
  --bp-muted: #4C5B64;
  --bp-surface: var(--bp-cream);
  --bp-field: transparent;
  --bp-line: rgba(4, 21, 31, .32);
  --bp-line-strong: var(--bp-ink);
  --bp-on-amber: var(--bp-ink);
  --bp-focus: var(--bp-petrol);
  --bp-error: #B3261E;
  --bp-link: var(--bp-petrol);
}

.bp-sr, .bp-hp {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}
.bp-hp { left: -10000px; }

.bp a { color: var(--bp-link); text-decoration: underline; text-underline-offset: 3px; }
.bp a:focus-visible, .bp button:focus-visible {
  outline: 3px solid var(--bp-focus); outline-offset: 3px; border-radius: 4px;
}
/* Titel bekommen den Fokus nur programmatisch (Schrittwechsel), sie sind nicht bedienbar. */
.bp .bp-title:focus { outline: none; }

/* ---------- Fortschritt ---------- */
.bp-progress { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0 auto 22px; }
.bp-progress__text { margin: 0; font-size: 15px; letter-spacing: .01em; color: var(--bp-muted); }
.bp-progress__track { width: min(240px, 60%); height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.bp-progress__bar { height: 100%; width: 0; border-radius: inherit; background: var(--bp-amber); transition: width .35s var(--bp-ease); }

/* ---------- Schritte ---------- */
.bp-form { margin: 0; }
.bp-step { margin: 0; padding: 0; border: 0; min-width: 0; }
.bp-legend { display: block; width: 100%; padding: 0; margin: 0; }
.bp-title {
  margin: 0 0 12px;
  font-family: var(--bp-font-head);
  font-weight: 800;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.18;
  letter-spacing: -.4px;
  text-transform: uppercase;
  color: var(--bp-text);
  text-wrap: balance;
}
.bp[data-theme="dark"] .bp-title { text-align: center; }
.bp-step__hint { max-width: 56ch; margin: 0 auto 8px; text-align: center; color: var(--bp-muted); font-size: 16px; }
.bp-step > .bp-legend + .bp-choices, .bp-step > .bp-title + .bp-field, .bp-step > .bp-title + .bp-pair { margin-top: 26px; }
.bp-step > .bp-step__hint + * { margin-top: 26px; }
.bp-step.is-enter-fwd { animation: bp-in-fwd .28s var(--bp-ease); }
.bp-step.is-enter-back { animation: bp-in-back .28s var(--bp-ease); }
@keyframes bp-in-fwd { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes bp-in-back { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }

/* ---------- Auswahl: Bildkarten und Kacheln ---------- */
.bp-choices { display: grid; gap: 14px; justify-content: center; }
.bp-choices--card { grid-template-columns: repeat(3, minmax(0, 224px)); gap: 18px; }
.bp-choices--pill { grid-template-columns: repeat(auto-fit, minmax(120px, max-content)); }
.bp-choice {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 60px;
  border-radius: var(--bp-radius);
  background: var(--bp-surface);
  color: var(--bp-text);
  cursor: pointer;
  overflow: hidden;
  transition: background-color .2s var(--bp-ease);
  -webkit-tap-highlight-color: transparent;
}
.bp-choice__input {
  position: absolute; inset: 0; z-index: 3;
  width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.bp-choice__frame {
  position: absolute; inset: 0; z-index: 2;
  border: 1px solid var(--bp-line);
  border-radius: inherit;
  pointer-events: none;
  transition: border-color .2s var(--bp-ease), box-shadow .2s var(--bp-ease);
}
.bp-choice__media { display: block; aspect-ratio: 1 / 1; background: #1a1a1a center / cover no-repeat; overflow: hidden; }
.bp-choice__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--bp-ease); }
.bp-choice__label { display: flex; align-items: center; flex: 1; padding: 20px 28px; font-size: 20px; line-height: 1.3; }
.bp-choice--pill .bp-choice__label { justify-content: center; padding: 14px 28px; text-align: center; }
.bp-choice__check {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bp-amber); color: var(--bp-petrol);
  opacity: 0; transform: scale(.6);
  transition: opacity .18s var(--bp-ease), transform .18s var(--bp-ease);
}
/* Kacheln: Auswahl als Amber-Flaeche (wie die Buttons der Seite). */
.bp-choice--pill .bp-choice__frame { z-index: 0; }
.bp-choice--pill .bp-choice__label { position: relative; z-index: 1; transition: color .2s var(--bp-ease); }
.bp-choice--pill .bp-choice__check { display: none; }
.bp-choice--pill .bp-choice__input:checked ~ .bp-choice__frame { background: var(--bp-amber); }
.bp-choice--pill .bp-choice__input:checked ~ .bp-choice__label { color: var(--bp-petrol); font-weight: 600; }
.bp-choice__input:checked ~ .bp-choice__frame { border-color: var(--bp-amber); box-shadow: inset 0 0 0 1px var(--bp-amber); }
.bp-choice__input:checked ~ .bp-choice__check { opacity: 1; transform: none; }
.bp-choice__input:focus-visible ~ .bp-choice__frame { outline: 3px solid var(--bp-focus); outline-offset: 3px; }
.bp-step.is-invalid .bp-choice__frame { border-color: var(--bp-error); }
@media (hover: hover) {
  .bp-choice:hover { background: var(--bp-surface-hover); }
  .bp-choice:hover .bp-choice__frame { border-color: var(--bp-line-strong); }
  .bp-choice:hover .bp-choice__media img { transform: scale(1.04); }
  .bp-choice:hover .bp-choice__input:checked ~ .bp-choice__frame { border-color: var(--bp-amber); }
}

/* ---------- Felder ---------- */
.bp-field { margin: 0 0 22px; text-align: left; }
.bp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.bp-pair--plz { grid-template-columns: minmax(0, 180px) 1fr; }
.bp-label { display: block; margin: 0 0 8px; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--bp-text); }
.bp-req { color: var(--bp-amber); }
.bp[data-theme="light"] .bp-req { color: var(--bp-muted); }
.bp-hint { margin: -2px 0 10px; font-size: 15px; color: var(--bp-muted); }
.bp-hint--pair { margin: -6px 0 20px; }
.bp-input {
  display: block;
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--bp-line);
  border-radius: var(--bp-radius);
  background: var(--bp-field);
  color: var(--bp-text);
  font: 400 18px/1.4 var(--bp-font);
  box-shadow: none;
  -webkit-appearance: none; appearance: none;
  transition: border-color .15s var(--bp-ease), box-shadow .15s var(--bp-ease);
}
.bp-input--area { min-height: 116px; resize: vertical; }
.bp-input::placeholder { color: var(--bp-muted); opacity: 1; }
.bp-input:hover { border-color: var(--bp-line-strong); }
.bp-input:focus { outline: none; border-color: var(--bp-focus); box-shadow: 0 0 0 1px var(--bp-focus); }
.bp-input[aria-invalid="true"] { border-color: var(--bp-error); box-shadow: 0 0 0 1px var(--bp-error); }
.bp-input[type="date"] { min-height: 60px; color-scheme: dark; }
.bp-input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; filter: invert(.85) sepia(1) saturate(4) hue-rotate(-10deg); width: 22px; height: 22px; }
.bp[data-theme="light"] .bp-input[type="date"] { color-scheme: light; }

/* Kontaktformular: Unterstrich-Felder wie bisher. */
.bp[data-theme="light"] .bp-field { margin-bottom: 18px; }
.bp[data-theme="light"] .bp-label { margin-bottom: 2px; }
.bp[data-theme="light"] .bp-input {
  min-height: 46px;
  padding: 10px 0;
  border-width: 0 0 1px;
  border-radius: 0;
  font-size: 17px;
}
.bp[data-theme="light"] .bp-input--area { min-height: 96px; padding-top: 8px; }
.bp[data-theme="light"] .bp-input:focus { box-shadow: 0 1px 0 0 var(--bp-focus); }
.bp[data-theme="light"] .bp-input[aria-invalid="true"] { box-shadow: 0 1px 0 0 var(--bp-error); }

.bp-error {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 8px 0 0;
  font-size: 15px; font-weight: 500; line-height: 1.4;
  color: var(--bp-error);
}
.bp-error::before {
  content: "!"; flex: none;
  display: grid; place-items: center;
  width: 18px; height: 18px; margin-top: 1px; border-radius: 50%;
  background: var(--bp-error); color: #111; font-size: 12px; font-weight: 800;
}
.bp[data-theme="light"] .bp-error::before { color: #fff; }
.bp-step > .bp-error, .bp-pair + .bp-error { margin: 2px 0 18px; }
.bp-hint--pair + .bp-error { margin: -12px 0 20px; }
.bp[data-theme="dark"] .bp-step > .bp-error { justify-content: center; margin-top: 16px; }

/* Menge mit Plus/Minus */
.bp-stepper { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; gap: 10px; max-width: 420px; margin: 0 auto; position: relative; }
.bp-stepper .bp-input { text-align: center; font-size: 26px; font-weight: 600; padding-right: 96px; padding-left: 16px; }
.bp-stepper__unit { position: absolute; right: 82px; top: 50%; transform: translateY(-50%); font-size: 15px; color: var(--bp-muted); pointer-events: none; }
.bp-stepper__btn {
  display: grid; place-items: center;
  width: 56px; height: 56px; margin: 0; padding: 0;
  border: 1px solid var(--bp-line); border-radius: var(--bp-radius);
  background: var(--bp-surface); color: var(--bp-text);
  cursor: pointer;
  transition: border-color .15s var(--bp-ease), background-color .15s var(--bp-ease);
}
.bp-stepper__btn:hover { border-color: var(--bp-line-strong); }
.bp-stepper__btn:active { background: var(--bp-surface-hover); }
.bp-step[data-step="menge"] .bp-field, .bp-step[data-step="termin"] .bp-field { max-width: 420px; margin-left: auto; margin-right: auto; }
.bp-step[data-step="menge"] .bp-hint { text-align: center; }
.bp-step[data-step="menge"] .bp-error, .bp-step[data-step="termin"] .bp-error { justify-content: center; }
.bp-step__hint--schuett { margin-top: 4px; }

/* Einwilligung */
.bp-consent { margin: 8px 0 22px; }
.bp-consent__label { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; font-size: 15px; line-height: 1.5; color: var(--bp-text); cursor: pointer; }
.bp-consent__box { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--bp-amber); cursor: pointer; }
.bp[data-theme="light"] .bp-consent__box { accent-color: var(--bp-petrol); }
.bp-consent__box:focus-visible { outline: 3px solid var(--bp-focus); outline-offset: 2px; }
.bp-consent.is-invalid .bp-consent__box { outline: 2px solid var(--bp-error); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.bp-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 30px; }
.bp-actions.is-first { justify-content: center; }
.bp-actions--full .bp-submit { width: 100%; }
.bp-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; margin: 0; padding: 0 30px;
  border: 0; border-radius: var(--bp-radius);
  background: var(--bp-amber); color: var(--bp-on-amber);
  font: 600 17px/1.2 var(--bp-font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s var(--bp-ease), transform .1s var(--bp-ease);
}
.bp[data-theme="light"] .bp-btn { border-radius: 4px; }
.bp-btn:hover { background: var(--bp-amber-hover); }
.bp-btn:active { transform: translateY(1px); }
.bp-btn[disabled] { cursor: progress; opacity: .85; }
.bp-btn--ghost { background: transparent; color: var(--bp-text); padding: 0 18px 0 12px; }
.bp-btn--ghost:hover { background: rgba(255, 255, 255, .08); }
.bp[data-theme="light"] .bp-btn--ghost { border: 1px solid var(--bp-line); padding: 0 22px; }
.bp[data-theme="light"] .bp-btn--ghost:hover { background: var(--bp-cream); }
.bp-submit { min-width: 200px; }
.is-sending .bp-submit .bp-btn__text::before {
  content: ""; display: inline-block; width: 16px; height: 16px; margin: 0 10px -2px 0;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: bp-spin .8s linear infinite;
}
@keyframes bp-spin { to { transform: rotate(360deg); } }

/* ---------- Ueberblick ---------- */
.bp-summary { margin: 26px 0 22px; padding: 0; border-top: 1px solid var(--bp-line); }
.bp-summary__row { display: grid; grid-template-columns: minmax(110px, 170px) 1fr; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--bp-line); }
.bp-summary dt { margin: 0; font-size: 15px; color: var(--bp-muted); }
.bp-summary dd { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0; min-width: 0; }
.bp-summary__value { min-width: 0; overflow-wrap: anywhere; white-space: pre-line; }
.bp-edit {
  flex: none; min-height: 44px; margin: -12px 0; padding: 0 4px;
  border: 0; background: none; color: var(--bp-link);
  font: 500 15px/1 var(--bp-font); text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- Fehler beim Senden ---------- */
.bp-alert {
  margin: 22px 0 0; padding: 18px 20px;
  border: 2px solid var(--bp-amber); border-radius: var(--bp-radius);
  background: var(--bp-petrol); color: var(--bp-cream);
  font-size: 16px;
}
.bp-alert p { margin: 0 0 8px; }
.bp-alert__title { font-weight: 700; color: var(--bp-amber); }
.bp-alert__links { margin: 0 0 14px; padding: 0; list-style: none; }
.bp-alert__links li { margin: 4px 0; }
.bp-alert a { color: var(--bp-amber); font-weight: 700; }
.bp-alert__note { color: rgba(249, 245, 238, .78); font-size: 14px; }
.bp-alert .bp-btn--ghost { border: 1px solid var(--bp-amber); color: var(--bp-cream); padding: 0 22px; }
.bp-alert .bp-btn--ghost:hover { background: rgba(240, 166, 43, .14); }
.bp-alert a:focus-visible, .bp-alert button:focus-visible { outline-color: var(--bp-amber); }

/* ---------- Erfolg ---------- */
.bp-done { text-align: center; padding: 8px 0; }
.bp-done__icon { display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: 18px; border-radius: 50%; background: var(--bp-amber); color: var(--bp-petrol); }
.bp-done__icon svg { width: 30px; height: 30px; }
.bp[data-theme="light"] .bp-done { text-align: left; }
.bp[data-theme="light"] .bp-done__title { font-size: clamp(24px, 2.6vw, 30px); }
.bp-done__text { margin: 0 0 6px; color: var(--bp-muted); }
.bp-summary--done { max-width: 520px; margin: 24px auto 0; text-align: left; }
.bp[data-theme="light"] .bp-summary--done { margin-left: 0; }

/* ---------- Mobil ---------- */
@media (max-width: 599px) {
  .bp { font-size: 16px; }
  .bp-progress { margin-bottom: 16px; }
  .bp-choices--card { grid-template-columns: 1fr; gap: 12px; }
  .bp-choice--card { flex-direction: row; align-items: stretch; min-height: 96px; }
  .bp-choice--card .bp-choice__media { flex: none; width: 104px; aspect-ratio: auto; }
  .bp-choice--card .bp-choice__label { padding: 16px 52px 16px 20px; font-size: 19px; }
  .bp-choice--card .bp-choice__check { top: 50%; margin-top: -15px; right: 14px; }
  .bp-choices--pill { grid-template-columns: 1fr; }
  .bp-step[data-step="scheit"] .bp-choices--pill { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bp-step[data-step="schweden"] .bp-choices--pill { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bp-step[data-step="scheit"] .bp-choice__label, .bp-step[data-step="schweden"] .bp-choice__label { padding: 16px 6px; font-size: 21px; }
  .bp-choice--pill { min-height: 58px; }
  .bp-pair, .bp-pair--plz { grid-template-columns: 1fr; }
  .bp-actions { margin-top: 24px; }
  .bp-submit { flex: 1; min-width: 0; }
  .bp-summary__row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .bp *, .bp *::before, .bp *::after { animation: none !important; transition: none !important; }
  .is-sending .bp-submit .bp-btn__text::before { border-right-color: currentColor; opacity: .5; }
}
