:root {
  --color-bg: #000000;
  --color-bg-elevated: #141414;
  --color-text: #FFFFFF;
  --color-text-muted: #909090;
  --color-accent: #FAB214;
  --color-accent-grad-start: #FDD068;
  --color-accent-grad-end: #C8890F;
  --font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --container-width: 480px;
  --radius-l: 20px;
  --radius-m: 14px;
  --radius-s: 8px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.funnel-container {
  max-width: var(--container-width);
  margin: 0 auto;
  /* Jeder Schritt ist ein eigener Flex-Container, der mindestens den
     sichtbaren Bildschirm ausfuellt. svh = kleiner Viewport, aendert sich
     beim Ein-/Ausblenden der Browserleiste nicht. */
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 28px 20px 40px;
  position: relative;
}

/* Inhaltsbloecke behalten ihre eigene Hoehe und werden im Flex-Container
   nicht gestaucht. */
.funnel-container > * {
  flex: 0 0 auto;
}

h1, h2, h3 {
  margin: 0 0 16px;
  font-weight: 600;
}

h1 {
  font-size: 22px;
  text-align: center;
}

h2 {
  font-size: 19px;
  text-align: center;
}

p {
  color: var(--color-text-muted);
  font-size: 14px;
}

/* ---------- Progress + Back nav (quiz steps) ---------- */

.step-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.step-nav__back {
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.step-nav__progress {
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.step-nav__progress-fill {
  height: 100%;
  background: var(--color-accent);
  transition: width 0.3s ease;
}

/* Erster Schritt: kein Zurück-Pfeil – der Balken bleibt trotzdem
   auf derselben Höhe wie auf allen folgenden Schritten. */
.step-nav--no-back .step-nav__progress {
  margin-left: 44px;
}

/* ---------- Question / option cards ---------- */

.question-block {
  /* Kein margin-top: der Container ist ein Flex-Layout, dort kollabieren
     Aussenabstaende nicht. Ein eigener Wert wuerde sich also auf die 36px
     der Fortschrittsleiste draufaddieren statt mit ihnen zu verschmelzen. */
  margin: 0 0 32px;
}

.option-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
}

.option-card {
  flex: 0 1 calc(50% - 7px);
  background: var(--color-bg-elevated);
  border: 1px solid rgba(220, 187, 107, 0.25);
  border-radius: var(--radius-m);
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.option-card:hover,
.option-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--color-accent);
  background: rgba(220, 187, 107, 0.08);
}

.option-card.is-selected {
  border-color: var(--color-accent);
  background: rgba(220, 187, 107, 0.14);
}

.option-card__icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.option-card__icon--photo {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  margin: 0 0 14px;
}

.option-card__icon--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-s);
}

.option-card__label {
  font-size: 15px;
  font-weight: 500;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* ---------- Form ---------- */

.funnel-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 24px;
}

.funnel-form input,
.funnel-form select,
.funnel-form textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-s);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  font-family: inherit;
  font-size: 16px;
}

.funnel-form input::placeholder {
  color: var(--color-text-muted);
}

.funnel-form input.field--error {
  border-color: #e05555 !important;
}

.field-error {
  background: rgba(224, 85, 85, 0.1);
  border: 1px solid rgba(224, 85, 85, 0.4);
  border-radius: var(--radius-s);
  color: #e88;
  font-size: 13px;
  line-height: 1.55;
  padding: 10px 14px;
  margin-top: 10px;
}

.funnel-form label {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: -6px;
}

/* ---------- Form subtitle ---------- */

.form-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--color-text-muted);
  margin: -8px 0 8px;
}

/* ---------- Checkbox consent ---------- */

