/* ==========================================================================
   Mandant werden – Fragebogen (nur auf /mandant-werden/ geladen)
   Baut auf styles.css auf (Tokens, .field, .btn, .form-card, .consent).
   Ohne JavaScript: alle Abschnitte untereinander, normales Absenden.
   Mit JavaScript (.is-wizard): ein Schritt nach dem anderen, Fortschritt, Verzweigung.
   ========================================================================== */

.mandant-grid { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 1000px) {
  .mandant-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.75fr); gap: 3.5rem; }
  .mandant-aside { position: sticky; top: calc(var(--header-h) + 1.5rem); }
}
.mandant-aside { display: grid; gap: 1.5rem; }
.mandant-aside h2 { font-size: 1.35rem; }
.mandant-aside p { color: var(--ink-soft); font-size: 0.97rem; }
.mandant-aside .list-check { margin-top: 1rem; font-size: 0.97rem; }
.mandant-aside .quote--single { max-width: none; }
.mandant-aside__phone { font-size: 0.95rem; border-top: 1px solid var(--line-ink); padding-top: 1rem; }
.mandant-aside__phone a { font-weight: 700; text-decoration: none; }

/* ---------- Grundgerüst ---------- */
.wizard { gap: 0; }
.wizard__step { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 1.15rem; }
.wizard__step + .wizard__step { margin-top: 2.2rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.wizard__legend { padding: 0; margin: 0 0 0.35rem; font-family: var(--font-display); font-size: 1.3rem; line-height: 1.25; color: var(--ink); outline: none; float: left; width: 100%; }
.wizard__legend + * { clear: both; }
.wizard__kicker { display: block; font-family: var(--font-mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--navy); margin-bottom: 0.45rem; }
.wizard__step > .field, .wizard__step > .form__row, .wizard__step > .wizard__sub, .wizard__step > .consent, .wizard__step > .hp-feld { clear: both; }
.req { color: var(--accent-deep); margin-left: 2px; font-weight: 700; }
.choice-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.choice-group__label { display: block; font-size: 0.88rem; font-weight: 700; color: var(--ink); margin: 0 0 0.5rem; }
.choice-group__label .optional { font-weight: 400; color: var(--stone); }
.choice-group.has-error .choice { --choice-line: rgba(155, 59, 46, 0.55); }
.wizard__submit { display: grid; gap: 0.8rem; margin-top: 1.8rem; }
.wizard .form__status { margin-top: 1.2rem; }

/* ---------- Auswahl: Chips, Liste, Karten ---------- */
.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choice { --choice-line: var(--line); position: relative; display: inline-flex; cursor: pointer; }
.choice input { position: absolute; left: 0; top: 0; opacity: 0; width: 1px; height: 1px; margin: 0; padding: 0; border: 0; pointer-events: none; }
/* .field label / .field input aus styles.css nicht auf die Auswahl anwenden */
.choice-group label.choice { display: inline-flex; font-size: inherit; font-weight: 400; color: inherit; margin: 0; }
.choice-group .choices--list label.choice, .choice-group label.choice--card { display: flex; }
.choice > span {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.95rem; font-size: 0.94rem; line-height: 1.3; color: var(--ink);
  background: var(--paper); border: 1px solid var(--choice-line); border-radius: var(--r-pill);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.choice:hover > span { border-color: var(--navy); background: #fff; }
.choice input:focus-visible + span, .choice input:focus-visible + .choice__box { outline: 2px solid var(--navy); outline-offset: 2px; }
.choice input:checked + span { background: var(--navy-tint); border-color: var(--navy); color: var(--navy-deep); box-shadow: inset 0 0 0 1px var(--navy); }
.choice--check > span::before {
  content: ''; width: 14px; height: 14px; flex: none; border: 1.5px solid var(--line-ink); border-radius: 4px; background: #fff;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.choice--check input:checked + span::before {
  border-color: var(--navy); background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.4'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.choice:active > span { transform: scale(0.98); }

/* Liste: volle Breite, mit Radio-Punkt */
.choices--list { flex-direction: column; gap: 0.45rem; }
.choices--list .choice { display: flex; }
.choices--list .choice > span { width: 100%; border-radius: var(--r); padding: 0.75rem 1rem; }
.choices--list .choice:not(.choice--check) > span::before {
  content: ''; width: 16px; height: 16px; flex: none; border: 1.5px solid var(--line-ink); border-radius: 50%; background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.choices--list .choice:not(.choice--check) input:checked + span::before { border-color: var(--navy); box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 8px var(--navy); }

/* Karten (Schritt 1) */
.choices--cards { display: grid; gap: 0.75rem; }
@media (min-width: 640px) { .choices--cards { grid-template-columns: repeat(3, 1fr); } }
.choice--card { display: flex; }
.choice > .choice__box {
  display: grid; gap: 0.35rem; align-content: start; width: 100%;
  padding: 1.15rem 1.15rem 1.25rem; background: var(--paper); border: 1px solid var(--choice-line); border-radius: var(--r-lg);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease, transform 0.25s var(--ease-out);
}
.choice > .choice__box strong { font-size: 1rem; line-height: 1.3; color: var(--ink); }
.choice > .choice__box small { font-size: 0.86rem; line-height: 1.45; color: var(--stone); }
.choice__icon { flex: none; width: 38px; height: 38px; color: var(--navy); margin-bottom: 0.35rem; transition: transform 0.35s var(--ease-out); }
.choice--card:hover .choice__box { background: #fff; border-color: var(--navy); transform: translateY(-2px); box-shadow: var(--shadow); }
.choice--card:hover .choice__icon { transform: translateY(-2px); }
.choice--card input:checked + .choice__box { background: var(--navy-tint); border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.choice--card input:checked + .choice__box strong { color: var(--navy-deep); }
@media (max-width: 639px) {
  .choice > .choice__box { grid-template-columns: 38px 1fr; column-gap: 0.9rem; align-items: start; }
  .choice__icon { grid-row: span 2; margin: 0; }
}

/* Bedingte Unterfragen und Hinweise */
.wizard__sub { display: grid; gap: 1.05rem; padding: 1rem 0 0.2rem 1.1rem; border-left: 2px solid var(--navy-tint); }
.wizard__sub-note { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--stone); margin: 0; }
.wizard__hint { margin: 0.7rem 0 0; padding: 0.7rem 0.95rem; font-size: 0.9rem; color: var(--ink-soft); background: var(--paper); border-left: 3px solid var(--accent); border-radius: 0 var(--r) var(--r) 0; }
.wizard:not(.is-wizard) .wizard__hint { display: none; }
.field__hint { margin: -0.2rem 0 0.6rem; font-size: 0.88rem; color: var(--stone); }
[data-show-if][hidden], [data-branch][hidden] { display: none !important; }

/* ---------- Schritt-Modus (nur mit JavaScript) ---------- */
.wizard.is-wizard .wizard__step { display: none; }
.wizard.is-wizard .wizard__step + .wizard__step { margin-top: 0; padding-top: 0; border-top: 0; }
.wizard.is-wizard .wizard__step.is-active { display: grid; animation: wz-in 0.38s var(--ease-out); }
.wizard.is-wizard .wizard__step.is-active.is-back { animation-name: wz-in-back; }
.wizard.is-wizard .wizard__submit { display: none; }
.wizard.is-wizard.is-last .wizard__submit { display: grid; }
.wizard.is-wizard .wizard__kicker { display: none; }
.wizard.is-wizard .wizard__sub:not([hidden]) { animation: wz-fade 0.3s ease; }
@keyframes wz-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes wz-in-back { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes wz-fade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.wizard__progress { margin: 0 0 1.4rem; }
.wizard__count { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 0 0 0.55rem; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--stone); }
.wizard__count strong { color: var(--navy); font-weight: 500; }
.wizard__bar { position: relative; height: 4px; border-radius: 4px; background: var(--paper-deep); overflow: hidden; }
.wizard__bar span { position: absolute; inset: 0; background: linear-gradient(90deg, var(--navy) 0%, var(--navy-soft) 100%); border-radius: inherit; transform-origin: left; transform: scaleX(0.2); transition: transform 0.55s var(--ease-out); }

.wizard__nav { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; margin-top: 1.8rem; padding-top: 1.3rem; border-top: 1px solid var(--line); }
.wizard__nav .btn { min-width: 8.5rem; }
.wizard__next { margin-left: auto; }
.wizard__next::after { content: '→'; transition: transform 0.2s var(--ease-out); }
.wizard__next:hover::after { transform: translateX(3px); }
.wizard__back::before { content: '←'; }
.wizard.is-last .wizard__nav { border-top: 0; margin-top: 0.8rem; padding-top: 0; }
.wizard.is-last .wizard__next { display: none; }
.wizard__nav [hidden] { display: none; }

@media (max-width: 480px) {
  .wizard__nav .btn { min-width: 0; padding-inline: 1.2rem; }
  .choice > span { font-size: 0.92rem; padding: 0.55rem 0.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  .wizard.is-wizard .wizard__step.is-active, .wizard.is-wizard .wizard__sub:not([hidden]) { animation: none; }
  .wizard__bar span { transition: none; }
}

/* Design-Review E4: mobil „Weiter“ in voller Breite, „Zurück“ darüber als Textlink-Zeile */
@media (max-width: 639px) {
  .wizard__nav { flex-wrap: wrap; }
  .wizard__next { flex: 1 1 100%; order: 2; margin-left: 0; }
  .wizard__back { order: 1; }
}
