/* Gäste-Formular im Typeform-Stil: eine Frage pro Bildschirm. */

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ---------- Fortschrittsbalken ---------- */
.fortschritt {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 10;
  background: rgba(139, 108, 64, 0.12);
  opacity: 0;
  transition: opacity 300ms ease;
}
.fortschritt--sichtbar {
  opacity: 1;
}
.fortschritt__balken {
  height: 100%;
  width: 0;
  background: var(--akzent);
  transition: width 500ms var(--kurve);
}

/* ---------- Bühne & Folien ---------- */
.buehne {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.folie {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 12px 24px;
  opacity: 0;
  transform: translateY(48px);
  transition: opacity var(--dauer) var(--kurve), transform var(--dauer) var(--kurve);
}
/* margin:auto zentriert vertikal und erlaubt trotzdem Scrollen, wenn der Inhalt höher ist. */
.folie__inhalt {
  margin: auto;
  width: 100%;
  max-width: 560px;
  text-align: center;
}
.folie--aktiv {
  opacity: 1;
  transform: none;
}
.folie--raus-hoch {
  opacity: 0;
  transform: translateY(-48px);
  pointer-events: none;
}
.folie--rein-von-oben {
  transform: translateY(-48px);
}

@media (prefers-reduced-motion: reduce) {
  .folie,
  .folie--raus-hoch,
  .folie--rein-von-oben {
    transform: none;
    transition: opacity 200ms linear;
  }
}

.folie__titel {
  margin: 0;
  color: var(--ueberschrift);
  font-size: var(--groesse-frage);
  font-weight: 500;
  line-height: 1.22;
  text-wrap: balance;
}
.folie--willkommen .folie__titel {
  font-size: var(--groesse-willkommen);
}
.folie__pflicht {
  margin-left: 1px;
}
.folie__unterzeile {
  margin: 18px 0 0;
  font-size: var(--groesse-text);
}
.folie__beschreibung {
  margin: 8px 0 0;
  font-size: var(--groesse-text);
  white-space: pre-line;
  text-wrap: pretty;
}
.folie__text {
  margin: 18px 0 0;
  font-size: var(--groesse-text);
  white-space: pre-line;
  text-wrap: pretty;
}
.folie__signatur {
  margin: 22px 0 0;
  font-size: var(--groesse-text);
}
.folie--ende .folie__titel {
  font-size: var(--groesse-willkommen);
}

/* Nummern-Badge über der Frage */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  margin-bottom: 12px;
  border-radius: 4px;
  background: var(--akzent);
  color: var(--button-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

/* ---------- Willkommen ---------- */
.willkommen__aktion {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.willkommen__dauer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 17px;
}
.willkommen__dauer svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ---------- Textfelder ---------- */
.feld {
  margin-top: 30px;
  text-align: left;
}
.feld__eingabe {
  display: block;
  width: 100%;
  padding: 4px 0 8px;
  border: 0;
  border-bottom: 1px solid var(--akzent-hell);
  border-radius: 0;
  background: transparent;
  color: var(--ueberschrift);
  font-family: var(--schrift);
  font-size: var(--groesse-eingabe);
  font-weight: 500;
  line-height: 1.35;
  outline: none;
  resize: none;
  overflow: hidden;
  transition: border-color 160ms ease;
  -webkit-appearance: none;
  appearance: none;
}
.feld__eingabe::placeholder {
  color: rgba(139, 108, 64, 0.42);
  opacity: 1;
}
.feld__eingabe:focus {
  border-bottom: 2px solid var(--akzent);
  padding-bottom: 7px;
}
.feld__hinweis {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--akzent);
}
.feld__hinweis kbd {
  font-family: inherit;
  font-weight: 600;
}

/* ---------- Auswahl-Pills ---------- */
.auswahl {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 26px;
  max-width: 100%;
}
.auswahl__hinweis {
  margin: 22px 0 -16px;
  font-size: 17px;
}
.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 5px 20px 6px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--pill);
  color: var(--pill-text);
  font-family: var(--schrift);
  font-size: var(--groesse-option);
  font-weight: 500;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
  touch-action: manipulation;
}
@media (hover: hover) {
  .option:hover {
    background: var(--pill-hover);
  }
}
.option__buchstabe {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--akzent-hell);
  border-radius: 50%;
  background: rgba(244, 240, 230, 0.7);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  transition: background-color 150ms ease, color 150ms ease;
}
.option__haken {
  position: absolute;
  right: 16px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--akzent);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity 150ms ease;
}
/* Mehrfachauswahl: Platz für den Haken rechts. Einfachauswahl zeigt keinen Haken (springt sofort weiter). */
.option[role='checkbox'] {
  padding-right: 42px;
}
.option[role='radio'] .option__haken {
  display: none;
}
.option[aria-checked='true'] {
  border-color: var(--akzent);
  background: var(--pill-hover);
}
.option[aria-checked='true'] .option__buchstabe {
  background: var(--akzent);
  border-color: var(--akzent);
  color: var(--button-text);
}
.option[aria-checked='true'] .option__haken {
  opacity: 1;
}
/* Typeform lässt die gewählte Option kurz aufblinken, bevor es weitergeht. */
.option--blinken {
  animation: blinken 360ms steps(1, end);
}
@keyframes blinken {
  0%,
  50% {
    background: var(--pill);
  }
  25%,
  75% {
    background: var(--pill-hover);
  }
}

