/* ============================================================
   Immobilienwert-Rechner Lübeck — Stylesheet
   Mobile-first, kein Framework-Dependency
   ============================================================ */

:root {
  --iwl-primary:    #1a3c5e;
  --iwl-accent:     #c8922a;
  --iwl-btn-cta:    #1a3c5e;
  --iwl-light:      #f4f7fb;
  --iwl-border:     #d1dae6;
  --iwl-text:       #1e2d3e;
  --iwl-muted:      #6b7d8f;
  --iwl-success:    #2e7d32;
  --iwl-radius:     8px;
  --iwl-shadow:     0 2px 12px rgba(0,0,0,.10);
}

/* Wrapper */
.iwl-rechner {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  color: var(--iwl-text);
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- Schritt-Indikator ---- */
.iwl-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 32px;
  position: relative;
}
.iwl-steps::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--iwl-border);
  z-index: 0;
}
.iwl-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 1;
  flex: 1;
}
.iwl-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--iwl-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--iwl-muted);
  transition: all .25s;
}
.iwl-step.active .iwl-step-circle {
  background: var(--iwl-primary);
  border-color: var(--iwl-primary);
  color: #fff;
}
.iwl-step.done .iwl-step-circle {
  background: var(--iwl-accent);
  border-color: var(--iwl-accent);
  color: #fff;
}
.iwl-step-label {
  font-size: 11px;
  color: var(--iwl-muted);
  text-align: center;
  line-height: 1.3;
}
.iwl-step.active .iwl-step-label {
  color: var(--iwl-primary);
  font-weight: 600;
}

/* ---- Formular-Panel ---- */
.iwl-panel {
  background: #fff;
  border: 1px solid var(--iwl-border);
  border-radius: var(--iwl-radius);
  padding: 28px 24px;
  box-shadow: var(--iwl-shadow);
  display: none;
}
.iwl-panel.iwl-active {
  display: block;
}

.iwl-panel-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--iwl-primary);
  margin: 0 0 6px;
}
.iwl-panel-sub {
  font-size: 14px;
  color: var(--iwl-muted);
  margin: 0 0 24px;
}

/* ---- Felder ---- */
.iwl-field {
  margin-bottom: 18px;
}
.iwl-field.iwl-hidden {
  display: none;
}

.iwl-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--iwl-text);
  margin-bottom: 6px;
}
.iwl-field label .iwl-required {
  color: #d32f2f;
  margin-left: 2px;
}
.iwl-field label .iwl-hint {
  font-weight: 400;
  color: var(--iwl-muted);
  font-size: 12px;
  margin-left: 4px;
}

.iwl-field input[type="text"],
.iwl-field input[type="number"],
.iwl-field input[type="email"],
.iwl-field input[type="tel"],
.iwl-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--iwl-border);
  border-radius: var(--iwl-radius);
  font-size: 15px;
  color: var(--iwl-text);
  background: #fff;
  box-sizing: border-box;
  transition: border-color .2s;
  appearance: none;
}
.iwl-field input:focus,
.iwl-field select:focus {
  outline: none;
  border-color: var(--iwl-primary);
  box-shadow: 0 0 0 3px rgba(26,60,94,.12);
}
.iwl-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7d8f' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Checkbox-Gruppe */
.iwl-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.iwl-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}
.iwl-check-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--iwl-primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ---- Buttons ---- */
.iwl-btn-row {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.iwl-btn {
  padding: 12px 28px;
  border-radius: var(--iwl-radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
  flex: 1;
}
.iwl-btn-primary {
  background: var(--iwl-btn-cta);
  color: #fff;
}
.iwl-btn-primary:hover {
  filter: brightness(0.85);
}
.iwl-btn-secondary {
  background: transparent;
  color: var(--iwl-primary);
  border: 2px solid var(--iwl-primary);
  flex: 0 0 auto;
}
.iwl-btn-secondary:hover {
  background: var(--iwl-light);
}
.iwl-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ---- Schnellschätzung (Schritt 1 Ergebnis) ---- */
.iwl-quick-result {
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--iwl-light);
  border: 1px solid var(--iwl-border);
  border-left: 4px solid var(--iwl-accent);
  border-radius: var(--iwl-radius);
  display: none;
}
.iwl-quick-result.iwl-visible {
  display: block;
}
.iwl-quick-result-label {
  font-size: 13px;
  color: var(--iwl-muted);
  margin-bottom: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.iwl-quick-result-range {
  font-size: 24px;
  font-weight: 700;
  color: var(--iwl-primary);
}
.iwl-quick-result-note {
  font-size: 12px;
  color: var(--iwl-muted);
  margin-top: 6px;
}

/* ---- Hauptergebnis ---- */
.iwl-result-panel {
  background: #fff;
  border: 2px solid var(--iwl-primary);
  border-radius: var(--iwl-radius);
  overflow: hidden;
  margin-top: 8px;
  display: none;
}
.iwl-result-panel.iwl-visible {
  display: block;
}

.iwl-result-header {
  background: var(--iwl-primary);
  color: #fff;
  padding: 20px 24px;
}
.iwl-result-header-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .75;
  margin-bottom: 4px;
}
.iwl-result-main-value {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}
.iwl-result-sqm {
  font-size: 14px;
  opacity: .80;
  margin-top: 4px;
}

.iwl-result-body {
  padding: 20px 24px;
}

/* Bandbreite-Balken */
.iwl-range-bar {
  margin: 16px 0;
}
.iwl-range-bar-label {
  font-size: 12px;
  color: var(--iwl-muted);
  margin-bottom: 6px;
}
.iwl-range-track {
  position: relative;
  height: 8px;
  background: var(--iwl-light);
  border-radius: 4px;
  overflow: visible;
}
.iwl-range-fill {
  position: absolute;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #c8922a44, var(--iwl-accent));
}
.iwl-range-pointer {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--iwl-primary);
  border: 2px solid #fff;
  border-radius: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.iwl-range-numbers {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--iwl-muted);
  margin-top: 6px;
}

