/* Bewerberportal – gekapseltes Stylesheet.
   Alles hängt an .bew (Inhalt) bzw. .bew-seite/.bew-kopf/.bew-fuss (eigenes Gerüst ohne Website-Vorlage).
   Schrift und Grundfarben erbt der Inhalt von der Website, wenn deren Kopf und Fuß verwendet werden. */

.bew,
.bew-seite {
  --bew-akzent: #0f4c81;
  --bew-akzent-dunkel: color-mix(in srgb, var(--bew-akzent) 82%, #000);
  --bew-akzent-hell: color-mix(in srgb, var(--bew-akzent) 9%, #fff);
  --bew-text: #1c2430;
  --bew-leise: #5b6675;
  --bew-linie: #d9dee5;
  --bew-flaeche: #f5f7fa;
  --bew-fehler: #b3261e;
  --bew-fehler-hell: #fdecea;
  --bew-ok: #1b6e3c;
  --bew-ok-hell: #e8f5ec;
  --bew-warn-hell: #fff6e0;
  --bew-radius: 10px;
}

/* ---------- eigenes Gerüst (nur ohne Vorlagendatei) ---------- */
body.bew-seite {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--bew-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}
body.bew-seite > .bew { flex: 1 0 auto; }
.bew-kopf { background: var(--bew-akzent); color: #fff; }
.bew-kopf__innen,
.bew-fuss__innen {
  box-sizing: border-box;
  max-width: 880px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  align-items: center;
  justify-content: space-between;
}
.bew-kopf a { color: #fff; text-decoration: none; }
.bew-kopf__marke { font-weight: 700; font-size: 1.15em; letter-spacing: .01em; }
.bew-kopf__link { font-size: .92em; opacity: .9; }
.bew-kopf__link:hover, .bew-kopf__link:focus-visible { opacity: 1; text-decoration: underline; }
.bew-fuss { background: var(--bew-flaeche); border-top: 1px solid var(--bew-linie); color: var(--bew-leise); font-size: .88em; }
.bew-fuss__innen { justify-content: flex-start; overflow-wrap: anywhere; }

/* ---------- Inhalt ---------- */
.bew {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 28px 20px 56px;
  color: var(--bew-text);
  line-height: 1.55;
  text-align: left;
}
.bew *, .bew *::before, .bew *::after { box-sizing: border-box; }
.bew .bew-breite { max-width: 840px; margin: 0 auto; }
.bew .bew-breite--schmal { max-width: 660px; }

.bew .bew-ueber {
  margin: 0 0 4px;
  color: var(--bew-akzent);
  font-size: .82em;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.bew .bew-h1 {
  margin: 0 0 12px;
  font-size: clamp(1.55rem, 1.2rem + 1.6vw, 2.15rem);
  line-height: 1.2;
  font-weight: 700;
  color: var(--bew-text);
  overflow-wrap: anywhere;
  hyphens: auto;
}
.bew .bew-h2 { margin: 30px 0 8px; font-size: 1.2rem; line-height: 1.3; font-weight: 700; color: var(--bew-text); }
.bew .bew-h2--kasten { margin-top: 0; }
.bew p { margin: 0 0 12px; }
.bew a { color: var(--bew-akzent); }
.bew .bew-einleitung { margin-bottom: 24px; color: var(--bew-text); max-width: 62ch; }
.bew .bew-zurueck { margin: 0 0 18px; font-size: .92em; }
.bew .bew-zurueck a { text-decoration: none; }
.bew .bew-zurueck a:hover, .bew .bew-zurueck a:focus-visible { text-decoration: underline; }
.bew .bew-versteckt {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0;
}

.bew .bew-text p { margin: 0 0 12px; }
.bew .bew-text ul { margin: 0 0 14px; padding-left: 1.25em; list-style: disc; }
.bew .bew-text li { margin: 0 0 5px; }
.bew .bew-text--klein { font-size: .9em; color: var(--bew-leise); padding-top: 10px; }

.bew .bew-marke {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bew-akzent-hell);
  color: var(--bew-akzent-dunkel);
  font-size: .82em;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.bew .bew-angaben { margin: 0 0 20px; }

/* ---------- Stellenliste ---------- */
.bew .bew-stellen { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 12px; }
.bew .bew-stellen li { margin: 0; padding: 0; }
.bew .bew-karte {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 14px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--bew-linie);
  border-radius: var(--bew-radius);
  background: #fff;
  color: var(--bew-text);
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
.bew .bew-karte:hover, .bew .bew-karte:focus-visible {
  border-color: var(--bew-akzent);
  box-shadow: 0 2px 10px rgba(15, 40, 70, .1);
}
.bew .bew-karte__titel { grid-column: 1; font-size: 1.1rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.bew .bew-karte__angaben { grid-column: 1; margin-bottom: -6px; }
.bew .bew-karte__pfeil { grid-column: 2; grid-row: 1 / span 2; font-size: 1.7rem; line-height: 1; color: var(--bew-akzent); }
.bew .bew-leer {
  padding: 18px;
  border: 1px dashed var(--bew-linie);
  border-radius: var(--bew-radius);
  color: var(--bew-leise);
  background: var(--bew-flaeche);
}
.bew .bew-initiativ {
  margin-top: 28px;
  padding: 20px;
  border-radius: var(--bew-radius);
  background: var(--bew-flaeche);
}
.bew .bew-initiativ .bew-h2 { margin-top: 0; }

/* ---------- Kästen, Meldungen ---------- */
.bew .bew-kasten {
  margin: 28px 0 0;
  padding: 22px;
  border: 1px solid var(--bew-linie);
  border-radius: var(--bew-radius);
  background: #fff;
}
.bew .bew-meldung {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 8px;
  border-left: 4px solid var(--bew-leise);
  background: var(--bew-flaeche);
}
.bew .bew-meldung--fehler { border-left-color: var(--bew-fehler); background: var(--bew-fehler-hell); color: #6d1611; }
.bew .bew-meldung--ok { border-left-color: var(--bew-ok); background: var(--bew-ok-hell); color: #124a28; }
.bew .bew-meldung--warn { border-left-color: #b7791f; background: var(--bew-warn-hell); color: #5c3d0b; }
.bew .bew-pdf { font-weight: 600; }

/* ---------- Formular ---------- */
.bew .bew-form { margin: 0; }
.bew .bew-zeile { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.bew .bew-feld { margin: 0 0 16px; min-width: 0; }
.bew .bew-feld > label { display: block; margin: 0 0 5px; font-weight: 600; font-size: .95em; color: var(--bew-text); }
.bew .bew-frei { font-weight: 400; color: var(--bew-leise); }
.bew .bew-pflicht { color: var(--bew-fehler); }
.bew .bew-form input[type="text"],
.bew .bew-form input[type="email"],
.bew .bew-form input[type="tel"],
.bew .bew-form textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #aab3bf;
  border-radius: 8px;
  background: #fff;
  color: var(--bew-text);
  font: inherit;
  font-size: 16px; /* verhindert das Hineinzoomen auf dem iPhone */
  line-height: 1.4;
  box-shadow: none;
  appearance: none;
}
.bew .bew-form textarea { resize: vertical; }
.bew .bew-form input[type="file"] {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 12px;
  border: 1px dashed #aab3bf;
  border-radius: 8px;
  background: var(--bew-flaeche);
  color: var(--bew-text);
  font: inherit;
  font-size: 15px;
}
.bew .bew-form input:focus-visible,
.bew .bew-form textarea:focus-visible,
.bew .bew-knopf:focus-visible,
.bew a:focus-visible,
.bew summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--bew-akzent) 45%, #fff);
  outline-offset: 2px;
}
.bew .bew-feld--fehler input[type="text"],
.bew .bew-feld--fehler input[type="email"],
.bew .bew-feld--fehler input[type="tel"],
.bew .bew-feld--fehler input[type="file"],
.bew .bew-feld--fehler textarea { border-color: var(--bew-fehler); background: #fffafa; }
.bew .bew-fehler { margin: 5px 0 0; color: var(--bew-fehler); font-size: .9em; font-weight: 600; }
.bew .bew-hilfe { margin: 6px 0 0; color: var(--bew-leise); font-size: .88em; }
.bew .bew-koeder { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.bew .bew-haken { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.bew .bew-haken input { flex: 0 0 auto; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--bew-akzent); }

.bew .bew-knopf {
  display: inline-block;
  min-height: 46px;
  margin: 4px 0 0;
  padding: 11px 22px;
  border: 1px solid var(--bew-akzent);
  border-radius: 8px;
  background: var(--bew-akzent);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
}
.bew .bew-knopf:hover { background: var(--bew-akzent-dunkel); border-color: var(--bew-akzent-dunkel); color: #fff; }
.bew .bew-knopf--zweit { background: #fff; color: var(--bew-akzent); }
.bew .bew-knopf--zweit:hover { background: var(--bew-akzent-hell); color: var(--bew-akzent-dunkel); }
.bew .bew-knopf--gefahr { background: var(--bew-fehler); border-color: var(--bew-fehler); }
.bew .bew-knopf--gefahr:hover { background: #8f1e18; border-color: #8f1e18; }
.bew .bew-knopfzeile { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }

.bew .bew-klapp { margin: 0 0 16px; border: 1px solid var(--bew-linie); border-radius: 8px; padding: 0 14px; background: #fff; }
.bew .bew-klapp > summary { padding: 12px 0; font-weight: 600; cursor: pointer; color: var(--bew-akzent); }
.bew .bew-klapp[open] { padding-bottom: 14px; }
.bew .bew-klapp--kasten { margin: 16px 0 0; border-radius: var(--bew-radius); padding: 0 22px; }
.bew .bew-klapp--kasten[open] { padding-bottom: 22px; }
.bew .bew-klapp--kasten > summary { padding: 16px 0; }

/* ---------- Bestätigung ---------- */
.bew .bew-erfolg { text-align: center; padding: 8px 0 0; }
.bew .bew-erfolg__zeichen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 0 14px;
  border-radius: 50%;
  background: var(--bew-ok-hell);
  color: var(--bew-ok);
  font-size: 30px;
  font-weight: 700;
}
.bew .bew-merken__zeile { display: flex; gap: 20px; align-items: flex-start; margin-top: 14px; }
.bew .bew-qr { flex: 0 0 150px; width: 150px; padding: 8px; border: 1px solid var(--bew-linie); border-radius: 8px; background: #fff; line-height: 0; }
.bew .bew-qr svg { display: block; width: 100%; height: auto; }
.bew .bew-merken__link { min-width: 0; flex: 1 1 auto; }
.bew .bew-link-lang { display: block; font-size: .92em; font-weight: 600; overflow-wrap: anywhere; word-break: break-all; }
.bew .bew-merken__link .bew-knopf { margin-top: 14px; }

/* ---------- Statusseite ---------- */
.bew .bew-stelle { margin: 0 0 24px; color: var(--bew-leise); font-size: 1.05em; }
.bew .bew-stelle strong { color: var(--bew-text); }

.bew .bew-stufen {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  counter-reset: none;
}
.bew .bew-stufe {
  position: relative;
  margin: 0;
  padding: 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  color: var(--bew-leise);
  font-size: .92em;
  line-height: 1.25;
}
.bew .bew-stufe::before {
  /* Verbindungslinie zur vorherigen Stufe */
  content: "";
  position: absolute;
  top: 17px;
  left: -50%;
  width: 100%;
  height: 3px;
  background: var(--bew-linie);
}
.bew .bew-stufe:first-child::before { display: none; }
.bew .bew-stufe--erledigt::before,
.bew .bew-stufe--aktuell::before { background: var(--bew-akzent); }
.bew .bew-stufe__punkt {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 3px solid var(--bew-linie);
  border-radius: 50%;
  background: #fff;
  color: var(--bew-leise);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
}
.bew .bew-stufe--erledigt .bew-stufe__punkt { border-color: var(--bew-akzent); background: var(--bew-akzent); color: #fff; }
.bew .bew-stufe--aktuell .bew-stufe__punkt {
  border-color: var(--bew-akzent);
  background: var(--bew-akzent);
  color: #fff;
  transform: scale(1.15);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--bew-akzent) 55%, transparent);
  animation: bew-puls 1.8s ease-out infinite;
}
/* Die aktuelle Stufe pulsiert, damit man sofort sieht, wo die Bewerbung steht */
@keyframes bew-puls {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bew-akzent) 55%, transparent); }
  70%  { box-shadow: 0 0 0 14px color-mix(in srgb, var(--bew-akzent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bew-akzent) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .bew .bew-stufe--aktuell .bew-stufe__punkt { animation: none; box-shadow: 0 0 0 5px var(--bew-akzent-hell); }
}
.bew .bew-stufe--erledigt { color: var(--bew-text); }
.bew .bew-stufe--aktuell { color: var(--bew-akzent); font-weight: 700; }
.bew .bew-standtext { margin: 0 0 6px; font-size: 1.05em; }
.bew .bew-standdatum { margin: 0 0 8px; color: var(--bew-leise); font-size: .88em; }

.bew .bew-zustand {
  margin: 0 0 12px;
  padding: 18px 20px;
  border-radius: var(--bew-radius);
  border: 1px solid var(--bew-linie);
  border-left: 5px solid var(--bew-leise);
  background: var(--bew-flaeche);
}
.bew .bew-zustand p:last-child { margin-bottom: 0; }
.bew .bew-zustand__titel { margin: 0 0 6px; font-size: 1.15rem; font-weight: 700; }

.bew .bew-termin__zeit { margin: 0 0 2px; font-size: 1.15rem; font-weight: 700; }
.bew .bew-termin__art { margin: 0 0 10px; color: var(--bew-leise); }
.bew .bew-auswahl { margin: 0 0 16px; padding: 0; border: 0; min-width: 0; display: grid; gap: 10px; }
.bew .bew-wahl {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid var(--bew-linie);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 400;
}
.bew .bew-wahl:hover { border-color: var(--bew-akzent); }
.bew .bew-wahl:has(input:checked) { border-color: var(--bew-akzent); background: var(--bew-akzent-hell); }
.bew .bew-wahl input { flex: 0 0 auto; width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--bew-akzent); }
.bew .bew-wahl__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bew .bew-wahl__text span { color: var(--bew-leise); font-size: .92em; overflow-wrap: anywhere; }

.bew .bew-kontakt { margin: 22px 0 0; color: var(--bew-leise); font-size: .92em; overflow-wrap: anywhere; }
.bew .bew-rueckzug { margin: 14px 0 0; font-size: .92em; }
.bew .bew-rueckzug a { color: var(--bew-leise); }
.bew .bew-rueckzug a:hover, .bew .bew-rueckzug a:focus-visible { color: var(--bew-fehler); }
.bew .bew-rueckfrage { border-color: var(--bew-fehler); margin-top: 0; }
.bew .bew-nichtda { margin-top: 12px; text-align: center; }
.bew .bew-nichtda .bew-knopf { margin-top: 8px; }

/* ---------- Handy ---------- */
@media (max-width: 600px) {
  .bew { padding: 20px 16px 44px; }
  .bew .bew-zeile { grid-template-columns: 1fr; }
  .bew .bew-kasten { padding: 16px; }
  .bew .bew-klapp--kasten { padding: 0 16px; }
  .bew .bew-klapp--kasten[open] { padding-bottom: 16px; }
  .bew .bew-form > .bew-knopf,
  .bew .bew-knopfzeile .bew-knopf,
  .bew .bew-merken__link .bew-knopf,
  .bew .bew-initiativ .bew-knopf,
  .bew .bew-nichtda .bew-knopf { display: block; width: 100%; }
  .bew .bew-knopfzeile { flex-direction: column; }
  .bew .bew-merken__zeile { flex-direction: column; align-items: center; }
  .bew .bew-merken__link { width: 100%; }
  .bew .bew-qr { flex-basis: auto; width: 180px; }

  /* Stufenleiste senkrecht: Namen passen sonst nicht nebeneinander */
  .bew .bew-stufen { grid-template-columns: 1fr; gap: 0; }
  .bew .bew-stufe { flex-direction: row; align-items: center; gap: 14px; padding: 0 0 18px; text-align: left; font-size: 1em; }
  .bew .bew-stufe:last-child { padding-bottom: 0; }
  .bew .bew-stufe::before { top: -18px; left: 16px; width: 3px; height: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .bew .bew-karte { transition: none; }
}