/* ---------- Weiter-Button & Fehler ---------- */
.aktionen {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.aktionen__taste {
  font-size: 14px;
}
.aktionen__taste kbd {
  font-family: inherit;
  font-weight: 600;
}
@media (pointer: coarse) {
  .nur-tastatur {
    display: none !important;
  }
}

.fehlermeldung {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 6px 12px 7px;
  border-radius: 6px;
  background: var(--fehler-hintergrund);
  color: var(--fehler);
  font-size: 17px;
  line-height: 1.25;
  text-align: left;
  animation: schuetteln 320ms ease;
}
.fehlermeldung svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
@keyframes schuetteln {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

/* ---------- Senden ---------- */
.lader {
  width: 34px;
  height: 34px;
  margin: 0 auto 18px;
  border: 2px solid var(--akzent-hell);
  border-top-color: var(--akzent);
  border-radius: 50%;
  animation: drehen 900ms linear infinite;
}
@keyframes drehen {
  to {
    transform: rotate(360deg);
  }
}
.textlink {
  margin-top: 16px;
  padding: 6px;
  border: 0;
  background: none;
  color: var(--akzent);
  font-family: var(--schrift);
  font-size: 18px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- Fußzeile & Pfeile ---------- */
.fusszeile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 4px 16px max(6px, env(safe-area-inset-bottom));
}
.fusszeile__link {
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  opacity: 0.8;
}
.fusszeile__link:hover {
  text-decoration: underline;
}
.pfeile {
  display: flex;
  gap: 2px;
}
.pfeile[hidden] {
  display: none;
}
.pfeile__knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  border: 0;
  background: var(--akzent);
  color: var(--button-text);
  cursor: pointer;
  touch-action: manipulation;
}
.pfeile__knopf:first-child {
  border-radius: 6px 0 0 6px;
}
.pfeile__knopf:last-child {
  border-radius: 0 6px 6px 0;
}
.pfeile__knopf:disabled {
  opacity: 0.35;
  cursor: default;
}
.pfeile__knopf svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Honeypot: aus dem sichtbaren Bereich schieben (nicht display:none – manche Bots prüfen das). */
.honigtopf {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Niedrige Displays (Handy quer, kleine Handys): Ornamente kompakter */
@media (max-height: 700px) {
  .rahmen--oben {
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .rahmen--oben .rahmen__ornament {
    margin-top: 4px;
  }
  .rahmen--unten .rahmen__ornament {
    margin-bottom: 4px;
  }
  .badge {
    margin-bottom: 8px;
  }
  .rahmen__ornament {
    width: clamp(220px, 64vw, 280px);
  }
  .feld,
  .auswahl,
  .aktionen {
    margin-top: 20px;
  }
  .auswahl__hinweis {
    margin-top: 16px;
  }
  .option {
    min-height: 42px;
  }
  .knopf {
    min-height: 46px;
  }
}
