/* ==========================================================================
   Wizard – Multi-Step-Formular — funktionaler Layer.
   Reset-Block (isoliert Wizard-Children von Parent-Cascade), Layout-Mechanik
   (Grid 12-col, Progress-Bar, Step-Slide-Animation, Modal), Form-Field-Reset
   (Select-Arrow-SVG, Focus-Reset, Radio-Hide-Trick, Resize), Responsive Stack,
   Wizard-Col-Span-Klassen (Grid-Layout-Behavior), Step-Show/Hide.
   ========================================================================== */

/* ── Container ─────────────────────────────────────────────────────────── */

.wizard {
  position: relative;
  overflow: hidden;
}

/* ── Reset: Isolation von Parent-Styles ─────────────────────────────────── */

.wizard,
.wizard *,
.wizard *::before,
.wizard *::after {
  box-sizing: border-box;
}

.wizard h2,
.wizard h3,
.wizard h4 {
  font-family: var(--font-body);
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  margin: 0;
  padding: 0;
  color: inherit;
  text-align: left;
  clear: none;
}

.wizard p {
  margin: 0;
  padding: 0;
}

.wizard img {
  margin: 0;
  float: none;
  display: inline;
  border-radius: 0;
}

.wizard a {
  color: inherit;
  text-decoration: inherit;
}

.wizard ul,
.wizard ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}

.wizard li {
  position: static;
  padding-left: 0;
  margin-bottom: 0;
  line-height: inherit;
}

.wizard li::before {
  content: none;
  display: none;
}

.wizard figure {
  margin: 0;
  padding: 0;
}

.wizard select,
.wizard input,
.wizard textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ── Progress Bar Layout ───────────────────────────────────────────────── */

.wizard__progress-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.wizard__progress-track {
  position: relative;
  overflow: hidden;
}

.wizard__progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  transition: width 0.4s ease;
}

/* ── Step-Slide-Animations ─────────────────────────────────────────────── */

.wizard__step {
  animation: wizardSlideIn 0.4s ease both;
}

@keyframes wizardSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

.wizard__step--back {
  animation: wizardSlideBack 0.4s ease both;
}

@keyframes wizardSlideBack {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Title-Pattern ─────────────────────────────────────────────────────── */

.wizard .wizard__section-title {
  grid-column: span 12;
}

/* ── Fields Container (12-col Grid) ────────────────────────────────────── */

.wizard__fields {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
}

.wizard__field {
  grid-column: span 12;
  min-width: 0;
}

.wizard__field-label {
  display: block;
  grid-column: span 12;
}

/* ── Inputs ────────────────────────────────────────────────────────────── */

.wizard__field input[type="text"],
.wizard__field input[type="email"],
.wizard__field input[type="tel"],
.wizard__field input[type="number"],
.wizard__field select,
.wizard__field textarea {
  width: 100%;
  outline: none;
  transition: border-color var(--transition);
}

.wizard__field textarea {
  resize: vertical;
}

.wizard__field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
}

/* ── Icon-Card Grid ────────────────────────────────────────────────────── */

.wizard__icon-grid {
  display: flex;
  justify-content: flex-start;
  grid-column: span 12;
}

.wizard__icon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: border-color var(--transition), opacity var(--transition);
  flex: 0 0 auto;
}

.wizard__icon-img {
  display: flex;
  align-items: center;
  justify-content: center;
}

.wizard .wizard__icon-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Icon-Grid mit fester Spaltenanzahl (für >4 Optionen sinnvoll) */
.wizard__icon-grid[class*="wizard__icon-grid--cols-"] {
  display: grid;
  justify-content: stretch;
}
.wizard__icon-grid.wizard__icon-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.wizard__icon-grid.wizard__icon-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
.wizard__icon-grid.wizard__icon-grid--cols-5 { grid-template-columns: repeat(5, 1fr); }
.wizard__icon-grid.wizard__icon-grid--cols-6 { grid-template-columns: repeat(6, 1fr); }

.wizard__icon-grid[class*="wizard__icon-grid--cols-"] .wizard__icon-card {
  max-width: 100%;
  width: 100%;
}

