/*
 * Look der Formulare. Alles ist über CSS-Variablen steuerbar – pro Kunde reicht es,
 * diese Variablen in style.css zu überschreiben, z. B.:
 *
 *   :root { --fm-akzent: #0a7d5a; --fm-radius: 2px; }
 *
 * Alle Klassen beginnen mit "fm-". Diese Datei bleibt normalerweise unverändert.
 *
 * WICHTIG: In den HTML-Seiten muss diese Datei VOR style.css geladen werden, sonst überschreiben ihre Standardwerte
 * die Kundenwerte aus style.css (siehe kontakt.html).
 */
:root {
  --fm-akzent: #1f5fd1;
  --fm-akzent-text: #fff;
  --fm-text: inherit;
  --fm-grau: #5f6b7a;
  --fm-rand: #b8bec8;
  --fm-hintergrund: #fff;
  --fm-fehler: #b42318;
  --fm-erfolg: #1a7f4b;
  --fm-stern: #f5a524;
  --fm-radius: 8px;
  --fm-abstand: 1.15rem;
}

.fm [hidden], .fm-danke[hidden] { display: none !important; }
.fm { display: block; max-width: 40rem; color: var(--fm-text); scroll-margin-top: 6rem; }

.fm-titel { margin: 0 0 .4em; }
.fm-beschreibung { margin: 0 0 1.4em; color: var(--fm-grau); }

.fm-feld { margin: 0 0 var(--fm-abstand); }
.fm-label { display: block; font-weight: 600; margin: 0 0 .35rem; padding: 0; }
.fm-pflicht { color: var(--fm-fehler); }
.fm-hilfe { color: var(--fm-grau); font-size: .9rem; margin: -.15rem 0 .45rem; }
.fm-hinweis { margin: 0; padding: .8rem 1rem; background: color-mix(in srgb, var(--fm-akzent) 8%, transparent); border-left: 3px solid var(--fm-akzent); border-radius: 0 var(--fm-radius) var(--fm-radius) 0; }
.fm-abschnitt { margin: 1.6rem 0 .2rem; font-size: 1.15rem; }
.fm-feld.fm-typ-abschnitt { margin-bottom: .6rem; }

.fm input[type=text], .fm input[type=email], .fm input[type=tel], .fm input[type=date], .fm select, .fm textarea {
  display: block; width: 100%; box-sizing: border-box; padding: .7rem .85rem;
  font: inherit; font-size: 1rem; /* mind. 16px: verhindert Zoomen auf iPhones */
  color: inherit; background: var(--fm-hintergrund);
  border: 1px solid var(--fm-rand); border-radius: var(--fm-radius);
}
.fm textarea { resize: vertical; min-height: 7rem; }
.fm input:focus-visible, .fm select:focus-visible, .fm textarea:focus-visible,
.fm-knopf:focus-visible, .fm-option:focus-within, .fm-haken:focus-within {
  outline: 3px solid color-mix(in srgb, var(--fm-akzent) 45%, transparent); outline-offset: 2px;
}

.fm-gruppe { border: 0; margin: 0; padding: 0; min-width: 0; }
.fm-optionen { display: grid; gap: .45rem; }
.fm-option, .fm-haken { display: flex; align-items: flex-start; gap: .65rem; padding: .55rem .75rem; border: 1px solid var(--fm-rand); border-radius: var(--fm-radius); background: var(--fm-hintergrund); cursor: pointer; }
.fm-haken { border-color: transparent; padding: .2rem 0; background: none; }
.fm-option input, .fm-haken input { margin: .25rem 0 0; width: 1.1rem; height: 1.1rem; flex: none; accent-color: var(--fm-akzent); }
.fm-option:has(input:checked) { border-color: var(--fm-akzent); background: color-mix(in srgb, var(--fm-akzent) 8%, var(--fm-hintergrund)); }

