/* =====================================================================
   Konsumentenretter – Anmeldeformular (Schritte + gut sichtbare Häkchen)
   Nutzt die Farben der Seite (--brand, --brand-deep, --ink, --border).
   Stand: 2026-11-01
   ===================================================================== */

#formRoot [hidden] { display: none !important; }

/* ---------- Fortschrittsleiste ---------- */
.kr-progress {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .25rem;
  counter-reset: none;
}
.kr-progress__item {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: .45rem;
  text-align: center; min-width: 0;
}
.kr-progress__item::before {               /* Verbindungslinie zum vorherigen Schritt */
  content: ""; position: absolute; top: 1.05rem; right: 50%; width: 100%; height: 3px;
  background: var(--border); border-radius: 3px; z-index: 0;
}
.kr-progress__item:first-child::before { display: none; }
.kr-progress__item.is-active::before,
.kr-progress__item.is-done::before { background: var(--brand); }
.kr-progress__dot {
  position: relative; z-index: 1;
  width: 2.25rem; height: 2.25rem; border-radius: 999px;
  display: grid; place-content: center;
  background: #fff; border: 2px solid var(--border); color: var(--muted-foreground);
  font-weight: 700; font-size: .95rem; transition: all .2s;
}
.kr-progress__check { width: 1.1rem; height: 1.1rem; display: none; }
.kr-progress__label {
  font-size: .78rem; font-weight: 600; color: var(--muted-foreground); line-height: 1.2;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.kr-progress__item.is-active .kr-progress__dot {
  border-color: var(--brand); background: var(--brand); color: #fff;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 18%, transparent);
}
.kr-progress__item.is-active .kr-progress__label { color: var(--ink); }
.kr-progress__item.is-done .kr-progress__dot { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand); }
.kr-progress__item.is-done .kr-progress__num { display: none; }
.kr-progress__item.is-done .kr-progress__check { display: block; }
.kr-progress__item.is-done .kr-progress__label { color: var(--brand-deep); }
.kr-progress__item.is-clickable { cursor: pointer; }
.kr-progress__item.is-clickable:hover .kr-progress__label { text-decoration: underline; }
@media (max-width: 420px) {
  .kr-progress__label { font-size: .68rem; }
  .kr-progress__dot { width: 2rem; height: 2rem; font-size: .85rem; }
  .kr-progress__item::before { top: .95rem; }
}

/* ---------- Weiter / Zurück ---------- */
.kr-step-nav { display: grid; gap: .9rem; margin-top: .25rem; }
.kr-step-back {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  justify-self: center; padding: .5rem 1rem; border-radius: 999px;
  font-size: .9rem; font-weight: 600; color: var(--muted-foreground); background: none; border: 0; cursor: pointer;
}
.kr-step-back:hover { color: var(--ink); background: var(--muted); }
.kr-step-error {
  margin: 0; padding: .8rem 1rem; border-radius: .9rem;
  background: #fef2f2; border: 1.5px solid #fca5a5; color: #b91c1c;
  font-size: .92rem; font-weight: 600; line-height: 1.4;
}

/* Markierte Felder mit Fehler */
.kr-invalid { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220, 38, 38, .15) !important; }

/* ---------- „Fast geschafft“-Hinweis ---------- */
.kr-almost {
  display: flex; gap: .9rem; align-items: flex-start;
  padding: 1rem 1.15rem; border-radius: 1rem;
  background: color-mix(in srgb, var(--brand) 8%, #fff);
  border: 1.5px solid color-mix(in srgb, var(--brand) 30%, #fff);
}
.kr-almost__icon { width: 1.6rem !important; height: 1.6rem !important; color: var(--brand); flex-shrink: 0; margin-top: .1rem; }
.kr-almost__title { margin: 0; font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.kr-almost__text { margin: .2rem 0 0; color: var(--ink); opacity: .8; font-size: .92rem; line-height: 1.45; }

/* ---------- Häkchen-Boxen ---------- */
.kr-consent {
  display: flex; align-items: flex-start; gap: .95rem;
  padding: 1rem 1.1rem; border-radius: 1rem;
  border: 2px solid var(--border); background: #fff;
  cursor: pointer; transition: border-color .15s, background-color .15s, box-shadow .15s;
  min-width: 0; width: 100%; box-sizing: border-box;
}
.kr-consent:hover { border-color: color-mix(in srgb, var(--brand) 55%, #fff); }
.kr-consent input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; margin: .05rem 0 0; flex-shrink: 0;
  width: 1.65rem; height: 1.65rem; border-radius: .45rem;
  border: 2px solid #94a3b8; background: #fff; cursor: pointer;
  display: grid; place-content: center; transition: all .15s;
}
.kr-consent input[type="checkbox"]::after {
  content: ""; width: .5rem; height: .9rem; margin-top: -.15rem;
  border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg) scale(0);
  transition: transform .15s;
}
.kr-consent input[type="checkbox"]:checked { background: var(--brand); border-color: var(--brand); }
.kr-consent input[type="checkbox"]:checked::after { transform: rotate(45deg) scale(1); }
.kr-consent input[type="checkbox"]:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.kr-consent:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, #fff); }
.kr-consent__body { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.kr-consent__text { color: var(--ink); font-size: .95rem; line-height: 1.5; }
.kr-consent__text a { color: var(--brand); font-weight: 600; text-decoration: underline; }
.kr-consent__tag {
  align-self: flex-start; font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: .12rem .5rem; border-radius: 999px; background: var(--muted); color: var(--muted-foreground);
}
.kr-consent__tag--pflicht { background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand-deep); }
.kr-consent__error { display: none; color: #b91c1c; font-size: .85rem; font-weight: 600; }
.kr-consent.is-error { border-color: #dc2626; background: #fef2f2; animation: kr-shake .35s; }
.kr-consent.is-error input[type="checkbox"] { border-color: #dc2626; }
.kr-consent.is-error .kr-consent__error { display: block; }

/* Newsletter-Box hervorheben */
.kr-consent--newsletter {
  border-style: dashed; border-color: color-mix(in srgb, var(--brand) 45%, #fff);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 7%, #fff), #fff 70%);
}
.kr-consent--newsletter:has(input:checked) { border-style: solid; }

@keyframes kr-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .kr-consent.is-error { animation: none; }
}

/* Auswahl-Liste (Bank/Anbieter) klappt im Formular auf und schiebt den
   Inhalt nach unten – so verdeckt sie nie den „Weiter“-Button. */
#leadForm [data-dropdown-menu] { position: static; margin-top: .5rem; }