/* ── Radio-Buttons ─────────────────────────────────────────────────────── */

.wizard .wizard__field--radio {
  grid-column: span 12;
}

.wizard .wizard__radio-icon {
  object-fit: contain;
  float: right;
}

.wizard .wizard__radio-body {
  display: flex;
  flex-direction: column;
}

.wizard .wizard__radio-group {
  display: flex;
  flex-wrap: wrap;
}

.wizard .wizard__radio-option {
  display: flex;
  align-items: center;
  cursor: pointer;
}

/* Hide native radio input (visuelle Variante wird via .wizard__radio-text) */
.wizard .wizard__radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.wizard .wizard__radio-text {
  display: inline-block;
  transition: all var(--transition);
  cursor: pointer;
}

/* ── Checkbox ──────────────────────────────────────────────────────────── */

.wizard__field--checkbox {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
}

.wizard__field--checkbox input[type="checkbox"] {
  flex-shrink: 0;
  cursor: pointer;
}

/* ── Consent Section ───────────────────────────────────────────────────── */

.wizard__consent {
  display: flex;
  flex-direction: column;
}

/* ── Navigation Buttons ────────────────────────────────────────────────── */

.wizard__nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.wizard__btn {
  cursor: pointer;
  transition: all var(--transition);
}

.wizard__btn--next {
  display: inline-flex;
  align-items: center;
  border: none;
}

.wizard__btn--next:disabled {
  cursor: not-allowed;
}

.wizard__btn--back {
  background: none;
  border: none;
  position: absolute;
  left: 0;
}

/* ── Status Message ────────────────────────────────────────────────────── */

.wizard__status {
  text-align: center;
}

/* ── Modal (Nutzungsbedingungen) ───────────────────────────────────────── */

.wizard__modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wizard__modal-backdrop {
  position: absolute;
  inset: 0;
}

.wizard__modal-content {
  position: relative;
  overflow-y: auto;
}

.wizard__modal-close {
  position: absolute;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* ── Wizard Col-Span (Grid-Layout-Behavior, static classes) ────────────── */

.wizard__field.wizard-col--span-1  { grid-column: span 1; }
.wizard__field.wizard-col--span-2  { grid-column: span 2; }
.wizard__field.wizard-col--span-3  { grid-column: span 3; }
.wizard__field.wizard-col--span-4  { grid-column: span 4; }
.wizard__field.wizard-col--span-5  { grid-column: span 5; }
.wizard__field.wizard-col--span-6  { grid-column: span 6; }
.wizard__field.wizard-col--span-7  { grid-column: span 7; }
.wizard__field.wizard-col--span-8  { grid-column: span 8; }
.wizard__field.wizard-col--span-9  { grid-column: span 9; }
.wizard__field.wizard-col--span-10 { grid-column: span 10; }
.wizard__field.wizard-col--span-11 { grid-column: span 11; }

/* ── Success-Screen Show/Hide ──────────────────────────────────────────── */

.wizard__step--success { display: none; }
.wizard__step--success.wizard__step--active { display: block; }

/* ── Responsive Layout-Switches ────────────────────────────────────────── */

@media (min-width: 769px) and (max-width: 1024px) {
  .wizard__icon-grid.wizard__icon-grid--cols-4,
  .wizard__icon-grid.wizard__icon-grid--cols-5,
  .wizard__icon-grid.wizard__icon-grid--cols-6 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .wizard__icon-grid {
    flex-wrap: wrap;
    justify-content: center;
  }
  .wizard__icon-grid.wizard__icon-grid--cols-3,
  .wizard__icon-grid.wizard__icon-grid--cols-4,
  .wizard__icon-grid.wizard__icon-grid--cols-5,
  .wizard__icon-grid.wizard__icon-grid--cols-6 {
    grid-template-columns: repeat(2, 1fr);
  }
  .wizard__nav {
    position: relative;
  }
  .wizard__btn--next {
    width: 100%;
    justify-content: center;
  }
  .wizard__btn--back {
    position: static;
    align-self: center;
    order: 2;
  }
}
/* ==========================================================================
   Wizard – r2go4 visueller Layer.
   Drift bereinigt:
     - #f2f2f2 (Input-bg) → var(--color-bg-light) (Drift, etwas dunkler)
     - #c0392b (Error-Border + Status-Error-Text) → var(--color-danger)
     - #fdf0ef (Status-Error-bg) → var(--color-danger-bg)
     - #27ae60 (Status-Success-Text) → var(--color-success) (dunkler-stabiler)
     - #edf9f0 (Status-Success-bg) → var(--color-success-bg)
   Generic-Schwarz-Alpha-Shadows bleiben inline (kein Brand-Drift):
     0 2px 24px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.03), 0 8px 40px rgba(0,0,0,0.2),
     rgba(0,0,0,0.45) Modal-Backdrop.
   ========================================================================== */

.wizard {
  margin: 4rem 0;
  padding: 2.5rem 3rem;
  background: var(--color-white);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.03);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text-dark);
}

