/* ======================================================================
   Anfrage-Ausweis Funnel (separate Website)
   Teil des Projekts: Demo-Website Energieberater — Demo-Design-System
   (Navy #253449 · Teal #4aa0a0 · Gold #EAB85E · Outfit/Nunito Sans)

   Flow-Pattern 1:1 nach KI-Readiness-Check-Template (OneGrain_Website):
   intro → steps (Progress-Bar + Step-Transitions) → lead → thank-you

   Einheitensystem: rem (1rem = 16px beim 100%-Browser-Default).
   Original-px-Werte stehen als Kommentar hinter jedem Wert.
   px nur noch für: Border-Dicken, Icon-/Bildmaße, Motion-Details.
   ====================================================================== */

/* ===== 1. DESIGN TOKENS ===== */
:root {
  --container-max: 73.125rem;    /* 1170px */
  --container-pad: 0.9375rem;    /* 15px */
  --navy: #253449;
  --navy-deep: #1a2e4a;
  --nav-page: #030712;
  --nav-glass: rgba(3, 7, 18, 0.22);
  --nav-panel: rgba(13, 17, 23, 0.95);
  --nav-outline: rgba(255, 255, 255, 0.1);
  --primary: #00E69D;
  --primary-foreground: #030711;
  --teal: #4aa0a0;
  --teal-soft: rgba(74, 160, 160, 0.12);
  --gold: #EAB85E;
  --ink: #0F1317;
  --light: #f6f6f6;
  --white: #ffffff;
  --black: #000000;
  --border: #e3e7ec;
  --text-muted: #5b6774;
  --error: #d64545;
  --error-soft: rgba(214, 69, 69, 0.08);
  --font-head: 'Outfit', sans-serif;
  --font-content: 'Nunito Sans', sans-serif;
  --radius-card: 1rem;           /* 16px */
  --radius-field: 0.625rem;      /* 10px */
  --shadow-card: 0 8px 30px rgba(15, 19, 23, 0.08);
}

/* ===== 2. BASE / RESET ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  font-family: var(--font-content);
  color: var(--ink);
  background: var(--light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
.svg-sprite { display: none; }
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}
h1, h2, h3 { font-family: var(--font-head); margin: 0; }
p { margin: 0; }
button { font-family: var(--font-content); }

/* ===== 5. MAIN / VIEWS ===== */
.funnel-main {
  padding: 7.5rem 0 4.6875rem; /* 120px 0 75px — Start unter der Navbar */
}
.view { display: block; }
.view[hidden] { display: none; }

/* ===== 6. INTRO-VIEW (Original: H1 + 2 Buttons 240×130, Radius 20px, Navy) ===== */
.view-intro {
  min-height: 60vh;
  display: flex;
  align-items: center;
  text-align: center;
}
.view-intro .container { display: flex; flex-direction: column; align-items: center; }
.intro-title {
  font-size: 2.5rem;           /* 40px */
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.intro-choice {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;                 /* 24px */
  margin-top: 2.5rem;          /* 40px */
}
.choice-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 15rem;                /* 240px */
  min-height: 8.125rem;        /* 130px */
  padding: 1.25rem;            /* 20px */
  background: var(--navy);
  color: var(--white);
  font-size: 1rem;             /* 16px */
  font-weight: 500;
  border: 1px solid var(--navy);
  border-radius: 1.25rem;      /* 20px */
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.choice-btn:hover {
  background: var(--navy-deep);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(37, 52, 73, 0.25);
}
.choice-btn-label { line-height: 1.3; }
.choice-btn-arrow {
  width: 20px; height: 20px;   /* Icon-Maß in px */
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.choice-btn:hover .choice-btn-arrow { opacity: 1; transform: translateX(0); }
.choice-btn:focus-visible,
.choice-btn:focus { outline: 2px solid var(--teal); outline-offset: 3px; }

/* ===== 7. FLOW-VIEW (KI-Check-Template-Pattern: Card + Progress + Steps) ===== */
.view-flow .container { max-width: 53.125rem; } /* 850px — Formularbreite */
.flow-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 2rem;               /* 32px */
}

/* Progress-Bar (Template: Label N/Total + 1.5px-Fill, Spring-Animation) */
.flow-progress { margin-bottom: 1.5rem; } /* 24px */
.flow-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.flow-progress-label {
  font-size: 0.75rem;          /* 12px */
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.flow-type-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;        /* 13px */
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-soft);
  border: none;
  border-radius: 9999px;
  padding: 0.3125rem 0.75rem;  /* 5px 12px */
  cursor: pointer;
  transition: background 0.15s ease;
}
.flow-type-btn:hover { background: rgba(74, 160, 160, 0.2); }
.flow-progress-track {
  height: 0.1875rem;           /* 3px */
  border-radius: 9999px;
  background: rgba(15, 19, 23, 0.08);
  overflow: hidden;
}
.flow-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 9999px;
  background: var(--teal);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1); /* Spring-artig */
}

