/* Gemeinsame Gestaltung (Vorbereitung, Anmeldung, Regie). Maße und Farben nach den Entwürfen; keine Inline-Stile
   (die CSP verbietet sie), Schrift Inter lokal. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/Inter-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/Inter-var-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bni-rot: #cf2030;
  --bni-rot-dunkel: #a81926;
  --text: #1c1c1e;
  --grau: #55555b;
  --grau-hell: #f4f4f6;
  --linie: #ececee;
  --linie-stark: #d5d5da;
  --weiss: #ffffff;
  --gruen: #1e7b3c;
  --warn: #b45309;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--grau-hell);
  line-height: 1.5;
}

a { color: var(--bni-rot); }

/* Kopf: weiß, 64 px, Unterstrich 2 px */
.kopf {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
  padding: 0 1.5rem;
  background: var(--weiss);
  color: var(--text);
  border-bottom: 2px solid var(--linie);
}

.marke { display: inline-flex; align-items: center; gap: 0.75rem; color: var(--text); font-weight: 800; font-size: 1.25rem; text-decoration: none; white-space: nowrap; }
.marke span { font-weight: 500; color: var(--grau); }
.logo { display: block; height: 40px; width: auto; max-width: 160px; }
.logo-platzhalter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--bni-rot);
  color: var(--weiss);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.menue { display: flex; gap: 0.25rem; flex: 1; flex-wrap: wrap; align-self: stretch; align-items: stretch; }
.menue a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 0.875rem;
  color: var(--grau);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 4px solid transparent;
}
.menue a:hover { color: var(--text); }
.menue a[aria-current="page"] { color: var(--text); border-bottom-color: var(--bni-rot); }

.abmelden { display: flex; align-items: center; gap: 0.75rem; margin: 0; }
.benutzer { color: var(--grau); font-size: 0.875rem; }

.inhalt { max-width: 72rem; margin: 0 auto; padding: 1.5rem; }

h1 { font-size: 1.75rem; font-weight: 800; margin: 0 0 1rem; line-height: 1.2; }
h2 { font-size: 1.25rem; font-weight: 700; margin: 1.5rem 0 0.75rem; }

