/* Fragebogen- und Hinweis-Stile. Nutzt ausschließlich die bestehenden
 * Design-Tokens aus styles.css (Farben, Radius, Buttons bleiben identisch). */

/* Das HTML-Attribut [hidden] muss die display-Regeln unten schlagen –
 * sonst wären versteckte Schritte, die Danke-Meldung und der Notfallkasten
 * sichtbar. Klassenselektoren haben sonst Vorrang vor dem UA-[hidden]. */
[hidden] {
  display: none !important;
}

.notfall-inline {
  margin: 26px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ember);
  border-radius: 4px;
  background: var(--paper-glass);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  max-width: 640px;
}

.fb-page {
  max-width: 880px;
}

/* Kopfbereich tritt zurück, sobald der Fragebogen begonnen hat.
 * Weiche Übergänge verhindern das „Springen“ der Überschrift. */
.fb-page .page-header h1 {
  transition: font-size 320ms ease, margin 320ms ease;
}

.fb-page.fb-started .page-header {
  margin-bottom: 6px;
}

.fb-page.fb-started .page-header h1 {
  font-size: clamp(20px, 2.4vw, 26px);
  margin-bottom: 6px;
}

.fb-page .fb-intro {
  max-width: 640px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  overflow: hidden;
  transition: max-height 320ms ease, opacity 240ms ease, margin 320ms ease;
  max-height: 200px;
}

.fb-page.fb-started .fb-intro {
  max-height: 0;
  opacity: 0;
  margin: 0;
}

.fb-progress {
  margin: 42px 0 10px;
}

.fb-progress-track {
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.fb-progress-fill {
  height: 100%;
  width: 12.5%;
  border-radius: 2px;
  background: var(--green);
  transition: width 320ms ease;
}

.fb-progress-label {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.fb-form {
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.fb-step {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.fb-step legend {
  padding: 0;
  margin: 0 0 4px;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  outline: none;
}

.fb-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.fb-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fb-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  padding: 11px 14px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

/* Auswahlelemente sind deckend – kein durchscheinender Hintergrund-Effekt
 * in Kontrollfeldern. */
.fb-form input,
.fb-form select,
.fb-form textarea {
  background: var(--paper);
}

.fb-chip input,
.fb-consent input {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  padding: 0;
  margin: 0;
  flex: 0 0 auto;
  border: 1.5px solid var(--line-strong);
  border-radius: 3px;
  background: var(--paper);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
}

.fb-chip input[type="radio"],
.fb-consent input[type="radio"] {
  border-radius: 50%;
}

.fb-chip input:checked,
.fb-consent input:checked {
  background: var(--green);
  border-color: var(--green);
}

.fb-chip input:checked::after,
.fb-consent input:checked::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: inherit;
  background: var(--paper);
}

.fb-chip-flag input:checked {
  background: var(--ember);
  border-color: var(--ember);
}

.fb-chip:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}


.fb-chip:has(input:checked) {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 12%, var(--paper));
}

.fb-chip-wide {
  flex: 1 1 100%;
}

.fb-chip-flag:has(input:checked) {
  border-color: var(--ember);
  background: color-mix(in srgb, var(--ember) 12%, var(--paper));
}

.fb-scale-group {
  display: grid;
  gap: 10px;
}

/* Aufeinanderfolgende Unterabschnitte innerhalb eines Schritts durch die
 * gewohnte horizontale Trennlinie separieren (gleicher Token wie sonst). */
.fb-scale-group + .fb-scale-group {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.fb-scale-title {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
}

.fb-redflag {
  border: 1px solid var(--ember);
  border-left-width: 3px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--ember) 7%, var(--paper-glass));
  padding: 18px 20px;
  display: grid;
  gap: 10px;
}

.fb-redflag h3 {
  margin: 0;
  font-size: 17px;
}

.fb-redflag p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}

.fb-consent-block {
  display: grid;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.fb-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  cursor: pointer;
}

.fb-consent input {
  margin-top: 2px;
}

.fb-nav {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-top: 10px;
}

.fb-nav .button {
  min-width: 132px;
  cursor: pointer;
}

.fb-nav #fb-next,
.fb-nav #fb-submit {
  margin-left: auto;
}

.fb-error {
  margin: 6px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--ember);
  border-radius: 4px;
  color: var(--ink);
  background: color-mix(in srgb, var(--ember) 8%, var(--paper-glass));
  font-size: 14px;
}

.fb-done {
  margin-top: 42px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 16px;
  max-width: 640px;
}

.fb-done h2 {
  margin: 0;
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.1;
}

.fb-done p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.fb-done .button {
  justify-self: start;
}

.fb-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 640px) {
  .fb-nav {
    flex-direction: column-reverse;
  }
  .fb-nav .button {
    width: 100%;
  }
  .fb-nav #fb-next,
  .fb-nav #fb-submit {
    margin-left: 0;
  }
}