.form-group--checkbox {
  margin-top: 4px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.checkbox-label span {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

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

/* ---------- Buttons ---------- */

.btn-primary {
  display: block;
  width: 100%;
  padding: 16px;
  margin-top: 8px;
  border: none;
  border-radius: var(--radius-s);
  background: var(--color-accent);
  color: #1a1000;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- Thank you / info step ---------- */

.info-step {
  /* Fuellt den Platz oberhalb des Footers, damit der Inhalt mittig steht. */
  flex: 1 1 auto;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.info-step__icon {
  width: 64px;
  height: 64px;
}

/* ---------- Loading animation overlay ---------- */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  z-index: 200;
  animation: fadeIn 0.25s ease;
}

.loading-svg {
  width: 120px;
  height: 120px;
  overflow: visible;
}

.loading-track {
  fill: none;
  stroke: rgba(250, 178, 20, 0.15);
  stroke-width: 3;
}

.loading-spinner {
  fill: none;
  stroke: #FAB214;
  stroke-width: 3;
  stroke-linecap: butt;
  stroke-dasharray: 188 64;
  transform-origin: 50px 50px;
  animation: spin-arc 1s linear infinite;
  transition: opacity 0.2s;
}

.loading-done {
  fill: none;
  stroke: #FAB214;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 0 251.3;
  transform-origin: 50px 50px;
  transform: rotate(-90deg);
  opacity: 0;
}

.loading-done.is-active {
  animation: draw-circle 0.55s ease forwards;
}

.loading-check {
  fill: none;
  stroke: #FAB214;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
}

.loading-check.is-active {
  animation: draw-check 0.4s ease 0.1s forwards;
}

.loading-text {
  color: var(--color-text-muted);
  font-size: 16px;
  margin: 0;
}

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

@keyframes draw-circle {
  0%   { stroke-dasharray: 0 251.3;  opacity: 0; }
  15%  { stroke-dasharray: 10 241.3; opacity: 1; }
  100% { stroke-dasharray: 251.3 0;  opacity: 1; }
}

@keyframes draw-check {
  to { stroke-dashoffset: 0; }
}

/* ---------- PLZ input step ---------- */

.plz-wrap {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.plz-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-s);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  font-family: inherit;
  font-size: 16px;
  transition: border-color 0.15s ease;
}

.plz-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.plz-input--error {
  border-color: #e05555 !important;
}

.plz-input::placeholder {
  color: var(--color-text-muted);
  letter-spacing: normal;
  font-size: 15px;
}

.plz-error {
  background: rgba(224, 85, 85, 0.1);
  border: 1px solid rgba(224, 85, 85, 0.4);
  border-radius: var(--radius-s);
  color: #e88;
  font-size: 13px;
  line-height: 1.55;
  padding: 12px 14px;
}

.plz-btn {
  margin-top: 4px;
}

/* ---------- List-layout options ---------- */

.question-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
  margin: -8px 0 20px;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-list-item {
  width: 100%;
  padding: 18px 20px;
  background: var(--color-bg-elevated);
  border: 1px solid rgba(220, 187, 107, 0.25);
  border-radius: var(--radius-m);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  text-align: left;
}

.option-list-item:hover,
.option-list-item:focus-visible {
  transform: translateX(4px);
  border-color: var(--color-accent);
  background: rgba(220, 187, 107, 0.08);
}

/* ---------- Exclude modal ---------- */

.exclude-overlay {
  position: fixed;
  inset: 0;
  padding-top: 60px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.exclude-sheet {
  background: var(--color-bg-elevated);
  border-top: 1px solid rgba(250, 178, 20, 0.25);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  width: 100%;
  max-width: var(--container-width);
  max-height: 100%;
  overflow-y: auto;
  padding: 32px 24px 48px;
  animation: slideUp 0.28s cubic-bezier(0.34, 1.1, 0.64, 1);
}

@keyframes slideUp {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.exclude-sheet__back {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--color-accent);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 28px;
  padding: 0;
}

.exclude-sheet__heading {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--color-accent);
}

.exclude-sheet__subheading {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin: 24px 0 10px;
}

.exclude-sheet__paragraph {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0 0 14px;
  line-height: 1.65;
}

.exclude-sheet__contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.exclude-sheet__contact a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.exclude-sheet__contact a:hover {
  text-decoration: underline;
}

.exclude-sheet__hint {
  margin-top: 28px;
  padding: 14px 16px;
  border-radius: var(--radius-s);
  background: rgba(250, 178, 20, 0.08);
  border: 1px solid rgba(250, 178, 20, 0.2);
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ==================================================================
   KONFIGURATOR — Raumanzahl, Ergebnis, Hinweis
   (ergänzt das bestehende Funnel-Design, ändert nichts daran)
   ================================================================== */

/* ---------- Zahlenkacheln (Raumanzahl) ---------- */

.option-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.option-tile {
  background: var(--color-bg-elevated);
  border: 1px solid rgba(220, 187, 107, 0.25);
  border-radius: var(--radius-m);
  padding: 20px 10px 16px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.option-tile:hover,
.option-tile:focus-visible {
  transform: translateY(-2px);
  border-color: var(--color-accent);
  background: rgba(220, 187, 107, 0.08);
}

.option-tile__label {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--color-text);
}

.option-tile__sub {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Volle Breite für "Mehr als 5 Räume" */
.option-tile--wide {
  grid-column: 1 / -1;
  flex-direction: row;
  justify-content: center;
  padding: 18px 16px;
}

.option-tile--wide .option-tile__label {
  font-size: 15px;
  font-weight: 500;
}

/* ---------- Ergebnisscreen ---------- */

.result {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: var(--color-bg-elevated);
  border: 1px solid rgba(220, 187, 107, 0.2);
  border-radius: var(--radius-m);
}

.result-row__room {
  display: flex;
  flex-direction: column;
  font-size: 15px;
  font-weight: 500;
}

.result-row__room span {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 400;
}

.result-row__device {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.result-row__device strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-accent);
}

.result-row__device span {
  font-size: 12px;
  color: var(--color-text-muted);
}

.result__summary {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(250, 178, 20, 0.3);
  border-radius: var(--radius-m);
  overflow: hidden;
}

.result-sum {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  background: rgba(250, 178, 20, 0.06);
  border-bottom: 1px solid rgba(250, 178, 20, 0.15);
}

.result-sum:last-child {
  border-bottom: 0;
}

.result-sum span {
  font-size: 13px;
  color: var(--color-text-muted);
}

.result-sum strong {
  font-size: 15px;
  font-weight: 600;
  text-align: right;
}

/* Außengerät noch nicht freigegeben → gedämpft statt fett hervorgehoben */
.result-sum--offen strong {
  color: var(--color-text-muted);
  font-weight: 500;
  font-style: italic;
}

.result__hint {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin: 0;
}

/* ---------- Hinweis: individuelle Prüfung ---------- */

.notice {
  margin-top: 12px;
  padding: 24px 20px;
  background: var(--color-bg-elevated);
  border: 1px solid rgba(250, 178, 20, 0.25);
  border-radius: var(--radius-m);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.notice__badge {
  align-self: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: rgba(250, 178, 20, 0.1);
  border: 1px solid rgba(250, 178, 20, 0.3);
  border-radius: 999px;
  padding: 5px 12px;
}

.notice h2 {
  margin: 0;
  font-size: 19px;
}

.notice p {
  margin: 0;
  line-height: 1.65;
  /* Fliesstext linksbuendig: zentriert ist er ueber mehrere Zeilen
     deutlich schlechter lesbar als die Ueberschrift darueber. */
  text-align: left;
}

/* ---------- Konfigurations-Zusammenfassung über dem Formular ---------- */

.form-konfig {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  margin-top: 8px;
  background: rgba(250, 178, 20, 0.06);
  border: 1px solid rgba(250, 178, 20, 0.22);
  border-radius: var(--radius-s);
}

.form-konfig span {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.form-konfig strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-accent);
}

/* ---------- PLZ-Feld im Formular: Prüfung läuft ---------- */

.funnel-form input.field--pruefend {
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(250, 178, 20, 0.12) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: plz-pruefung 1s linear infinite;
}

@keyframes plz-pruefung {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .funnel-form input.field--pruefend { animation: none; }
  .option-tile:hover,
  .option-card:hover,
  .option-list-item:hover { transform: none; }
}