/* ── Progress Bar ──────────────────────────────────────────────────────── */

.wizard__progress {
  margin-bottom: 2rem;
}

.wizard__progress-info {
  margin-bottom: 0.5rem;
}

.wizard__step-label {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.wizard__step-counter {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--color-text-light);
  letter-spacing: 0.02em;
}

.wizard__progress-track {
  background: var(--color-bg-light);
  height: 3px;
}

.wizard__progress-bar {
  background: var(--color-primary);
}

/* ── Titles ────────────────────────────────────────────────────────────── */

.wizard .wizard__title,
.wizard .wizard__section-title {
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1.3;
  color: var(--color-text-dark);
  margin: 0 0 1.75rem;
  padding: 0;
  text-align: left;
}

.wizard .wizard__title + .wizard__subtitle {
  margin-top: -1.25rem;
}

.wizard .wizard__section-title {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.wizard .wizard__title strong,
.wizard .wizard__section-title strong {
  font-weight: 700;
}

.wizard .wizard__subtitle {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text);
  text-align: left;
  margin: -1rem 0 1.75rem;
}

/* ── Fields ────────────────────────────────────────────────────────────── */

.wizard__fields {
  gap: 0.75rem 1rem;
}

.wizard__field-label {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text-dark);
  margin-bottom: 1.25rem;
}

/* ── Inputs ────────────────────────────────────────────────────────────── */

.wizard__field input[type="text"],
.wizard__field input[type="email"],
.wizard__field input[type="tel"],
.wizard__field input[type="number"],
.wizard__field select,
.wizard__field textarea {
  padding: 0.875rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--color-text-dark);
  background: var(--color-bg-light);
  border: 1px solid var(--color-bg-light);
  border-radius: 0;
}

.wizard__field input:focus,
.wizard__field select:focus,
.wizard__field textarea:focus {
  border-color: var(--color-primary);
}

.wizard__field input::placeholder,
.wizard__field textarea::placeholder {
  color: var(--color-text-light);
  font-weight: 300;
}

.wizard__field select {
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.wizard__field--error {
  border-color: var(--color-danger) !important;
}

/* ── Icon-Cards ────────────────────────────────────────────────────────── */

.wizard__icon-grid {
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.wizard__icon-card {
  gap: 0.5rem;
  padding: 0.5rem;
  background: none;
  border: 2px solid transparent;
  border-radius: 4px;
  font-family: var(--font-body);
  color: var(--color-text);
  max-width: 10rem;
}

.wizard__icon-card:hover {
  opacity: 0.85;
}

.wizard__icon-card--active .wizard__icon-img {
  border: 2px solid var(--color-primary);
  border-radius: 4px;
}

.wizard__icon-img {
  width: 10rem;
  height: 10rem;
}

.wizard__icon-label {
  font-size: 0.6875rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text);
}

/* ── Radio-Buttons ─────────────────────────────────────────────────────── */

.wizard .wizard__radio-icon {
  width: 8rem;
  height: 8rem;
  margin: -3.75rem 0 0.5rem 1rem;
}

.wizard .wizard__radio-body {
  gap: 0.5rem;
}

.wizard .wizard__radio-label {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text-dark);
}