/* Detail-Tabelle */
.iwl-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 16px;
}
.iwl-detail-table td {
  padding: 7px 0;
  border-bottom: 1px solid var(--iwl-light);
}
.iwl-detail-table td:first-child {
  color: var(--iwl-muted);
}
.iwl-detail-table td:last-child {
  text-align: right;
  font-weight: 600;
}
.iwl-detail-table tr:last-child td {
  border-bottom: none;
}

/* Methoden-Vergleich */
.iwl-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.iwl-method-box {
  background: var(--iwl-light);
  border-radius: 6px;
  padding: 14px;
  text-align: center;
}
.iwl-method-label {
  font-size: 11px;
  color: var(--iwl-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
}
.iwl-method-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--iwl-primary);
}

/* Hinweise */
.iwl-hinweise {
  margin-top: 16px;
}
.iwl-hinweis {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--iwl-muted);
  margin-bottom: 6px;
}
.iwl-hinweis::before {
  content: 'ℹ';
  flex-shrink: 0;
  color: var(--iwl-accent);
}

/* Disclaimer */
.iwl-disclaimer {
  margin-top: 20px;
  padding: 12px 16px;
  background: #fff8e8;
  border: 1px solid #f0c060;
  border-radius: var(--iwl-radius);
  font-size: 12px;
  color: #6b5300;
  line-height: 1.6;
}

/* ---- Lead-Formular ---- */

/* Datenschutzhinweis-Box (prominent, Panel 2) */
.iwl-dsgvo-notice {
  background: #e8f0fe;
  border: 1px solid #b3c6f7;
  border-left: 4px solid var(--iwl-primary);
  border-radius: var(--iwl-radius);
  padding: 14px 16px;
  font-size: 13px;
  color: #1e2d3e;
  line-height: 1.6;
  margin-bottom: 20px;
}
.iwl-dsgvo-notice strong {
  display: block;
  margin-bottom: 4px;
  color: var(--iwl-primary);
}

.iwl-dsgvo-box {
  margin-top: 8px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--iwl-muted);
  line-height: 1.5;
}
.iwl-dsgvo-box input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--iwl-primary);
  flex-shrink: 0;
}

/* CTA nach Ergebnis */
.iwl-cta-box {
  margin-top: 20px;
  padding: 16px 18px;
  background: #f0f5ff;
  border: 1px solid #c0d0f0;
  border-radius: var(--iwl-radius);
  font-size: 14px;
  color: var(--iwl-text);
  line-height: 1.6;
}
.iwl-cta-box p:first-child {
  font-weight: 600;
  margin: 0 0 6px;
}
.iwl-cta-box p {
  margin: 0;
}

/* Danke-Meldung */
.iwl-thankyou {
  text-align: center;
  padding: 32px 16px;
  display: none;
}
.iwl-thankyou.iwl-visible {
  display: block;
}
.iwl-thankyou-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.iwl-thankyou h3 {
  color: var(--iwl-primary);
  margin: 0 0 8px;
}
.iwl-thankyou p {
  color: var(--iwl-muted);
  font-size: 15px;
}

/* Loading-Spinner */
.iwl-loading {
  display: none;
  text-align: center;
  padding: 20px;
  color: var(--iwl-muted);
}
.iwl-loading.iwl-visible {
  display: block;
}
.iwl-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--iwl-border);
  border-top-color: var(--iwl-primary);
  border-radius: 50%;
  animation: iwl-spin .7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes iwl-spin { to { transform: rotate(360deg); } }

/* Fehler */
.iwl-error {
  background: #fde8e8;
  border: 1px solid #f5a0a0;
  color: #b00020;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  margin-top: 12px;
  display: none;
}
.iwl-error.iwl-visible {
  display: block;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .iwl-panel {
    padding: 20px 16px;
  }
  .iwl-step-label {
    display: none;
  }
  .iwl-result-main-value {
    font-size: 28px;
  }
  .iwl-methods {
    grid-template-columns: 1fr;
  }
  .iwl-checks {
    grid-template-columns: 1fr;
  }
  .iwl-btn-row {
    flex-direction: column;
  }
}
