/* ===== CSS Variables ===== */
:root {
  --bg-white: #ffffff;
  --bg-gray: #f8f9fa;
  --primary: #1a6b3c;
  --primary-hover: #155c33;
  --primary-light: #f0fdf4;
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --success-bg: #dcfce7;
  --success-text: #166534;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.1);
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-gray);
  min-height: 100vh;
}

/* ===== Layout ===== */
.konfigurator-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.konfigurator-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
}

.konfig-titel {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.konfig-untertitel {
  font-size: 16px;
  color: var(--text-secondary);
}

.konfigurator-main {
  flex: 1;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== Phase Navigation ===== */
.phase-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-light);
}

.phase-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
}

.phase-step.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.phase-step.done {
  background: var(--success-bg);
  color: var(--success-text);
}

.phase-number {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--border-light);
  color: var(--text-muted);
  flex-shrink: 0;
}

.phase-step.active .phase-number { background: rgba(255,255,255,0.3); color: #fff; }
.phase-step.done .phase-number { background: var(--success-text); color: #fff; }

.phase-arrow { color: var(--border); display: flex; }
.phase-arrow svg { width: 16px; height: 16px; }

.phase-label { display: inline; }

/* ===== Contact Form ===== */
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-row.full { grid-template-columns: 1fr; }
.contact-group { display: flex; flex-direction: column; gap: 5px; }
.contact-group label {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
}
.contact-group label .required { color: var(--danger); }
.contact-group input, .contact-group select, .contact-group textarea {
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}
.contact-group input:focus, .contact-group select:focus, .contact-group textarea:focus {
  border-color: var(--primary);
}
.contact-group textarea { resize: vertical; min-height: 70px; }
.contact-group .field-error {
  font-size: 12px; color: var(--danger); display: none;
}
.contact-group.has-error input { border-color: var(--danger); }
.contact-group.has-error .field-error { display: block; }

.contact-submit {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.contact-submit .btn { width: 100%; justify-content: center; }
.contact-privacy {
  font-size: 11px; color: var(--text-muted); text-align: center; line-height: 1.5;
}

/* ===== Multi-Select ===== */
.multi-select-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.multi-select-hint {
  font-size: 12px; color: var(--text-muted); margin-top: -20px; margin-bottom: 20px;
}
.antwort-btn.multi-disabled {
  opacity: 0.45; pointer-events: none;
}

/* Contact time chips */
.kontaktzeit-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.kontaktzeit-chip {
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-white);
}
.kontaktzeit-chip:hover { border-color: var(--primary); color: var(--primary); }
.kontaktzeit-chip.selected { border-color: var(--primary); background: var(--primary-light); color: var(--success-text); }

/* ===== Wizard Card ===== */
.konfigurator-card {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
  max-width: 720px;
  width: 100%;
  overflow: hidden;
}

.progress-container {
  height: 5px;
  background: var(--border-light);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px 0;
}

.step-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.step-percent {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.step-content {
  padding: 24px 32px 32px;
}

.step-question {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.step-info {
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 28px;
}

/* ===== Answer Buttons ===== */
.antworten-grid {
  display: grid;
  gap: 14px;
}

.antworten-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.antworten-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.antworten-grid.cols-4 {
  grid-template-columns: repeat(2, 1fr);
}

.antworten-grid.cols-5 {
  grid-template-columns: repeat(3, 1fr);
}

.antwort-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 16px;
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.antwort-btn:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
}

.antwort-btn:active {
  transform: translateY(-1px);
}

.antwort-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.antwort-btn .antwort-icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
  flex-shrink: 0;
}

.antwort-btn .antwort-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

/* ===== Wizard Navigation ===== */
.wizard-nav {
  padding: 0 32px 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  line-height: 1;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(26, 107, 60, 0.3);
}

.btn-secondary {
  background: var(--bg-white);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-secondary:hover {
  background: var(--primary-light);
}

.btn-back {
  padding: 10px 20px;
  font-size: 14px;
}

/* ===== Loading State ===== */
.loading-container {
  max-width: 720px;
  width: 100%;
}

.loading-card {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
  padding: 48px 32px;
  text-align: center;
}

.loading-icon {
  margin-bottom: 20px;
}

.loading-icon svg {
  width: 48px;
  height: 48px;
  color: var(--primary);
}

.spin {
  animation: spin 1.2s linear infinite;
}

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

.loading-text {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 32px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.skeleton-tile {
  height: 160px;
  border-radius: var(--radius-lg);
  background: linear-gradient(110deg, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== Results ===== */
.results-container {
  max-width: 800px;
  width: 100%;
}

.results-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.results-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.results-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--success-bg);
  color: var(--success-text);
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
}

.results-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

/* ===== Tiles Grid ===== */
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 0;
}

.tile {
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 24px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tile:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.tile.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.tile-hersteller {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.tile-modell {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.tile-kategorie {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 4px;
  width: fit-content;
}

.tile-kategorie.kat-waermepumpe {
  background: #dbeafe;
  color: #1e40af;
}

.tile-kategorie.kat-gas {
  background: #fef3c7;
  color: #92400e;
}

.tile-kategorie.kat-pellet {
  background: var(--success-bg);
  color: var(--success-text);
}

.tile-kategorie.kat-hybrid {
  background: #ede9fe;
  color: #5b21b6;
}

.tile-kategorie.kat-solar {
  background: #fce7f3;
  color: #9d174d;
}

.tile-kategorie.kat-oel {
  background: #f3f4f6;
  color: #374151;
}

.tile-preis {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 8px;
}

.tile-preis-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== Detail Card ===== */
.detail-wrapper {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, margin 0.3s ease;
  margin-top: 0;
}

.detail-wrapper.open {
  max-height: 2000px;
  margin-top: 20px;
}

.detail-card {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
  padding: 36px 32px;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.detail-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.detail-specs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-spec-pill {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-gray);
  color: var(--text-secondary);
}

.detail-begruendung {
  font-size: 16px;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.7;
  margin-bottom: 28px;
  padding: 16px 20px;
  background: var(--bg-gray);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

/* Metric Badges */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.metric-badge {
  text-align: center;
  padding: 18px 12px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
}

.metric-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  display: block;
}

.metric-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 4px;
  display: block;
}

/* Cost Table */
.cost-section {
  margin-bottom: 28px;
}

.cost-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.cost-table {
  width: 100%;
  border-collapse: collapse;
}

.cost-table tr {
  border-bottom: 1px solid var(--border-light);
}

.cost-table tr:last-child {
  border-bottom: none;
}

.cost-table td {
  padding: 12px 0;
  font-size: 15px;
}

.cost-table td:last-child {
  text-align: right;
  font-weight: 500;
}

.cost-table .cost-label {
  color: var(--text-secondary);
}

.cost-table .foerderung-wert {
  color: var(--danger);
  font-weight: 600;
}

.cost-table .eigenanteil-row td {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  padding-top: 16px;
  border-top: 2px solid var(--text-primary);
}

/* Vorteile */
.vorteile-section {
  margin-bottom: 24px;
}

.vorteile-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vorteile-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.5;
}

.vorteile-list li svg {
  width: 20px;
  height: 20px;
  color: var(--success-text);
  flex-shrink: 0;
  margin-top: 2px;
}

/* CO2 Badge */
.co2-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--success-bg);
  color: var(--success-text);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 28px;
}

.co2-badge svg {
  width: 18px;
  height: 18px;
}

/* CTA Button */
.detail-cta {
  display: block;
  width: 100%;
  text-align: center;
  padding: 16px 28px;
  margin-bottom: 0;
}

/* Results Footer */
.results-footer {
  margin-top: 28px;
  padding: 20px 0;
}

.disclaimer {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.foerder-info {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
  font-weight: 500;
}

.results-actions {
  text-align: center;
  margin-top: 20px;
  padding-bottom: 20px;
}

/* ===== Error State ===== */
.error-container {
  max-width: 720px;
  width: 100%;
}

.error-card {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
  padding: 48px 32px;
  text-align: center;
}

.error-icon svg {
  width: 48px;
  height: 48px;
  color: var(--danger);
  margin-bottom: 16px;
}

.error-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.error-message {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ===== No Results ===== */
.no-results {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
  padding: 48px 32px;
  text-align: center;
}

.no-results svg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.no-results h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.no-results p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .phase-nav { gap: 4px; padding: 14px 12px 12px; }
  .phase-label { display: none; }
  .phase-step { padding: 6px 10px; }
  .contact-row { grid-template-columns: 1fr; }
  .multi-select-grid { grid-template-columns: 1fr; }

  .konfigurator-header {
    padding: 24px 16px;
  }

  .konfig-titel {
    font-size: 22px;
  }

  .konfigurator-main {
    padding: 24px 16px;
  }

  .step-meta {
    padding: 16px 20px 0;
  }

  .step-content {
    padding: 20px 20px 24px;
  }

  .step-question {
    font-size: 20px;
  }

  .wizard-nav {
    padding: 0 20px 20px;
  }

  .antworten-grid.cols-2,
  .antworten-grid.cols-3,
  .antworten-grid.cols-4,
  .antworten-grid.cols-5 {
    grid-template-columns: repeat(2, 1fr);
  }

  .antwort-btn {
    padding: 18px 12px;
  }

  .antwort-btn .antwort-icon {
    width: 28px;
    height: 28px;
  }

  .antwort-btn .antwort-label {
    font-size: 13px;
  }

  .tiles-grid {
    grid-template-columns: 1fr;
  }

  .tile-preis {
    font-size: 20px;
  }

  .detail-card {
    padding: 24px 20px;
  }

  .detail-name {
    font-size: 19px;
  }

  .metrics-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .metric-value {
    font-size: 20px;
  }

  .metric-label {
    font-size: 11px;
  }

  .metric-badge {
    padding: 14px 8px;
  }

  .skeleton-grid {
    grid-template-columns: 1fr;
  }

  .results-title {
    font-size: 22px;
  }

  .loading-card {
    padding: 36px 20px;
  }
}

@media (max-width: 374px) {
  .antworten-grid.cols-2,
  .antworten-grid.cols-3,
  .antworten-grid.cols-4,
  .antworten-grid.cols-5 {
    grid-template-columns: 1fr;
  }

  .metrics-row {
    grid-template-columns: 1fr;
  }
}