/* Karten: weiß, Radius 16 */
.karte {
  background: var(--weiss);
  border: 1px solid var(--linie);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.karte.schmal { max-width: 26rem; margin: 2rem auto; }

.formular { display: flex; flex-direction: column; gap: 0.5rem; }
.formular label { font-weight: 600; margin-top: 0.5rem; }
.formular input[type="text"],
.formular input[type="password"],
.formular input[type="url"],
.formular input[type="number"],
.formular input[type="file"],
.formular input[type="time"],
.formular input[type="date"],
.formular input[type="tel"],
.formular select,
.formular textarea {
  min-height: 48px;
  padding: 0.5rem 0.75rem;
  font: inherit;
  border: 2px solid var(--linie-stark);
  border-radius: 10px;
  background: var(--weiss);
}
.formular input:focus, .formular select:focus, .formular textarea:focus { outline: 3px solid rgba(207, 32, 48, 0.35); border-color: var(--bni-rot); }
.formular .hilfe, .hilfe { color: var(--grau); font-size: 0.875rem; margin: 0; }
.formular .fehler { color: var(--bni-rot-dunkel); font-size: 0.875rem; margin: 0; }
.formular .kontrollfeld { display: flex; align-items: center; gap: 0.5rem; min-height: 48px; }
.formular .kontrollfeld input { width: 1.5rem; height: 1.5rem; }
.formular .kontrollfeld label { margin: 0; font-weight: 400; }

/* Knöpfe: Radius 12, mindestens 48 px */
.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 48px;
  padding: 0 1.25rem;
  font: inherit;
  font-weight: 700;
  color: var(--weiss);
  background: var(--bni-rot);
  border: 2px solid var(--bni-rot);
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.knopf:hover { background: var(--bni-rot-dunkel); border-color: var(--bni-rot-dunkel); }
.knopf:focus-visible, .kachel:focus-visible, .menue a:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.knopf[disabled] { opacity: 0.45; cursor: not-allowed; }
.knopf-hell { background: var(--weiss); color: var(--text); border-color: var(--linie-stark); }
.knopf-hell:hover { background: var(--grau-hell); border-color: var(--text); }
.knopf-grau { background: var(--text); border-color: var(--text); }
.knopf-grau:hover { background: var(--grau); border-color: var(--grau); }
.knopf-gruen { background: var(--gruen); border-color: var(--gruen); }

.meldungen { list-style: none; padding: 0; margin: 0 0 1rem; }
.meldung { padding: 0.75rem 1rem; border-radius: 12px; margin-bottom: 0.5rem; border: 2px solid var(--linie-stark); background: var(--weiss); }
.meldung-success { border-color: var(--gruen); background: #f0fdf4; }
.meldung-error { border-color: var(--bni-rot); background: #fef2f2; }
.meldung-warning { border-color: var(--warn); background: #fffbeb; }

table { width: 100%; border-collapse: collapse; background: var(--weiss); }
th, td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--linie); vertical-align: middle; overflow-wrap: anywhere; }
th { background: var(--grau-hell); color: var(--grau); font-size: 0.875rem; }

.foto { width: 48px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--grau-hell); display: block; }
.foto-gross { width: 180px; height: 240px; }
.etikett { display: inline-block; padding: 0.125rem 0.625rem; border-radius: 999px; background: var(--grau-hell); border: 1px solid var(--linie-stark); font-size: 0.875rem; }
.etikett-warnung { border-color: var(--warn); color: #92400e; background: #fffbeb; }
.leiste { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.inline { display: inline; margin: 0; }
.zeile { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0 0 0.5rem; }
.zeile > span { min-width: 12rem; }
.nur-lesehilfe { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Anmeldung der Funktionen: große Kacheln, Codefeld */
.kacheln { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 1rem 0; }
.kacheln form { margin: 0; }
.kachel {
  width: 100%;
  min-height: 96px;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
  background: var(--weiss);
  color: var(--bni-rot);
  border: 2px solid var(--bni-rot);
  border-radius: 16px;
  overflow-wrap: anywhere;
}
.kachel:hover { background: var(--bni-rot); color: var(--weiss); }
.code-feld { font-size: 2rem; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; min-height: 56px; }

/* HTMX: Rückmeldung während einer Anfrage (ohne eingebaute Stile, die CSP sperrt) */
.htmx-request { opacity: 0.6; cursor: progress; }
.htmx-added { animation: bni-einblenden 0.4s ease-out; }
@keyframes bni-einblenden { from { background: #fff4d6; } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .htmx-added { animation: none; } }

/* Abhak-Liste der Anwesenheit (Regie) */
.anw-zaehler { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0 0 1rem; font-weight: 700; }
.anw-zaehler span { min-width: 9rem; }
.anw-liste { list-style: none; margin: 0; padding: 0; }
.anw-zeile {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--weiss);
  border: 2px solid var(--linie);
  border-radius: 12px;
}
.anw-zeile.status-present { border-color: var(--gruen); }
.anw-zeile.status-substituted { border-color: var(--warn); }
.anw-zeile.status-excused { border-color: var(--linie-stark); background: var(--grau-hell); }
.anw-zeile .foto { width: 56px; height: 72px; }
.anw-name { font-weight: 700; overflow-wrap: anywhere; }
.anw-name small { display: block; font-weight: 400; color: var(--grau); }
.anw-status { display: inline-block; min-width: 8.5rem; margin-top: 0.25rem; font-size: 0.875rem; font-weight: 700; }
.anw-knoepfe { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: flex-end; }
.anw-knoepfe form { margin: 0; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.anw-knoepfe input[type="text"] { min-height: 48px; width: 12rem; padding: 0 0.75rem; font: inherit; border: 2px solid var(--linie-stark); border-radius: 10px; }
.anw-knoepfe .kontrollfeld { display: flex; align-items: center; gap: 0.375rem; min-height: 48px; }
.anw-knoepfe .kontrollfeld input { width: 1.5rem; height: 1.5rem; }
.knopf-aktiv { background: var(--text); border-color: var(--text); color: var(--weiss); }
.knopf-aktiv:hover { background: var(--text); border-color: var(--text); color: var(--weiss); }

/* Vorschau hochgeladener Bilder (Erscheinungsbild) auf kariertem Grund, damit Transparenz sichtbar bleibt */
.vorschau { display: block; max-width: 100%; max-height: 240px; width: auto; height: auto; padding: 0.5rem; background: var(--grau-hell); border: 1px solid var(--linie-stark); border-radius: 12px; }
img.logo.vorschau { max-width: 320px; height: auto; max-height: 160px; }