/* Heading + Step-Transitions (Template: fade + slide-x 300ms) */
.flow-heading {
  font-size: 1.75rem;          /* 28px */
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1.5rem;
}
.flow-heading strong { font-weight: 700; }
.flow-fields.enter { animation: field-enter 0.3s ease both; }
@keyframes field-enter {
  from { opacity: 0; transform: translateX(2.5rem); } /* 40px */
  to { opacity: 1; transform: translateX(0); }
}

/* Actions (Zurück / Weiter) */
.flow-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;            /* 32px */
}
.flow-error {
  flex-basis: 100%;
  margin: 0.75rem 0 0;         /* 12px 0 0 */
  padding: 0.75rem 1rem;       /* 12px 16px */
  font-size: 0.875rem;         /* 14px */
  line-height: 1.6;
  color: #b3261e;
  background: #fdeeec;
  border: 1px solid #f5c6c2;
  border-radius: 0.625rem;     /* 10px */
}
.flow-next.is-loading {
  opacity: 0.7;
  pointer-events: none;
}
.flow-back,
.flow-next {
  font-size: 1rem;             /* 16px */
  font-weight: 700;
}
.flow-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--navy);
  background: transparent;
  border: 2px solid var(--navy);
  border-radius: 0.625rem;     /* 10px */
  padding: 0.75rem 1.5rem;     /* 12px 24px */
  cursor: pointer;
  transition: background 0.15s ease;
}
.flow-back:hover { background: rgba(37, 52, 73, 0.06); }
.flow-back[hidden] { display: none; }
.flow-back-icon { width: 16px; height: 16px; }
.flow-next {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--white);
  background: var(--teal);
  border: none;
  border-radius: 1.875rem;     /* 30px */
  padding: 0.625rem 1.25rem;   /* 10px 20px */
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.flow-next:hover { filter: brightness(1.08); }
.flow-next:active { transform: translateY(1px); }
.flow-next[hidden] { display: none; }
.flow-next-icon { width: 16px; height: 16px; }
.flow-next[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ===== 8. FELDER ===== */
.flow-fields { display: flex; flex-direction: column; gap: 1.25rem; } /* 20px */
.field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 1.25rem;         /* 20px */
  row-gap: 1.25rem;
}
.field-grid--single { grid-template-columns: minmax(0, 1fr); }
.field { display: flex; flex-direction: column; gap: 0.375rem; min-width: 0; } /* 6px */
.field-label {
  font-size: 0.9375rem;        /* 15px */
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}
.field-label .req { color: var(--error); margin-left: 0.125rem; }
.field-hint {
  font-size: 0.8125rem;        /* 13px */
  color: var(--text-muted);
}
.field-error {
  display: none;
  font-size: 0.8125rem;        /* 13px */
  font-weight: 600;
  color: var(--error);
}
.field.invalid .field-error { display: block; }
.field.invalid .field-input,
.field.invalid .field-select {
  border-color: var(--error);
  background: var(--error-soft);
}

