/* =====================================================================
   Formulare — Fragebögen und Danke-Seiten
   =====================================================================
   Mobil zuerst: Die Beschäftigtenbefragung wird fast nur auf dem Handy
   ausgefüllt. Antwortflächen sind mindestens 48 px hoch. Nur Tokens aus
   flincity.css; Fehler in Coral-Soft mit dunkler Schrift (Coral selbst
   hat als Schriftfarbe zu wenig Kontrast).

   Ruhiges Bild: Eingabefelder haben einen feinen Rand in --rand-feld
   (3,4:1 auf Weiss, das Mindestmass fuer Bedienelemente). Antwortkacheln
   kommen ohne Rand aus, weil der Auswahlpunkt darin das Bedienelement
   kenntlich macht; sie sind nur zart hinterlegt.
   ===================================================================== */
:root { --rand-feld: #8A8A86; }

.formularseite { padding-top: clamp(18px, 4vw, 44px); padding-bottom: 24px; min-height: 60vh; }

/* --- Zwei Fragebögen, zwei Farbwelten ---
   Unternehmen: Dunkelblau (wie der Bereich „Unternehmen“). Beschäftigte: Grün.
   Die Klasse stellt nur die beiden Akzent-Tokens um; alles darunter folgt. */
.formularseite--beschaeftigte { --navy: var(--gruen-dunkel); --navy-soft: var(--green-soft); }
.kennzeichen {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px;
  font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--navy);
  background: var(--navy-soft); padding: 5px 12px 5px 10px; border-radius: var(--r-pill);
}
.kennzeichen::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--navy); }
.formularseite--unternehmen .gradbox {
  background:
    radial-gradient(ellipse 80% 55% at 12% 0%,    rgba(73,84,212,.20), transparent 60%),
    radial-gradient(ellipse 85% 60% at 100% 100%, rgba(15,44,92,.14), transparent 60%),
    linear-gradient(160deg, #FEFEFE, #F3F5FA);
}
.formularseite--beschaeftigte .gradbox {
  background:
    radial-gradient(ellipse 80% 55% at 12% 0%,    rgba(196,245,66,.34), transparent 60%),
    radial-gradient(ellipse 85% 60% at 100% 100%, rgba(62,165,113,.24), transparent 60%),
    linear-gradient(160deg, #FEFEFE, #F3F8F1);
}

/* --- Einstieg und Abschlusskarten --- */
.einstieg__box, .danke__box { padding: clamp(28px, 5vw, 60px) clamp(20px, 5vw, 56px); }
.einstieg__box h1, .danke__box h1 { font-size: clamp(30px, 4.6vw, 48px); }
.einstieg__box h1:focus { outline: none; }
.einstieg__text { margin-top: 18px; color: var(--ink); font-size: clamp(16px, 1.5vw, 18px); max-width: 62ch; }
.einstieg__box .bullets li { color: var(--ink); font-size: 16px; }
.einstieg__start { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; }
.einstieg__tabelle { margin-top: clamp(28px, 4vw, 44px); }
.einstieg__tabelle h2 { font-size: clamp(20px, 2.4vw, 26px); }
.einstieg__fuss { margin-top: 14px; font-size: 14.5px; color: var(--text2); }
.tabelle { margin-top: 16px; overflow-x: auto; border: 1px solid var(--divider); border-radius: var(--r-lg); }
.tabelle table { width: 100%; border-collapse: collapse; font-size: 15px; }
.tabelle th, .tabelle td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--divider); vertical-align: top; font-weight: 400; }
.tabelle thead th { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text2); background: var(--surface-soft); }
.tabelle tbody th { font-weight: 600; }
.tabelle tr:last-child > * { border-bottom: 0; }

/* --- Fortschritt --- */
.fortschritt { margin-bottom: clamp(20px, 3vw, 32px); }
.fortschritt__balken { height: 8px; border-radius: var(--r-pill); background: var(--navy-soft); overflow: hidden; }
.fortschritt__balken i { display: block; height: 100%; border-radius: var(--r-pill); background: var(--navy); transition: width .4s var(--ease); }
.fortschritt__text { margin-top: 8px; font-size: 14px; color: var(--text2); }
@media (prefers-reduced-motion: reduce) { .fortschritt__balken i { transition: none; } }

