/* ============================================================
   wizard.css — 5-Schritt Wizard Form Stile
   Design-Variablen sind in style.css definiert (nicht neu deklarieren)
   ============================================================ */

/* ── Wizard Page Layout ───────────────────────────────────── */
.wizard-page {
  background: var(--cream);
  padding: 48px 0 96px;
  min-height: calc(100vh - 72px);
}

.wizard-container {
  max-width: 680px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 24px;
  border: 1px solid var(--border);
  padding: 48px;
  position: relative;
  overflow: hidden;
}

@media (max-width: 767px) {
  .wizard-page {
    padding: 24px 0 64px;
  }
  .wizard-container {
    margin: 0 16px;
    padding: 32px 24px;
    border-radius: 16px;
  }
}

/* ── Progress Bar ─────────────────────────────────────────── */
.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
  position: relative;
}

.wizard-progress-track {
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  flex: 1;
}

.progress-step:last-child {
  flex: 0;
}

/* Connector line between circles */
.progress-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px;
  left: calc(50% + 20px);
  right: calc(-50% + 20px);
  height: 1px;
  background: var(--border);
  z-index: 0;
  transition: background 0.3s ease;
}

.progress-step.completed:not(:last-child)::after {
  background: var(--sage);
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--white);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.step-circle .step-check {
  display: none;
}

.progress-step.active .step-circle {
  border-color: var(--sage);
  background: var(--mint-pale);
  color: var(--sage);
}

.progress-step.completed .step-circle {
  border-color: var(--sage);
  background: var(--sage);
  color: var(--white);
}

.progress-step.completed .step-circle .step-number {
  display: none;
}

.progress-step.completed .step-circle .step-check {
  display: block;
}

.step-label {
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.progress-step.active .step-label {
  color: var(--sage);
  font-weight: 600;
}

.progress-step.completed .step-label {
  color: var(--slate);
}

@media (max-width: 500px) {
  .step-label {
    display: none;
  }
}

/* ── Wizard Steps ─────────────────────────────────────────── */
.wizard-step {
  display: none;
  animation: none;
}

.wizard-step.active {
  display: block;
}

/* Slide animations */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

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

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

.wizard-step.slide-in-right {
  display: block;
  animation: slideInRight 0.3s ease forwards;
}

.wizard-step.slide-in-left {
  display: block;
  animation: slideInLeft 0.3s ease forwards;
}

.wizard-step.slide-out-left {
  display: block;
  animation: slideOutLeft 0.3s ease forwards;
  position: absolute;
  width: calc(100% - 96px);
}

.wizard-step.slide-out-right {
  display: block;
  animation: slideOutRight 0.3s ease forwards;
  position: absolute;
  width: calc(100% - 96px);
}

@media (max-width: 767px) {
  .wizard-step.slide-out-left,
  .wizard-step.slide-out-right {
    width: calc(100% - 48px);
  }
}

/* ── Step Text ────────────────────────────────────────────── */
.step-overline {
  display: block;
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.step-title {
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--charcoal);
  margin: 0 0 32px 0;
}

@media (max-width: 767px) {
  .step-title {
    font-size: 22px;
    margin-bottom: 24px;
  }
}

/* ── Option Grid (2×2) ────────────────────────────────────── */
.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

@media (max-width: 500px) {
  .option-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

/* ── Option Row (4 across) ────────────────────────────────── */
.option-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}

@media (max-width: 600px) {
  .option-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

/* ── Option Card ──────────────────────────────────────────── */
.option-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 20px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.option-card:hover {
  border-color: var(--mint);
  background: var(--warm-white);
}

.option-card.selected {
  border-color: var(--sage);
  background: var(--mint-pale);
}

.option-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
}

.option-icon svg {
  width: 48px;
  height: 48px;
}

.option-label {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--charcoal);
  margin-top: 10px;
  line-height: 1.3;
}

.option-card.selected .option-label {
  color: var(--sage);
}

@media (max-width: 500px) {
  .option-card {
    padding: 18px 12px;
  }
  .option-icon {
    width: 40px;
    height: 40px;
  }
  .option-icon svg {
    width: 40px;
    height: 40px;
  }
  .option-label {
    font-size: 13px;
  }
}

/* ── Step Form (Step 3, 4, 5) ─────────────────────────────── */
.step-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group-label {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--charcoal);
}

/* Radio pills (Step 3 — Baujahr, Wohnfläche, Etagen) */
.radio-group-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-pill input[type="radio"] {
  display: none;
}

