.invalid-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
}

.invalid-state p {
  color: var(--text-secondary);
  font-size: 17px;
}

.invalid-state[hidden],
.assessment-container[hidden] {
  display: none;
}

.assessment-container {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.progress-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--action);
  border-radius: 999px;
  transition: width 0.3s var(--ease);
}

.progress-label {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: right;
}

.back-link {
  align-self: flex-start;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
}

.back-link[hidden] {
  display: none;
}

.step-card {
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.step-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@keyframes step-enter-anim {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-enter {
  animation: step-enter-anim 0.35s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  .step-enter {
    animation: none;
  }
}

.step-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  padding: 16px;
  border-radius: 50%;
  background: var(--action-bg);
  color: var(--action);
  box-sizing: border-box;
}

.step-icon svg {
  width: 100%;
  height: 100%;
}

.step-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
}

.step-hint,
.step-subtext {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 420px;
}

/* Stepper (Baujahr, Wohnfläche) */

.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 16px 0 24px;
}

.stepper-btn {
  width: 48px;
  height: 48px;
  min-height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 22px;
  line-height: 1;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), transform 0.1s var(--ease);
}

.stepper-btn:hover {
  border-color: var(--stone-400);
}

.stepper-btn:active {
  transform: scale(0.92);
}

input.stepper-value {
  min-width: 100px;
  max-width: 160px;
  width: auto;
  min-height: auto;
  font-size: 48px;
  font-weight: 300;
  font-family: var(--font);
  text-align: center;
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: var(--text-primary);
  -moz-appearance: textfield;
}

.stepper-value::-webkit-outer-spin-button,
.stepper-value::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper-value:focus {
  outline: 2px solid var(--text-primary);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

.button-next {
  min-height: 48px;
  padding: 0 28px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--action);
  color: var(--surface);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s var(--ease), transform 0.15s var(--ease);
}

.button-next:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* Pill buttons */

.pill-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.pill-btn {
  width: 100%;
  min-height: 52px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease), transform 0.1s var(--ease);
}

.pill-btn:hover {
  border-color: var(--stone-400);
}

.pill-btn:active {
  transform: scale(0.97);
}

.pill-btn.selected {
  border-color: var(--action);
  background: var(--action-bg);
  color: var(--action);
}

/* Info icon + tooltip (used on percent-slider and Bewertungsstichtag questions) */

.info-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  font-style: normal;
  font-family: Georgia, serif;
  cursor: help;
  margin-left: 6px;
  vertical-align: middle;
}

.info-icon:hover,
.info-icon:focus-visible {
  background: var(--action);
  color: #fff;
  outline: none;
}

.info-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--text-primary);
  color: var(--surface);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
  pointer-events: none;
}

.info-icon:hover .info-tooltip,
.info-icon:focus-visible .info-tooltip {
  visibility: visible;
  opacity: 1;
}

@media (max-width: 480px) {
  .info-tooltip {
    left: auto;
    right: -8px;
    transform: none;
    width: 180px;
  }
}

/* Percent slider */

.percent-slider-wrap {
  width: 100%;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.percent-slider-value {
  margin: 0;
  font-size: 26px;
  font-weight: 300;
  color: var(--text-primary);
  text-align: center;
}

.percent-slider {
  width: 100%;
  height: 44px;
  accent-color: var(--action);
}

/* Card grid (Immobilienart) */

.card-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease), transform 0.1s var(--ease), box-shadow 0.15s var(--ease);
}

.option-card:hover {
  border-color: var(--stone-400);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.option-card:active {
  transform: scale(0.97);
}

.option-card.selected {
  border-color: var(--action);
  background: var(--action-bg);
}

.option-card-icon {
  width: 28px;
  height: 28px;
  color: var(--action);
}

.option-card-icon svg {
  width: 100%;
  height: 100%;
}

.option-card-label {
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.trust-line {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.trust-line[hidden] {
  display: none;
}

/* Result page */

.result-label {
  margin: 8px 0 4px;
  font-size: 14px;
  color: var(--text-secondary);
}

.result-value {
  margin: 0 0 12px;
  font-size: 48px;
  font-weight: 300;
  color: var(--action);
}

.result-value-neutral {
  color: var(--text-primary);
}

.result-neutral-message {
  margin: 0 0 24px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-secondary);
  max-width: 420px;
}

.result-placeholder-note {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 420px;
}

.result-details {
  width: 100%;
  max-width: 420px;
  margin: 0 0 24px;
  text-align: left;
}

.result-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
}

.result-details p {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

.result-cta {
  width: 100%;
}

@media (max-width: 480px) {
  .step-title {
    font-size: 19px;
  }

  input.stepper-value {
    font-size: 36px;
    min-width: 80px;
  }

  .result-value {
    font-size: 36px;
  }
}
