/* F095 Etappe 2 — Vorabklärungs-Formular. Aussehen nach dem abgenommenen Entwurf (Konzept F095, Version 6);
 * Farben und Schrift nach scripts/styles.json. Nur helles Erscheinungsbild (wie der Auftritt der Firma). */
:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --fg: #444444;
  --muted: #7a746d;
  --line: #e6e1da;
  --accent: #FF7900;
  --accent-soft: #fff1e5;
  --ok: #27AE60;
  --warn: #F39C12;
  --bad: #C0392B;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: Aptos, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.wrap { max-width: 520px; margin: 0 auto; padding: 16px 16px 48px; }
@media (max-width: 559px) { .fm { padding: 14px; } .fsec { padding: 12px; } .fsec-head { margin: -12px -12px 0; padding: 10px 12px; } }

.fm {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px;
  display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 6px 24px rgba(68, 68, 68, .08); min-width: 0;
}
form { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.fm-head { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; border-bottom: 3px solid var(--accent); }
.fm-logo { display: block; width: 147px; height: 28px; margin: 0 0 14px; }
.fm-kicker { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.fm-title { font-size: 20px; font-weight: 700; }
.fm-sub { font-size: 13px; color: var(--muted); }

.msg { border-radius: 8px; padding: 14px; background: var(--accent-soft); border-left: 5px solid var(--warn); }
.msg.ok { background: #e8f6ee; border-left-color: var(--ok); }

.fq { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
.fl { font-size: 14px; font-weight: 600; line-height: 1.35; margin-bottom: 6px; }
.fl i { color: var(--accent); font-style: normal; }
.fl-s { font-size: 13px; }
.fh { font-size: 12.5px; color: var(--muted); }
.warnh { color: var(--bad); }

.fstelle { font-weight: 700; font-size: 15px; padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); overflow-wrap: anywhere; }
.fstelle .pid { white-space: nowrap; font-weight: 400; font-size: 12.5px; color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }

/* Abschnitte (Owner 2026-11-30): je ein Kasten mit Icon und Schritt; Fragen darin durch Linien getrennt */
.fsec {
  display: flex; flex-direction: column; gap: 14px; min-width: 0; margin: 0; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.fsec-head {
  display: flex; gap: 12px; align-items: center; min-width: 0; margin: -14px -14px 0; padding: 12px 14px;
  background: var(--bg); border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0;
}
.fsec-ic { flex: none; width: 40px; height: 40px; padding: 8px; border-radius: 10px; color: #fff; background: var(--accent); }
.fsec-tt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fsec-step { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); }
.fgroup { font-size: 17px; font-weight: 700; line-height: 1.25; margin: 0; color: var(--fg); }
.fsec > .fq + .fq { border-top: 1px solid var(--line); padding-top: 14px; }
.fl-ic { display: flex; gap: 8px; align-items: flex-start; }
.fq-ic { flex: none; width: 20px; height: 20px; color: var(--accent); margin-top: -1px; }
.fl-ic > span { min-width: 0; }
/* Fragetitel nicht in die Rahmenlinie setzen (Browser zeichnen <legend> sonst auf der Linie) */
.fq > legend { float: left; width: 100%; }

/* Antworten zum Antippen: Optionsfelder als Knöpfe */
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span {
  display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; color: var(--fg);
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px;
}
.seg input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.fcond { display: flex; flex-direction: column; gap: 6px; padding-left: 10px; border-left: 3px solid var(--accent-soft); margin-top: 6px; }

.fi {
  font: inherit; font-size: 16px; color: var(--fg); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 10px; width: 100%; min-width: 0; min-height: 42px;
}
.fi:focus-visible, .fsubmit:focus-visible, .fcheck input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 380px) { .frow { grid-template-columns: 1fr; } }

/* Stundensatz: ein Regler mit zwei Griffen */
.range { display: flex; flex-direction: column; gap: 6px; }
.range-out { font-size: 16px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.range-out small { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.range-track { position: relative; height: 32px; }
.range-track::before { content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 4px; border-radius: 2px; background: var(--line); }
.range-fill { position: absolute; top: 14px; height: 4px; border-radius: 2px; background: var(--accent); }
.range-track input {
  position: absolute; left: 0; top: 0; width: 100%; height: 32px; margin: 0; background: none;
  pointer-events: none; -webkit-appearance: none; appearance: none;
}
.range-track input::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent); cursor: pointer;
}
.range-track input::-moz-range-thumb {
  pointer-events: auto; width: 20px; height: 20px; border-radius: 50%; background: var(--surface);
  border: 3px solid var(--accent); cursor: pointer;
}
.range-track input::-moz-range-track { background: none; }
.range-track input:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.rate-hint { color: var(--fg); }
.range-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }

.fcheck { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; cursor: pointer; }
.fcheck input { margin-top: 3px; accent-color: var(--accent); width: 20px; height: 20px; flex: none; }
.fcheck label { cursor: pointer; }
.privacy { margin: -6px 0 0 30px; }
.fexcl { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.fexcl:has(input:checked) { border-color: var(--ok); background: #e8f6ee; }
.invalid .fexcl { border-color: var(--bad); }
.invalid .fexcl input { outline: 1px solid var(--bad); }
.privacy a { color: var(--accent); }

.invalid .seg span, .invalid .fi, .invalid.fcheck input { border-color: var(--bad); outline: 1px solid var(--bad); }
.invalid > .fl, .invalid > legend { color: var(--bad); }
.err { color: var(--bad); font-weight: 700; margin: 0; }

.fsubmit {
  font: inherit; font-size: 15px; font-weight: 700; color: #fff; background: var(--accent); border: 0;
  border-radius: 10px; padding: 12px; min-height: 48px; cursor: pointer; width: 100%;
}
.fsubmit:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.fnote { font-size: 12.5px; color: var(--muted); text-align: center; margin: -6px 0 0; }

.fm-top, .side-top, .side-actions { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.side-actions { gap: 10px; }
.side-actions .fnote { margin: 0; }
.frow-wide { grid-template-columns: 1fr; }

/* Schritt-Übersicht: nur am Notebook (links, mitlaufend) */
.side-steps { display: none; }
.fsec { scroll-margin-top: 16px; }

/* Notebook / Desktop (Owner 2026-12-01): eine Spalte über die ganze Breite. Oben Kopf und Stelle nebeneinander,
 * darunter die Schritt-Übersicht waagrecht und beim Scrollen oben stehend; dann die Fragen, am Ende „Absenden“.
 * Antworten in einer festen Spalte rechts der Frage, linksbündig (.fq-row: eine Kante statt Zickzack). */
@media (min-width: 860px) {
  body { font-size: 15.5px; }
  .wrap { max-width: 1240px; padding: 32px 32px 64px; }
  .fm { gap: 20px; padding: 14px 36px 32px; border-radius: 16px; }
  /* Ganzer Kopf steht beim Scrollen (Owner 2026-12-01); gescrollt kompakter (ohne Unterzeilen, app.js „stuck“) */
  .fm-top {
    position: sticky; top: 0; z-index: 5; margin: 0 -36px; padding: 14px 36px 12px;
    background: var(--surface); border-radius: 16px 16px 0 0;
  }
  .fm-top.stuck { border-radius: 0; box-shadow: 0 6px 16px rgba(68, 68, 68, .10); }
  .fm-top.stuck .fm-kicker, .fm-top.stuck .fm-sub, .fm-top.stuck #stelle-box .fh { display: none; }
  .fm-top.stuck .fm-logo { margin-bottom: 6px; }
  .fm-top.stuck .side-top { padding-bottom: 10px; }
  .side-top {
    /* Stelle nimmt den ganzen Rest rechts vom Kopf — Stellentitel sind oft lang (Owner 2026-12-01) */
    display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 56px; align-items: end;
    padding-bottom: 16px; border-bottom: 3px solid var(--accent);
  }
  .fm-head { padding-bottom: 0; border-bottom: 0; }
  .side-steps {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 6px; margin: 0 -8px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 4px 14px rgba(68, 68, 68, .08);
  }
  .side-steps[hidden] { display: none; }
  .side-steps a {
    display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: 8px; color: var(--fg); text-decoration: none; font-size: 14px;
    background: var(--bg);
  }
  .st-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Sprünge (Schritt-Klick, fehlende Angabe) nicht unter dem stehenden Kopf enden lassen */
  .fsec, .fq { scroll-margin-top: 220px; }
  .side-steps a:hover, .side-steps a:focus-visible { background: var(--accent-soft); outline: none; }
  .st-n {
    width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: var(--accent); border: 2px solid var(--accent);
  }
  .side-steps a.done .st-n { color: #fff; background: var(--ok); border-color: var(--ok); font-size: 0; }
  .side-steps a.done .st-n::after { content: "✓"; font-size: 14px; }
  .st-l { font-weight: 600; }
  .st-s { font-size: 12px; color: var(--muted); white-space: nowrap; }
  .side-steps a.done .st-s { color: var(--ok); }
  .side-actions { align-items: flex-end; padding-top: 4px; }
  .side-actions .fsubmit { width: auto; min-width: 260px; padding: 12px 36px; }
  .side-actions .err { align-self: stretch; text-align: right; }
  /* Frage | Antwort: Frage und Hinweise links (breit genug für eine Zeile), Antwort rechts in fester Spalte;
   * Zusatzfelder über die ganze Breite */
  .fq-row {
    display: grid; grid-template-columns: clamp(260px, 38%, 440px) minmax(0, 1fr); column-gap: 32px; row-gap: 4px;
    align-items: start;
  }
  .fq-row > .range { max-width: 640px; }
  .fq-row > * { grid-column: 1 / -1; }
  .fq-row > legend, .fq-row > .fl { grid-column: 1; grid-row: 1; margin-bottom: 0; }
  .fq-row > .seg, .fq-row > .range, .fq-row > .fexcl { grid-column: 2; grid-row: 1 / span 4; justify-content: flex-start; }
  .fq-row > .fh { grid-column: 1; }
  .fq-row > .range { margin-top: -4px; }
  .fm-title { font-size: 24px; line-height: 1.25; }
  .fm-sub { font-size: 14px; }
  form { gap: 20px; }
  .fsec { padding: 18px 20px; gap: 16px; }
  .fsec-head { margin: -18px -20px 0; padding: 14px 20px; }
  .fsec > .fq + .fq { padding-top: 16px; }
  .frow, .frow-wide { grid-template-columns: 1fr 1fr; gap: 16px; }
  .seg span { min-height: 40px; padding: 6px 13px; }
  .seg label:hover span { border-color: var(--accent); }
  .fsubmit:not(:disabled):hover { filter: brightness(.95); }
}

/* Grosse Bildschirme: Platz ausnutzen (Owner 2026-12-01) */
@media (min-width: 1200px) {
  .wrap { max-width: 1680px; padding-left: 40px; padding-right: 40px; }
  .fm { padding: 18px 48px 36px; }
  .fm-top { margin: 0 -48px; padding-left: 48px; padding-right: 48px; }
  /* Alle fünf Unterlagen nebeneinander, spart Höhe (Owner 2026-12-01) */
  .fm .fdocs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .fm .fdocs .fdoc-req { grid-column: auto; }
}

/* Datenschutzhinweis (datenschutz.html): Lesetext in einer Spalte */
.legal { max-width: 760px; }
.legal-card { display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 860px) { .legal .fm { display: flex; } }
.legal section { display: flex; flex-direction: column; gap: 6px; }
.legal h2 { font-size: 16px; margin: 0; }
.legal p, .legal li { max-width: 68ch; }
.legal p { margin: 0; }
.legal ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.legal a { color: var(--accent); }

/* Kriterien der Stelle zum Aufklappen (bei der Muss-Frage) */
.fcrit { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.fcrit summary {
  cursor: pointer; padding: 9px 12px; font-size: 13.5px; font-weight: 600; color: var(--accent); min-height: 40px;
  display: flex; align-items: center; list-style: none;
}
.fcrit summary::-webkit-details-marker { display: none; }
.fcrit summary::before { content: "▸"; margin-right: 8px; transition: transform .15s; }
.fcrit[open] summary::before { transform: rotate(90deg); }
.fcrit summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.fcrit-body { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 12px; font-size: 13.5px; }
.fcrit-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fcrit-h small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.fcrit ul { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }
@media (prefers-reduced-motion: reduce) { .fcrit summary::before { transition: none; } }
/* Rahmenbedingungen der Stelle (Zeitraum, Pensum, Arbeitsort) */
.fcond-list { margin: 0; }
.fcond-list > div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 8px; }
.fcond-list dt { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-top: 2px; }
.fcond-list dd { margin: 0; overflow-wrap: anywhere; }

/* Unterlagen: eine Kachel je Thema (Icon, Titel, Hinweis, Liste, „Datei wählen“; am Notebook auch Ziehen) */
.fl small { font-weight: 400; font-size: 12px; color: var(--muted); }
.docs-why {
  margin: 0; padding: 10px 12px; font-size: 13.5px; line-height: 1.5;
  background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 8px;
}
.docs-intro { margin: 0; }
.fl small.rec { color: var(--accent); font-weight: 600; }
.fdocs { display: grid; grid-template-columns: 1fr; gap: 10px; }
.fdoc {
  display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px;
  background: var(--bg); border: 1px dashed var(--line); border-radius: 12px; transition: border-color .15s, background .15s;
}
.fdoc-req { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.fdoc.has { border-style: solid; border-color: var(--ok); background: var(--surface); }
.fdoc.drag { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.fdoc-head { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.fdoc-ic {
  flex: none; width: 38px; height: 38px; padding: 7px; border-radius: 10px; color: var(--accent); background: var(--accent-soft);
}
.fdoc.has .fdoc-ic { color: var(--ok); background: #e8f6ee; }
.fdoc-tt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fdoc-tt .fl { margin: 0; }
.fdoc-act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.fdrop { display: none; font-size: 12.5px; color: var(--muted); }
@media (hover: hover) and (min-width: 860px) { .fdrop { display: inline; } }
@media (min-width: 560px) {
  .fdocs { grid-template-columns: 1fr 1fr; }
  .fdocs .fdoc-req { grid-column: 1 / -1; }
}
.flist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.flist li {
  display: flex; align-items: center; gap: 8px; font-size: 13.5px; background: var(--accent-soft);
  border-radius: 8px; padding: 4px 4px 4px 10px; min-width: 0;
}
.flist .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flist .fsize { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.flist button {
  font: inherit; font-size: 18px; line-height: 1; color: var(--muted); background: none; border: 0;
  width: 36px; height: 36px; border-radius: 6px; cursor: pointer; flex: none;
}
.flist button:hover, .flist button:focus-visible { color: var(--bad); outline: 2px solid var(--accent); outline-offset: -2px; }
.fbtn { position: relative; align-self: flex-start; cursor: pointer; }
.fbtn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fbtn span {
  display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--accent);
  background: var(--surface); border: 1px dashed var(--accent); border-radius: 999px; padding: 7px 16px;
}
.fbtn input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.fbtn:hover span { background: var(--accent-soft); }
.ferr { color: var(--bad); }
.invalid.fdoc { border-style: solid; border-color: var(--bad); }
.invalid.fdoc .fbtn span { border-color: var(--bad); color: var(--bad); }
.flist:empty { display: none; }
.flist li { background: var(--accent-soft); }
.fdoc.has .flist li { background: var(--bg); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
[hidden] { display: none !important; }
.msg a { color: var(--accent); font-weight: 600; }
select.fi { cursor: pointer; }