.radio-pill label {
  display: inline-block;
  padding: 10px 18px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--slate);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.radio-pill label:hover {
  border-color: var(--mint);
  color: var(--charcoal);
  background: var(--warm-white);
}

.radio-pill input[type="radio"]:checked + label {
  border-color: var(--sage);
  background: var(--mint-pale);
  color: var(--sage);
  font-weight: 600;
}

/* Small radio pills for Anrede */
.radio-pill-small input[type="radio"] {
  display: none;
}

.radio-pill-small label {
  display: inline-block;
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--slate);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.radio-pill-small label:hover {
  border-color: var(--mint);
  background: var(--warm-white);
}

.radio-pill-small input[type="radio"]:checked + label {
  border-color: var(--sage);
  background: var(--mint-pale);
  color: var(--sage);
  font-weight: 600;
}

/* ── PLZ Input (Step 4) ───────────────────────────────────── */
.plz-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 16px 0;
}

.plz-input {
  font-family: var(--f-mono);
  font-size: 36px;
  font-weight: 500;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: 12px;
  width: 200px;
  padding: 16px 20px;
  color: var(--charcoal);
  background: var(--white);
  transition: border-color 0.2s ease;
  letter-spacing: 0.1em;
  outline: none;
}

.plz-input:focus {
  border-color: var(--sage);
}

.plz-input.error {
  border-color: var(--error);
}

.ort-input-wrapper {
  width: 100%;
  max-width: 320px;
}

.ort-input-wrapper label {
  display: block;
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 8px;
  text-align: left;
}

.ort-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: var(--f-body);
  font-size: 15px;
  color: var(--charcoal);
  background: var(--white);
  transition: border-color 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.ort-input:focus {
  border-color: var(--sage);
}

/* ── Contact Form (Step 5) ────────────────────────────────── */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 500px) {
  .contact-form .form-row {
    grid-template-columns: 1fr;
  }
}

.contact-form .field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-form label {
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--charcoal);
}

.contact-form input,
.contact-form select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: var(--f-body);
  font-size: 15px;
  color: var(--charcoal);
  background: var(--white);
  transition: border-color 0.2s ease;
  outline: none;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

.contact-form input:focus,
.contact-form select:focus {
  border-color: var(--sage);
}

.contact-form input.error,
.contact-form select.error,
.plz-input.error {
  border-color: var(--error);
}

.field-error {
  font-family: var(--f-body);
  font-size: 12px;
  color: var(--error);
  margin-top: 2px;
  display: none;
}

.field-error.visible {
  display: block;
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--slate);
  cursor: pointer;
  line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  margin-top: 2px;
  transition: all 0.2s ease;
  background: var(--white);
  position: relative;
}

.checkbox-label input[type="checkbox"]:checked {
  background: var(--sage);
  border-color: var(--sage);
}

.checkbox-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.checkbox-label a {
  color: var(--sage);
  text-decoration: underline;
}

.checkbox-label.error-state input[type="checkbox"] {
  border-color: var(--error);
}

/* ── Wizard Navigation ────────────────────────────────────── */
.wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.wizard-nav.first-step {
  justify-content: flex-end;
}

.wizard-btn-prev {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--slate);
  border: 1.5px solid var(--sand);
  border-radius: 12px;
  padding: 12px 24px;
  font-family: var(--f-body);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wizard-btn-prev:hover {
  border-color: var(--slate);
  color: var(--charcoal);
}

.wizard-btn-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--sage);
  color: var(--white);
  border: none;
  border-radius: 12px;
  padding: 14px 32px;
  font-family: var(--f-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.wizard-btn-next:hover {
  background: var(--sage-light);
  transform: scale(1.02);
}

.wizard-btn-next:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.wizard-btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--sage);
  color: var(--white);
  border: none;
  border-radius: 14px;
  padding: 18px 36px;
  font-family: var(--f-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(74, 124, 92, 0.25);
}

.wizard-btn-submit:hover {
  background: var(--sage-light);
  transform: scale(1.02);
}

.wizard-btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.wizard-btn-submit .btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.wizard-btn-submit.loading .btn-spinner {
  display: block;
}

.wizard-btn-submit.loading .btn-text {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Form Error Banner ────────────────────────────────────── */
.wizard-error-banner {
  display: none;
  background: #fdf2f2;
  border: 1px solid var(--error);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--error);
  margin-top: 16px;
}

.wizard-error-banner.visible {
  display: block;
}

/* ── Anrede row ───────────────────────────────────────────── */
.anrede-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.anrede-group .form-group-label {
  font-size: 13px;
}

.anrede-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
