/* EHBS Formulare. Verwaltung nach Richtung A (ruhig, viel Weiß), Ausfüllen nach Richtung C (große Tasten). */
:root {
  --blau: #232e6a; --blau-d: #19214d; --rot: #ac1410; --grau: #706f6f; --anthrazit: #575756;
  --sek: #595959; --ok: #2E7D32; --mittel: #E3A615; --schlecht: #C0392B; --gelb: #f7a941; --tint: #FDF6E9;
  --linie: #d9dbe3; --hell: #f4f5f8; --flaeche: #ffffff; --text: #000000;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Arial, "Liberation Sans", Helvetica, sans-serif; color: var(--text); background: var(--flaeche); line-height: 1.45; }
a { color: var(--blau); }
:focus-visible { outline: 3px solid var(--blau); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ---------- Verwaltung ---------- */
.kopf { display: flex; align-items: center; gap: 28px; padding: 14px 32px; border-bottom: 1px solid var(--linie); flex-wrap: wrap; background: #fff; position: sticky; top: 0; z-index: 20; }
.kopf .logo { height: 42px; width: auto; display: block; }
.kopf nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.kopf nav a { padding: 10px 14px; text-decoration: none; color: var(--text); font-size: 15px; border-bottom: 3px solid transparent; }
.kopf nav a[aria-current] { border-color: var(--rot); font-weight: 700; }
.kopf .wer { font-size: 14px; color: var(--sek); }
.inhalt { max-width: 1280px; margin: 0 auto; padding: 32px; }
.seitenkopf { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.seitenkopf h1 { margin: 0; font-size: 26px; }
.seitenkopf h1::after { content: ""; display: block; width: 56px; height: 4px; background: var(--rot); margin-top: 8px; }
.pfad { margin: 0 0 6px; font-size: 13px; color: var(--sek); }
.pfad a { color: var(--sek); }
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; background: #fff; color: var(--blau); border: 1.5px solid #b7bbcf; border-radius: 8px; font: inherit; font-weight: 700; font-size: 14px; white-space: nowrap; text-decoration: none; cursor: pointer; transition: transform .12s ease-out, background-color .15s; }
.knopf:active { transform: scale(.97); }
.knopf.haupt { background: var(--blau); color: #fff; border-color: var(--blau); }
.knopf.klein { min-height: 34px; padding: 0 11px; font-size: 13px; }
.knopf.gefahr { color: var(--rot); border-color: #e2b3b1; }
.knopf[disabled] { opacity: .45; cursor: default; }
.zeile-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.meta { color: var(--sek); font-size: 13px; }
.hinweis { padding: 12px 14px; border-radius: 8px; background: #eef0fa; border: 1.5px solid #b7bbcf; margin: 0 0 20px; font-size: 14px; }
.hinweis.ok { background: #e8f3e8; border-color: #9cc59e; }
.hinweis.warn { background: var(--tint); border-color: var(--gelb); }

.liste { list-style: none; margin: 0; padding: 0; }
.fz { display: grid; grid-template-columns: minmax(220px, 1.5fr) 120px 170px auto; gap: 20px; align-items: center; padding: 18px 0; border-top: 1px solid var(--linie); }
.fz:last-child { border-bottom: 1px solid var(--linie); }
.fz strong { display: block; font-size: 17px; margin-bottom: 2px; }
.fz strong a { color: var(--text); text-decoration: none; }
.fz .aktionen { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.zahl { font-variant-numeric: tabular-nums; }
.marke { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; white-space: nowrap; padding: 3px 10px; border-radius: 99px; border: 1.5px solid; }
.marke i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: block; }
.m-aktiv, .m-erledigt { color: #000; border-color: var(--ok); background: #e8f3e8; } .m-aktiv i, .m-erledigt i { background: var(--ok); }
.m-entwurf { color: var(--sek); border-color: #b7bbcf; background: #f4f5f8; }
.m-geschlossen { color: #000; border-color: var(--grau); background: #ececec; }
.m-neu { color: var(--blau); border-color: var(--blau); background: #eef0fa; }
.m-bearbeitung { color: #000; border-color: var(--mittel); background: #fdf1d3; } .m-bearbeitung i { background: var(--mittel); }

.karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 12px; }
.karte { border: 1px solid var(--linie); border-radius: 10px; padding: 16px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.karte h3 { margin: 0; font-size: 16px; }
.karte p { margin: 0; font-size: 14px; color: var(--sek); flex: 1; }
details.neu { border: 1px solid var(--linie); border-radius: 10px; padding: 0 18px; margin-bottom: 28px; background: var(--hell); }
details.neu summary { cursor: pointer; padding: 14px 0; font-weight: 700; color: var(--blau); }
details.neu[open] { padding-bottom: 18px; }

.filter { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.feld { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--sek); min-width: 0; }
.feld input, .feld select, .feld textarea { font: inherit; font-size: 15px; color: #000; min-height: 40px; border: 1.5px solid #9a9a9a; border-radius: 8px; padding: 6px 10px; background: #fff; width: 100%; }
.feld textarea { min-height: 90px; }
.feld input:focus, .feld select:focus, .feld textarea:focus { border-color: var(--blau); outline: 2px solid var(--blau); }
.filter .suche { flex: 1 1 260px; }
.reiter { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.reiter a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 14px; border: 1px solid transparent; }
.reiter a[aria-current] { border-color: var(--blau); background: #eef0fa; font-weight: 700; }
.tw { overflow-x: auto; border: 1px solid var(--linie); border-radius: 8px; }
.tab { border-collapse: collapse; width: 100%; font-size: 14px; }
.tab th { background: #fff; color: #000; border-bottom: 2px solid var(--blau); text-align: left; font-size: 13px; padding: 11px 12px; white-space: nowrap; }
.tab td { padding: 12px; border-bottom: 1px solid var(--linie); vertical-align: top; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab tbody tr:nth-child(even) { background: #f8f9fb; }
.tab tr.klick { cursor: pointer; }
.leer { padding: 40px 16px; text-align: center; color: var(--sek); }

.raster { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.block { border: 1px solid var(--linie); border-radius: 10px; padding: 20px; background: #fff; margin-bottom: 20px; }
.block h2 { margin: 0 0 14px; font-size: 17px; }
.paare { display: grid; grid-template-columns: minmax(140px, 34%) 1fr; margin: 0; }
.paare dt, .paare dd { padding: 10px 0; border-bottom: 1px solid var(--linie); margin: 0; }
.paare dt { font-weight: 700; color: var(--sek); font-size: 14px; padding-right: 12px; }
.paare dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.paare .abschnitt { grid-column: 1 / -1; font-weight: 700; color: var(--blau); font-size: 16px; padding: 18px 0 6px; border-bottom: 2px solid var(--blau); }
.bilder { display: flex; flex-wrap: wrap; gap: 8px; }
.bilder img { width: 140px; height: 105px; object-fit: cover; border-radius: 8px; border: 1px solid var(--linie); }
.bilder img.unterschrift { object-fit: contain; width: 240px; background: #fff; }
.eintrag { border: 1px solid var(--linie); border-radius: 8px; padding: 6px 12px; margin: 6px 0; }
.formular-einst { display: grid; gap: 16px; }
.formular-einst fieldset { border: 1px solid var(--linie); border-radius: 10px; padding: 16px 18px 18px; margin: 0; display: grid; gap: 14px; }
.formular-einst legend { font-weight: 700; padding: 0 6px; color: var(--blau); }
.haken { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.haken input { width: 20px; height: 20px; accent-color: var(--blau); }
.adresse { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.adresse code { background: var(--hell); padding: 8px 10px; border-radius: 6px; font-size: 14px; overflow-wrap: anywhere; }

/* Baukasten */
.bau-leiste { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 32px; border-bottom: 1px solid var(--linie); background: var(--hell); position: sticky; top: 71px; z-index: 15; }
.bau-leiste input.titel { font: inherit; font-size: 18px; font-weight: 700; border: 1.5px solid transparent; border-radius: 8px; padding: 6px 10px; min-width: 0; width: min(520px, 100%); background: transparent; }
.bau-leiste input.titel:hover, .bau-leiste input.titel:focus { border-color: #9a9a9a; background: #fff; }
#speicherstand { font-size: 13px; color: var(--sek); min-width: 140px; }
.bau { padding: 20px 32px 80px; }
.bau .formio.builder { margin: 0; }
.bau .formcomponents .builder-sidebar .card-header button { font-weight: 700; color: var(--blau); text-decoration: none; }
.bau .drag-container { min-height: 120px; }
.bau .builder-component:hover { outline: 1px dashed var(--blau); }
.formio-dialog .formio-dialog-content { max-width: 1100px; width: 94vw; }

@media (max-width: 900px) {
  .raster { grid-template-columns: 1fr; }
  .fz { grid-template-columns: 1fr auto; }
  .fz .aktionen { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 640px) {
  .kopf, .bau-leiste { padding: 12px 16px; }
  .inhalt, .bau { padding: 20px 16px 48px; }
  .paare { grid-template-columns: 1fr; }
  .paare dt { border-bottom: 0; padding-bottom: 0; }
  .bau-leiste { top: 0; position: static; }
}

/* ---------- Ausfüllen (groß, handschuhtauglich) ---------- */
body.ausfuellen { background: var(--hell); }
.af-kopf { background: #fff; border-bottom: 1px solid var(--linie); }
.af-kopf .in { max-width: 760px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.af-kopf .logo { height: 38px; width: auto; display: block; }
.af-kopf .titel { margin: 0; font-weight: 700; font-size: 17px; line-height: 1.25; text-align: right; }
.af-haupt { max-width: 760px; margin: 0 auto; padding: 16px 16px 120px; }
.af-blatt { background: #fff; border: 1px solid var(--linie); border-radius: 14px; padding: 20px 18px; }
.netz { display: flex; gap: 12px; align-items: center; margin: 0 0 14px; padding: 12px 14px; border-radius: 10px; font-size: 15px; line-height: 1.35; }
.netz[hidden] { display: none; }
.netz.offline { background: var(--tint); border: 2px solid var(--gelb); }
.netz.wartet { background: #eef0fa; border: 2px solid var(--blau); }
.netz.ok { background: #e8f3e8; border: 2px solid var(--ok); }
.danke { text-align: center; padding: 40px 12px; }
.danke h2 { font-size: 24px; margin: 0 0 10px; }
.danke .nummer { font-size: 15px; color: var(--sek); }
.danke .knopf { min-height: 56px; font-size: 17px; margin-top: 20px; }
.kiosk-hinweis { font-size: 14px; color: var(--sek); margin-top: 8px; }

/* formio im Ausfüllen: groß und kontrastreich */
.ausfuellen .formio-component { margin-bottom: 20px; }
.ausfuellen .col-form-label, .ausfuellen .formio-component > label, .ausfuellen legend, .ausfuellen .field-label { font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.ausfuellen .form-control, .ausfuellen .choices__inner { min-height: 52px; font-size: 17px; border: 2px solid #8a8a8a; border-radius: 10px; }
.ausfuellen textarea.form-control { min-height: 110px; }
.ausfuellen .form-control:focus { border-color: var(--blau); box-shadow: 0 0 0 3px rgba(35, 46, 106, .25); }
.ausfuellen .btn { min-height: 56px; font-size: 17px; font-weight: 700; border-radius: 12px; padding: 0 22px; }
.ausfuellen .btn-primary { background: var(--blau); border-color: var(--blau); }
.ausfuellen .formio-component-button .btn, .ausfuellen .formio-wizard-nav-container .btn { width: 100%; }
.ausfuellen .formio-wizard-nav-container { display: flex; gap: 10px; padding: 0; list-style: none; }
.ausfuellen .formio-wizard-nav-container li { flex: 1; }
.ausfuellen .pagination { flex-wrap: wrap; gap: 4px; }
.ausfuellen .card { border-radius: 12px; border-color: var(--linie); }
.ausfuellen .card-header { background: #fff; font-weight: 700; color: var(--blau); border-bottom: 1px solid var(--linie); }
.ausfuellen .text-danger, .ausfuellen .formio-errors .error { color: var(--schlecht) !important; font-weight: 700; }
.ausfuellen .field-required::after { color: var(--rot); }
.ausfuellen .form-radio > div, .ausfuellen .form-check, .ausfuellen .form-check-inline { display: flex; align-items: center; gap: 10px; padding-left: 0; margin: 0 0 4px; min-height: 48px; }
.ausfuellen .form-check-inline { margin-right: 18px; }
.ausfuellen .form-check-input { width: 24px; height: 24px; margin: 0; float: none; flex: none; }
.ausfuellen .form-check-label { font-size: 16px; cursor: pointer; }
.ausfuellen .signature-pad-body { border: 2px solid #8a8a8a; border-radius: 12px; }

/* Baustein Ja / Nein / Nicht zutreffend: große Tasten. formio setzt input und label als Geschwister. */
.ehbs-tasten .form-radio { display: grid; grid-template-columns: 1fr; gap: 10px; }
.ehbs-tasten .form-radio > div { position: relative; margin: 0; min-height: 0; display: block; }
.ehbs-tasten .form-check-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.ehbs-tasten .form-check-label { display: flex; align-items: center; justify-content: center; min-height: 58px; padding: 8px 12px; border: 2px solid #8a8a8a; border-radius: 12px; background: #fff; font-weight: 700; font-size: 17px; text-align: center; transition: transform .12s ease-out, background-color .15s; }
.ehbs-tasten .form-check-label:active { transform: scale(.97); }
.ehbs-tasten .form-check-input:focus-visible + .form-check-label { outline: 3px solid var(--blau); outline-offset: 2px; }
.ehbs-tasten .form-check-input:checked + .form-check-label { background: var(--blau); border-color: var(--blau); color: #fff; }
.ehbs-tasten .form-check-input[value="ja"]:checked + .form-check-label { background: var(--ok); border-color: var(--ok); }
.ehbs-tasten .form-check-input[value="nein"]:checked + .form-check-label { background: var(--schlecht); border-color: var(--schlecht); }
.ehbs-tasten .form-check-input[value="nz"]:checked + .form-check-label { background: var(--anthrazit); border-color: var(--anthrazit); }
.ehbs-tasten.zwei .form-radio { grid-template-columns: 1fr 1fr; }
@media (min-width: 560px) { .ehbs-tasten:not(.zwei) .form-radio { grid-template-columns: 1fr 1fr 1.3fr; } }

/* Einträge (Teilnehmende, Barzahler) */
.ausfuellen .btn-sm { min-height: 40px; font-size: 15px; padding: 0 12px; border-radius: 10px; width: auto; }
.ausfuellen .editgrid-listgroup .list-group-item { padding: 10px 12px; }
.eintrag-zeile { display: flex; align-items: center; gap: 12px; }
.eintrag-zeile .eintrag-name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.eintrag-zeile .ok { color: var(--ok); font-weight: 700; font-size: 14px; }
.ausfuellen .formio-component-editgrid .btn-primary, .ausfuellen .formio-button-add-row { width: 100%; }

/* Fotos als Kacheln */
.ausfuellen .formio-component-file .list-group-item { border-radius: 10px; }
.ausfuellen .formio-component-file img { max-width: 140px; max-height: 105px; object-fit: cover; border-radius: 8px; }
.ausfuellen .fileSelector { border: 2px dashed var(--blau); border-radius: 12px; padding: 22px 12px; font-size: 16px; font-weight: 700; color: var(--blau); text-align: center; }
.ausfuellen .fileSelector a { font-weight: 700; }

.kiosk .af-kopf a { pointer-events: none; }
/* Hover nur mit Maus, sonst bleibt der Zustand auf Touch-Geräten hängen */
@media (hover: hover) and (pointer: fine) {
  .knopf:hover { background: #eceef7; }
  .knopf.haupt:hover { background: var(--blau-d); }
  .fz strong a:hover { text-decoration: underline; }
  .tab tbody tr:hover { background: #eef0fa; }
  .ausfuellen .btn-primary:hover { background: var(--blau-d); }
}

/* Touch: kleine Knöpfe mindestens 44 px hoch */
@media (pointer: coarse) {
  .knopf.klein { min-height: 44px; padding: 0 14px; }
  .kopf nav a { padding: 12px 14px; }
}

/* Danke-Ansicht und Netzhinweis erscheinen weich statt zu springen */
@keyframes auftauchen { from { opacity: 0; transform: translateY(8px); } }
.danke:not([hidden]) { animation: auftauchen .28s cubic-bezier(.23, 1, .32, 1); }
.netz:not([hidden]) { animation: auftauchen .2s cubic-bezier(.23, 1, .32, 1); }

/* Bewegung reduzieren: keine Verschiebung und kein Skalieren, Farbrückmeldung bleibt */
@media (prefers-reduced-motion: reduce) {
  .knopf:active, .ehbs-tasten .form-check-label:active { transform: none; }
  .danke:not([hidden]), .netz:not([hidden]) { animation-name: einblenden; }
}
@keyframes einblenden { from { opacity: 0; } }