/* Inputs / Textareas / Selects */
.field-input,
.field-select,
.field-textarea {
  width: 100%;
  font-family: var(--font-content);
  font-size: 1rem;             /* 16px — kein iOS Zoom-Fokus */
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-field);
  padding: 0.75rem;            /* 12px */
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(74, 160, 160, 0.18);
}
.field-input::placeholder,
.field-textarea::placeholder { color: rgba(91, 103, 116, 0.55); }
.field-textarea { resize: vertical; min-height: 5.5rem; line-height: 1.5; }
.field-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6774' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 16px;
  padding-right: 2.25rem;      /* 36px */
  cursor: pointer;
}
.field-select:has(option[value=""]:checked) { color: rgba(91, 103, 116, 0.55); }

/* Ja/Nein-Radio-Selector (segmentierte Pills — Nutzer-Vorgabe) */
.yesno-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-field);
  overflow: hidden;
  background: var(--white);
}
.yesno-opt {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5rem;             /* 80px */
  padding: 0.625rem 1.25rem;   /* 10px 20px */
  font-size: 0.9375rem;        /* 15px */
  font-weight: 600;
  color: var(--text-muted);
  background: var(--white);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.yesno-opt + .yesno-opt { border-left: 1px solid var(--border); }
.yesno-opt:hover { color: var(--navy); background: rgba(37, 52, 73, 0.04); }
.yesno-opt input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;     /* visuell versteckt, fokussierbar */
}
.yesno-opt.checked { background: var(--teal); color: var(--white); }
.yesno-opt.checked:hover { background: var(--teal); }
.yesno-opt:focus-within { box-shadow: inset 0 0 0 2px var(--teal); }
.field.invalid .yesno-group { border-color: var(--error); }

/* Checkbox-Gruppe (Wärmeübergabesysteme) */
.checkgroup { display: flex; flex-wrap: wrap; gap: 0.625rem; } /* 10px */
.checkgroup-opt {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;        /* 8px 16px */
  font-size: 0.9375rem;        /* 15px */
  font-weight: 600;
  color: var(--text-muted);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 9999px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.checkgroup-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.checkgroup-opt .cg-check {
  display: none;
  width: 14px; height: 14px;   /* Icon-Maß in px */
  flex-shrink: 0;
}
.checkgroup-opt.checked {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--ink);
}
.checkgroup-opt.checked .cg-check { display: block; color: var(--teal); }
.checkgroup-opt:focus-within { box-shadow: 0 0 0 2px var(--teal); }

/* T&C-Checkbox (Step 1) */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;                /* 12px */
  padding: 1rem;               /* 16px */
  background: rgba(37, 52, 73, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-field);
  cursor: pointer;
}
.consent-box {
  position: relative;
  width: 20px; height: 20px;   /* Icon-Maß in px */
  flex-shrink: 0;
  margin-top: 0.125rem;
  border: 2px solid #b6c0cb;
  border-radius: 0.3125rem;    /* 5px */
  background: var(--white);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.consent-box svg {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 12px; height: 12px;
  color: var(--white);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.consent input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}
.consent.checked .consent-box { background: var(--teal); border-color: var(--teal); }
.consent.checked .consent-box svg { opacity: 1; transform: scale(1); }
.consent input:focus-visible ~ .consent-box { box-shadow: 0 0 0 3px rgba(74, 160, 160, 0.25); }
.consent-text {
  font-size: 0.875rem;         /* 14px */
  color: var(--text-muted);
  line-height: 1.6;
}
.consent-text a { color: var(--teal); text-decoration: underline; }
.field.invalid .consent { border-color: var(--error); background: var(--error-soft); }

/* Tabelle (Verbrauch / Raumhöhen — wie Original: Label-Zeile + Value-Inputs) */
.field-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius-field);
  overflow: hidden;
}
.field-table th,
.field-table td {
  padding: 0.5rem 0.75rem;     /* 8px 12px */
  text-align: left;
  font-size: 0.9375rem;        /* 15px */
  border-bottom: 1px solid var(--border);
}
.field-table th {
  font-weight: 600;
  color: var(--navy);
  background: rgba(37, 52, 73, 0.04);
  white-space: nowrap;
}
.field-table tr:last-child td { border-bottom: none; }
.field-table .cell-input .field-input { padding: 0.4375rem 0.625rem; } /* 7px 10px */
.field-table .cell-input { min-width: 7rem; } /* 112px */