.wizard .wizard__radio-group {
  gap: 0.5rem;
}

.wizard .wizard__radio-text {
  padding: 0.875rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--color-text-dark);
  background: var(--color-bg-light);
  border: 2px solid var(--color-bg-light);
}

.wizard .wizard__radio-option:hover .wizard__radio-text {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.wizard .wizard__radio-option input[type="radio"]:checked + .wizard__radio-text {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
  font-weight: 500;
}

/* ── Checkbox ──────────────────────────────────────────────────────────── */

.wizard__field--checkbox {
  gap: 0.625rem;
}

.wizard__field--checkbox input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin-top: 0.1em;
  accent-color: var(--color-primary);
}

.wizard__field--checkbox span {
  font-family: var(--font-body);
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--color-text-dark);
}

.wizard .wizard__field--checkbox a {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* ── Consent ───────────────────────────────────────────────────────────── */

.wizard__consent {
  gap: 0.625rem;
  margin-top: 1.75rem;
}

/* ── Navigation ────────────────────────────────────────────────────────── */

.wizard__nav {
  margin-top: 1.5rem;
  gap: 1rem;
}

.wizard__btn {
  font-family: var(--font-body);
}

.wizard__btn--next {
  color: var(--color-white);
  background: var(--color-primary);
  padding: 0.875rem 2rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  gap: 0.5rem;
}

.wizard__btn--next:hover {
  background: var(--color-primary-dark);
}

.wizard__btn--next:disabled {
  opacity: 0.5;
}

.wizard__btn--back {
  color: var(--color-text-light);
  padding: 0.5rem 0;
  font-size: 0.8125rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wizard__btn--back:hover {
  color: var(--color-text-dark);
}

/* ── Status ────────────────────────────────────────────────────────────── */

.wizard__status {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  padding: 0.625rem 1rem;
  margin-top: 0.75rem;
  min-height: 1rem;
}

.wizard__status--error {
  color: var(--color-danger);
  background: var(--color-danger-bg);
}

.wizard__status--success {
  color: var(--color-success);
  background: var(--color-success-bg);
}

/* ── Success Screen ────────────────────────────────────────────────────── */

.wizard__step--success {
  text-align: center;
  padding: 3rem 1rem;
}

.wizard__success-icon {
  color: var(--color-primary);
  margin-bottom: 1.5rem;
}

.wizard__success-icon svg {
  stroke: currentColor;
}

/* ── Modal ─────────────────────────────────────────────────────────────── */

.wizard__modal-backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.wizard__modal-content {
  background: var(--color-white);
  max-width: 40rem;
  max-height: 80vh;
  width: calc(100% - 2rem);
  padding: 2rem 2.5rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

/* Modal-Headings — designed-Variante (eigene Größen). Typo aus base.css.
   h4 mit font-weight: 700 + font-family body als bewusste Variante (Modal-
   Sub-Heading-Look, anders als base h4). */
.wizard .wizard__modal-content h3 {
  font-size: 1.5rem;
  margin: 0 0 1.25rem;
}

.wizard .wizard__modal-content h4 {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
}

.wizard .wizard__modal-body p {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--color-text);
  margin: 0 0 0.625rem;
}

.wizard__modal-close {
  top: 1rem;
  right: 1.25rem;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--color-text-light);
}

.wizard__modal-close:hover {
  color: var(--color-text-dark);
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .wizard__title {
    font-size: 1.2rem;
  }
  .wizard__icon-card {
    flex: 0 0 calc(50% - 0.5rem);
    max-width: none;
  }
  .wizard__icon-img {
    width: 7rem;
    height: 7rem;
  }
}

@media (max-width: 480px) {
  .wizard__icon-card {
    flex: 0 0 calc(50% - 0.5rem);
  }
  .wizard__icon-img {
    width: 5rem;
    height: 5rem;
  }
}

.wizard__title--centered,
.wizard__subtitle--centered { text-align: center; }