/* --- Seite --- */
.formular__titel { font-size: clamp(26px, 3.4vw, 34px); }
.formular__titel:focus { outline: none; }
.formular__frage { margin-top: 12px; font-size: 16.5px; color: var(--ink); max-width: 62ch; }
.felder { margin-top: clamp(20px, 3vw, 30px); display: grid; grid-template-columns: 1fr 1fr; gap: 26px 18px; }
.felder > * { grid-column: 1 / -1; min-width: 0; }
@media (min-width: 620px) { .felder > .feld--halb { grid-column: auto; } }

.formular__knoepfe { margin-top: clamp(28px, 4vw, 40px); display: flex; gap: 12px; }
.formular__weiter { flex: 1 1 auto; max-width: 320px; margin-left: auto; }
.formular__neben { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.formular__neben .textlink, .anzeige__aktion { background: none; border: 0; padding: 8px 0; font: inherit; font-size: 15px; cursor: pointer; }
.formular__meldung { margin-top: 18px; }
.formular__meldung:not(:empty) { background: var(--yellow-soft); color: var(--ink); border-radius: var(--r-card); padding: 12px 16px; font-size: 15px; }

/* --- Feld --- */
.feld { border: 0; margin: 0; padding: 0; min-width: 0; }
.feld__label { display: block; padding: 0; font-family: var(--font-body); font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.4; margin-bottom: 8px; max-width: 62ch; }
.feld__label--klein { font-size: 14px; margin-bottom: 6px; color: var(--text2); }
.feld__frage { margin: 0; }
.feld__pflicht { display: inline-block; font-size: 12.5px; font-weight: 400; color: var(--text2); margin-left: 2px; white-space: nowrap; }
.feld__pflicht--unten { margin-top: 8px; }
.feld__hinweis, .feld__namen, .feld__zaehler, .feld__unterzeile { font-size: 14px; color: var(--text2); line-height: 1.45; }
.feld__hinweis { margin: -4px 0 10px; }
.feld__namen, .feld__zaehler { margin-top: 6px; }
.feld__unterzeile { font-family: var(--font-head); font-size: 18px; color: var(--navy); margin-bottom: 8px; }
.feld__zusaetze { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.feld__neben { margin-top: 14px; }
.feld__fehler:empty { display: none; }
.feld__fehler {
  margin-top: 10px; padding: 10px 14px; font-size: 15px; color: var(--ink);
  background: var(--coral-soft); border-left: 4px solid var(--coral); border-radius: 0 var(--r-card) var(--r-card) 0;
}
.hinweis { background: var(--navy-soft); color: var(--navy); border-radius: var(--r-card); padding: 12px 16px; font-size: 15px; line-height: 1.5; }
.anzeige { background: var(--surface-card); border-radius: var(--r-card); padding: 14px 18px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }

/* --- Eingaben --- */
.eingabe {
  display: block; width: 100%; min-height: 48px;
  font: inherit; font-size: 16.5px; color: var(--ink);
  padding: 10px 14px; background: #fff;
  border: 1px solid var(--rand-feld); border-radius: 12px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.eingabe:hover:not(:disabled) { border-color: var(--text2); }
.eingabe:focus-visible { outline: 2px solid var(--navy); outline-offset: 0; border-color: var(--navy); box-shadow: 0 0 0 5px var(--navy-soft); }
.eingabe:disabled { background: var(--surface-soft); border-color: var(--divider); color: var(--text2); }
.eingabe--zahl { max-width: 150px; font-variant-numeric: tabular-nums; }
.eingabe--plz { max-width: 130px; }
.eingabe--datum { max-width: 220px; }
.eingabe--mehrzeilig { resize: vertical; line-height: 1.5; }
select.eingabe { appearance: auto; }
.hat-fehler > .eingabe, .hat-fehler > .miteinheit > .eingabe { border-color: var(--coral); box-shadow: 0 0 0 1px var(--coral); }
.miteinheit { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.miteinheit__text { font-size: 15px; color: var(--text2); white-space: nowrap; }

/* --- Kacheln: grosse Antwortflaechen fuer Radio und Checkbox --- */
.kacheln { display: grid; gap: 8px; }
.kacheln--kompakt { display: flex; flex-wrap: wrap; }
.kachel {
  display: flex; align-items: center; gap: 12px; min-height: 52px; cursor: pointer;
  padding: 10px 16px; background: var(--surface-card); border: 1px solid transparent; border-radius: 12px;
  font-size: 16px; line-height: 1.35; transition: border-color .15s ease, background .15s ease;
}
.kachel--kompakt { min-height: 48px; padding: 8px 14px; font-size: 15.5px; }
.kachel:hover { background: var(--divider); }
.kachel input { flex: 0 0 auto; width: 20px; height: 20px; margin: 0; accent-color: var(--navy); }
.kachel:has(input:checked) { border-color: var(--navy); background: var(--navy-soft); }
/* Auf bereits hinterlegten Flaechen stehen die Kacheln weiss. */
.matrix__zeile .kachel, .zeitraster__zeile .kachel, .gruppe__eintrag .kachel { background: #fff; }
.matrix__zeile .kachel:hover, .zeitraster__zeile .kachel:hover, .gruppe__eintrag .kachel:hover { background: var(--surface-soft); }
.matrix__zeile .kachel:has(input:checked), .zeitraster__zeile .kachel:has(input:checked), .gruppe__eintrag .kachel:has(input:checked) { background: var(--navy-soft); }
.kachel:has(input:focus-visible) { outline: 2px solid var(--navy); outline-offset: 2px; }
.kachel:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.kachel input:focus-visible { outline: none; }
.kachel__zusatz { padding: 4px 0 8px 14px; border-left: 3px solid var(--navy-soft); margin-left: 12px; }
.kacheln--kompakt .kachel__zusatz { flex: 1 1 100%; }

.haken { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding: 10px 0; font-size: 16.5px; line-height: 1.45; min-height: 44px; }
.haken input { flex: 0 0 auto; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--navy); }
.haken--klein { font-size: 14.5px; color: var(--text2); padding: 6px 0; min-height: 36px; }
.haken--klein input { width: 18px; height: 18px; }
.haken--einwilligung { background: var(--surface-card); border-radius: var(--r-card); padding: 16px; }
.feld--checkbox .haken, .feld--einwilligung .haken { font-weight: 400; }

/* --- Matrix, Wochenraster: je Zeile bzw. Tag eine Gruppe --- */
.matrix, .raster { display: grid; gap: 14px; }
.matrix__zeile, .raster__tag, .zeitraster__zeile, .gruppe__eintrag { border: 0; margin: 0; padding: 0; min-width: 0; }
.matrix__zeile { padding: 14px 16px 16px; background: var(--surface-card); border-radius: var(--r-lg); }
.matrix__zeile legend { float: left; width: 100%; padding: 0; font-size: 16px; font-weight: 600; line-height: 1.4; margin-bottom: 10px; }
.matrix__zeile .kacheln { clear: both; }
.raster { gap: 10px; }
/* Ein Raster: links der Tag, daneben die Antworten in gleich breiten Spalten. Das fieldset selbst bleibt ein
   Block (Safari ordnet ein fieldset nicht verlässlich als Grid an); die Legende steht als Float daneben. */
.raster__tag { display: block; }
.raster__tag legend { float: left; width: 44px; padding: 0; font-family: var(--font-head); font-size: 19px; line-height: 58px; color: var(--navy); }
.raster__tag .kacheln { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-left: 54px; }
.raster__tag .kachel { min-height: 58px; padding-inline: 12px; gap: 10px; }
/* Auf schmalen Bildschirmen wird das Raster zur Liste je Tag. */
@media (max-width: 619px) {
  .raster__tag { display: block; padding: 12px 14px 14px; background: var(--surface-card); border-radius: var(--r-lg); }
  .raster__tag .kachel:not(:has(input:checked)) { background: #fff; }
  .raster__tag legend { width: 100%; line-height: 1.3; margin-bottom: 8px; }
  .raster__tag .kacheln { clear: both; margin-left: 0; grid-template-columns: 1fr 1fr; }
}

.tagzahlen { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.tagzahl label { display: block; font-family: var(--font-head); font-size: 18px; color: var(--navy); margin-bottom: 4px; }
.tagzahl .eingabe { max-width: 96px; }

/* --- Uhrzeit --- */
.zeit { display: inline-flex; align-items: center; gap: 6px; font-size: 17px; }
.zeit__teil { min-height: 48px; min-width: 68px; font: inherit; font-size: 16.5px; padding: 8px 10px; background: #fff; color: var(--ink); border: 1px solid var(--rand-feld); border-radius: 12px; font-variant-numeric: tabular-nums; }
.zeit__teil:disabled { background: var(--surface-soft); border-color: var(--divider); }
.zeit__uhr { color: var(--text2); font-size: 15px; margin-left: 2px; }

.zeitraster { display: grid; gap: 12px; }
.zeitraster__zeile { padding: 14px 16px 16px; background: var(--surface-card); border-radius: var(--r-lg); }
.zeitraster__zeile legend { float: left; width: 100%; padding: 0; font-family: var(--font-head); font-size: 19px; color: var(--navy); margin-bottom: 8px; }
.zeitraster__spalten { clear: both; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 18px; }

/* --- Verteilung --- */
.verteilung__schnell { margin-bottom: 16px; }
.verteilung { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 12px; }
.verteilung__zelle label { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.verteilung__zelle .eingabe { max-width: 78px; }
.verteilung__summe { margin-top: 14px; padding: 10px 14px; border-radius: var(--r-card); background: var(--surface-soft); font-size: 15.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.verteilung__summe.ist-gut { background: var(--green-soft); color: var(--navy); }
.verteilung__summe.ist-offen { background: var(--yellow-soft); }

.chip {
  font: 600 14.5px var(--font-body); min-height: 44px;
  padding: 9px 16px; border-radius: var(--r-pill);
  border: 1px solid transparent; background: var(--surface-card); color: var(--navy); cursor: pointer;
}
.chip:hover { background: var(--divider); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* --- Wiederholgruppe --- */
.gruppe { display: grid; gap: 16px; }
.gruppe__eintrag { padding: 18px; background: var(--surface-card); border-radius: var(--r-lg); }
.gruppe__eintrag > legend { float: left; width: 100%; padding: 0; font-family: var(--font-head); font-size: 21px; color: var(--navy); }
.gruppe__eintrag > .felder { clear: both; margin-top: 14px; padding-top: 4px; gap: 20px 18px; }
.gruppe__eintrag .feld__label { font-size: 16px; }
.gruppe__weg { margin-top: 12px; padding-left: 0; text-decoration: underline; text-underline-offset: 3px; }
.gruppe__leiste { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.gruppe__leiste:empty { display: none; }

/* --- Upload --- */
.upload__eingabe { font: inherit; font-size: 15.5px; max-width: 100%; padding: 14px; border: 1px dashed var(--rand-feld); border-radius: var(--r-card); width: 100%; }
.upload__liste { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.upload__liste li { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface-card); border-radius: var(--r-card); padding: 6px 6px 6px 14px; font-size: 15px; }

/* --- Danke-Seite der Bewerbung --- */
.danke { padding-top: 18px; }
.danke__aktionen { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.danke__vorspann { margin-top: clamp(40px, 6vw, 72px); }
.danke__vorspann .eyebrow { margin-bottom: 14px; }
.einladung { margin-top: 26px; display: grid; gap: 22px; padding: clamp(18px, 3vw, 30px); border: 1px solid var(--divider); border-radius: var(--r-xl); }
.einladung__kennung { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.einladung__kennung span { font-size: 14px; color: var(--text2); }
.einladung__kennung strong { font-family: var(--font-head); font-weight: 400; font-size: 30px; letter-spacing: .08em; color: var(--navy); }
.einladung__zeile { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.einladung__zeile .eingabe { flex: 1 1 260px; }
.einladung .feld .einladung__zeile:first-of-type { margin-top: 0; }
.danke__weiter { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
#einladung h2 { font-size: clamp(27px, 3.6vw, 40px); }

/* --- Hinweisleiste im Entwicklungsmodus (nur mit Mock-Speicher) --- */
.entwicklung { position: sticky; bottom: 0; z-index: 60; background: var(--yellow-soft); border-top: 1px solid var(--yellow); padding: 8px var(--gutter); font-size: 13.5px; }
.entwicklung .textlink { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.entwicklung__post { margin: 8px 0 0; padding: 0; list-style: none; max-height: 40vh; overflow: auto; display: grid; gap: 8px; }
.entwicklung__post pre { margin: 4px 0 0; white-space: pre-wrap; font: 13px/1.45 ui-monospace, Menlo, monospace; }