/* File-Upload (Drop-Zone + Dateiliste) */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.75rem 1rem;       /* 28px 16px */
  text-align: center;
  background: rgba(74, 160, 160, 0.04);
  border: 2px dashed rgba(74, 160, 160, 0.45);
  border-radius: var(--radius-field);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.upload-zone:hover,
.upload-zone.dragover { background: rgba(74, 160, 160, 0.09); border-color: var(--teal); }
.upload-zone-icon { width: 28px; height: 28px; color: var(--teal); } /* Icon-Maß in px */
.upload-zone-text {
  font-size: 0.9375rem;        /* 15px */
  font-weight: 600;
  color: var(--ink);
}
.upload-zone-hint {
  font-size: 0.8125rem;        /* 13px */
  color: var(--text-muted);
}
.upload-input { display: none; }
.upload-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; } /* 12px */
.upload-stale {
  margin: 0.5rem 0 0;          /* 8px 0 0 */
  padding: 0.5rem 0.75rem;     /* 8px 12px */
  font-size: 0.8125rem;        /* 13px */
  line-height: 1.5;
  color: #8a5a00;
  background: #fdf3d7;
  border: 1px solid #ecd9a0;
  border-radius: 0.5rem;       /* 8px */
}
.upload-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;               /* 10px */
  padding: 0.5rem 0.75rem;     /* 8px 12px */
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-field);
  font-size: 0.875rem;         /* 14px */
}
.upload-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 600;
}
.upload-item-size { color: var(--text-muted); flex-shrink: 0; }
.upload-item-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;   /* Icon-Maß in px */
  flex-shrink: 0;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.upload-item-remove:hover { color: var(--error); background: var(--error-soft); }
.upload-item-icon { width: 16px; height: 16px; color: var(--teal); flex-shrink: 0; }

/* Konditionale Felder (Ja→einblenden, Nein→ausblenden) */
.field.conditional { display: none; }
.field.conditional.visible {
  display: flex;
  animation: cond-enter 0.3s ease both;
}
@keyframes cond-enter {
  from { opacity: 0; transform: translateY(-0.375rem); } /* 6px */
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 9. THANK-YOU-VIEW ===== */
.view-thanks .container { max-width: 40rem; } /* 640px */
.view-thanks {
  min-height: 60vh;
  display: flex;
  align-items: center;
}
.thanks-card {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 3rem 2rem;          /* 48px 32px */
  text-align: center;
}
.thanks-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;               /* 56px */
  height: 3.5rem;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: rgba(74, 160, 160, 0.14);
  color: var(--teal);
  animation: thanks-pop 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.thanks-check svg { width: 26px; height: 26px; } /* Icon-Maß in px */
@keyframes thanks-pop {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}
.thanks-title {
  font-size: 1.75rem;          /* 28px */
  font-weight: 600;
  color: var(--ink);
}
.thanks-text {
  margin-top: 0.75rem;
  font-size: 1.0625rem;        /* 17px */
  color: var(--ink);
  font-weight: 600;
}
.thanks-sub {
  margin-top: 0.5rem;
  font-size: 0.9375rem;        /* 15px */
  color: var(--text-muted);
}
.thanks-actions { margin-top: 2rem; }
.thanks-actions .btn-ghost {
  color: var(--navy);
  border-color: var(--navy);
}
.thanks-actions .btn-ghost:hover { background: rgba(37, 52, 73, 0.06); }

/* ===== 10. RESPONSIVE ===== */
@media (max-width: 47.9375em) { /* 767px */
  .funnel-main { padding: 5.5rem 0 3rem; } /* 88px 0 48px */
  .intro-title { font-size: 2rem; }        /* 32px */
  .choice-btn { width: 100%; max-width: 22.5rem; } /* 360px */
  .flow-card { padding: 1.25rem; }         /* 20px */
  .flow-heading { font-size: 1.375rem; }   /* 22px */
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .flow-actions { flex-wrap: wrap-reverse; }
  .flow-actions .flow-next,
  .flow-actions .flow-back { flex: 1 1 auto; justify-content: center; }
  .thanks-card { padding: 2rem 1.25rem; }
}