/* Sterne-Bewertung (Eingaben stehen in umgekehrter Reihenfolge im HTML, dir=rtl dreht sie optisch zurück) */
.fm-sterne { display: inline-flex; font-size: 2.2rem; line-height: 1; }
.fm-sterne input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fm-sterne label { cursor: pointer; padding: 0 .1em; color: #cdd2d9; transition: color .12s; }
.fm-sterne input:checked ~ label, .fm-sterne label:hover, .fm-sterne label:hover ~ label { color: var(--fm-stern); }
.fm-sterne input:focus-visible + label { outline: 3px solid color-mix(in srgb, var(--fm-akzent) 45%, transparent); border-radius: 4px; }

/* Skala 0-10 */
.fm-skala { display: flex; flex-wrap: wrap; gap: .35rem; }
.fm-skala input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fm-skala label { min-width: 2.7rem; min-height: 2.7rem; display: grid; place-items: center; border: 1px solid var(--fm-rand); border-radius: var(--fm-radius); background: var(--fm-hintergrund); cursor: pointer; font-weight: 600; }
.fm-skala label:hover { border-color: var(--fm-akzent); }
.fm-skala input:checked + label { background: var(--fm-akzent); border-color: var(--fm-akzent); color: var(--fm-akzent-text); }
.fm-skala input:focus-visible + label { outline: 3px solid color-mix(in srgb, var(--fm-akzent) 45%, transparent); outline-offset: 2px; }
.fm-skala-texte { display: flex; justify-content: space-between; margin-top: .4rem; color: var(--fm-grau); font-size: .85rem; }

/* Fehler */
.fm-fehler { color: var(--fm-fehler); font-size: .9rem; margin-top: .35rem; }
.fm-fehler:empty { display: none; }
.fm-hat-fehler input:not([type=checkbox]):not([type=radio]), .fm-hat-fehler select, .fm-hat-fehler textarea { border-color: var(--fm-fehler); }
.fm-banner { padding: .8rem 1rem; margin: 0 0 1rem; border-radius: var(--fm-radius); background: color-mix(in srgb, var(--fm-fehler) 10%, #fff); color: var(--fm-fehler); border: 1px solid color-mix(in srgb, var(--fm-fehler) 35%, #fff); }
.fm-pflichthinweis { color: var(--fm-grau); font-size: .85rem; margin: 0 0 1rem; }

/* Knöpfe + Fortschritt */
.fm-knoepfe { display: flex; gap: .75rem; flex-wrap: wrap; }
.fm-knopf { appearance: none; border: 1px solid var(--fm-akzent); background: var(--fm-akzent); color: var(--fm-akzent-text); padding: .8rem 1.5rem; min-height: 2.9rem; border-radius: var(--fm-radius); font: inherit; font-weight: 650; cursor: pointer; }
.fm-knopf:hover:not(:disabled) { filter: brightness(1.08); }
.fm-knopf:disabled { opacity: .65; cursor: progress; }
.fm-knopf-hell { background: transparent; color: var(--fm-akzent); }
.fm-fortschritt { margin: 0 0 1.4rem; }
.fm-fortschritt-text { display: block; font-size: .9rem; color: var(--fm-grau); margin-bottom: .35rem; }
.fm-fortschritt progress { width: 100%; height: .45rem; appearance: none; border: 0; border-radius: 999px; overflow: hidden; background: #e3e6eb; }
.fm-fortschritt progress::-webkit-progress-bar { background: #e3e6eb; }
.fm-fortschritt progress::-webkit-progress-value { background: var(--fm-akzent); }
.fm-fortschritt progress::-moz-progress-bar { background: var(--fm-akzent); }
.fm-schritt:focus { outline: none; }

.fm-danke { max-width: 40rem; padding: 1.2rem 1.4rem; border-radius: var(--fm-radius); background: color-mix(in srgb, var(--fm-erfolg) 10%, #fff); border: 1px solid color-mix(in srgb, var(--fm-erfolg) 35%, #fff); }
.fm-danke p { margin: 0; }
.fm-danke:focus { outline: none; }

/* Honigtopf für Bots + nur für Screenreader sichtbar */
.fm-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.fm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .fm-sterne label { transition: none; }
}
