/* ==========================================================
   Farben – hier an das Erscheinungsbild der Website anpassen
   ========================================================== */
:root {
  /* Hessischer Schützenverband: Grün als Hauptfarbe, Gelb sparsam als Akzent */
  --akzent: #3fa535;          /* Hauptfarbe: Knöpfe, Rahmen, Flächen            */
  --akzent-dunkel: #2e7d27;   /* dunkleres Grün: Hover und grüne Schrift auf Weiß */
  --akzent-text: #2e7d27;     /* (besser lesbar als das helle Grün)             */
  --akzent-hell: #edf7ec;     /* heller Hintergrund-Ton                         */
  --gelb: #f9c838;            /* Akzentfarbe – nur für kleine Hervorhebungen    */
  --text: #1f1f1f;
  --grau: #5c5f63;
  --linie: #d9d9d9;
  --flaeche: #ffffff;
  --fehler: #b3261e;
  --ok: #2e7d32;
  --radius: 10px;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: transparent;
}
body.eigenstaendig { background: #f3f3f3; }
a { color: var(--akzent-text); }
h1 { font-size: clamp(1.45rem, 2.6vw, 1.95rem); line-height: 1.25; margin: 0 0 .6em; }
h2 { font-size: 1.2rem; line-height: 1.3; margin: 0 0 .7em; }
p { margin: 0 0 .9em; }
.klein { font-size: .875rem; color: var(--grau); }
code { background: #eee; padding: 1px 5px; border-radius: 4px; font-size: .9em; }

.inhalt { max-width: 1120px; margin: 0 auto; padding: 4px 2px 24px; }
.eigenstaendig .inhalt { padding: 28px 16px 32px; }

/* ---------- Kopf- und Fußzeile (nur außerhalb des iframes) ---------- */
.kopfzeile { background: var(--akzent); color: #fff; border-bottom: 4px solid var(--gelb); }
.kopfzeile-innen { max-width: 1120px; margin: 0 auto; padding: 14px 16px; display: flex; flex-direction: column; }
.kopfzeile-verband { font-size: .8rem; opacity: .85; letter-spacing: .02em; }
.kopfzeile-titel { font-size: 1.15rem; font-weight: 700; }
.fusszeile { text-align: center; font-size: .8rem; padding: 8px 16px 16px; }
.fusszeile a { color: var(--grau); margin: 0 8px; }

/* ---------- Einleitung ---------- */
.einleitung { margin-bottom: 8px; }
.einleitung p { max-width: 72ch; }

/* ---------- Kategorien ---------- */
.kategorie { border: 0; margin: 40px 0 0; padding: 0; min-width: 0; }
.kategorie-kopf { display: flex; align-items: center; gap: 12px; width: 100%; padding: 0; font-size: 1.3rem; font-weight: 700; line-height: 1.3; }
.kategorie-nr {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--akzent); color: #fff; font-size: .95rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.kategorie-text { color: var(--grau); margin: 6px 0 16px 46px; }

/* ---------- Karten der Nominierten ---------- */
.karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 16px; align-items: stretch; }
.karte {
  position: relative; display: flex; flex-direction: column;
  background: var(--flaeche); border: 2px solid var(--linie); border-radius: var(--radius); overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.karte:hover { border-color: #b5b5b5; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.karte-radio { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
/* Ist ein Text aufgeklappt, sollen die Nachbarkarten nicht mitwachsen */
.karten:has(.mehr-knopf[aria-expanded="true"]) { align-items: start; }
.karte:has(.karte-radio:focus-visible) { outline: 3px solid var(--akzent-dunkel); outline-offset: 3px; }
.karte:has(.karte-radio:checked) {
  border-color: var(--akzent);
  box-shadow: 0 0 0 1px var(--akzent), 0 6px 20px rgba(63, 165, 53, .25);
}

.karte-oben { display: block; cursor: pointer; }
.karte-bild { display: block; position: relative; aspect-ratio: 4 / 5; background: #ececec; overflow: hidden; }
.karte-bild img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.initialen {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem; font-weight: 700; letter-spacing: .04em; color: var(--akzent-text);
  background: linear-gradient(160deg, var(--akzent-hell), #e9e9e9);
}
.karte-kopf { display: block; padding: 12px 14px 10px; }
.karte-name { display: block; font-weight: 700; font-size: 1.04rem; line-height: 1.3; }
.karte-unter { display: block; margin-top: 2px; font-size: .84rem; font-weight: 600; line-height: 1.35; color: var(--akzent-text); }

.karte-beschreibung { padding: 0 14px 12px; }
.karte-text { font-size: .9rem; line-height: 1.45; color: var(--grau); }
.karte-text p { margin: 0 0 .5em; }
.karte-text p:last-child { margin-bottom: 0; }
/* Lange Texte werden gekürzt (nur mit JavaScript, damit ohne JS alles lesbar bleibt) */
.karte-text.gekuerzt { max-height: calc(1.45em * 7); overflow: hidden; position: relative; }
.karte-text.gekuerzt::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.6em;
  background: linear-gradient(rgba(255,255,255,0), var(--flaeche));
}
.mehr-knopf {
  margin: 4px 0 0; padding: 2px 0; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: .86rem; font-weight: 600; color: var(--akzent-text); text-decoration: underline;
}

.karte-knopf {
  display: block; margin: auto 14px 14px; padding: 8px; border-radius: 6px; text-align: center; cursor: pointer;
  border: 1.5px solid var(--akzent); color: var(--akzent-text); font-weight: 600; font-size: .94rem;
  transition: background .15s ease, color .15s ease;
}
.t-gewaehlt { display: none; }
.karte-radio:checked ~ .karte-oben .karte-bild::after {
  content: "\2713"; position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gelb); color: #1f1f1f; font-weight: 700; font-size: 1.05rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.karte-radio:checked ~ .karte-knopf { background: var(--akzent); color: #fff; }
.karte-radio:checked ~ .karte-knopf .t-waehlen { display: none; }
.karte-radio:checked ~ .karte-knopf .t-gewaehlt { display: inline; }

.link-knopf {
  margin-top: 12px; padding: 4px 0; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: .875rem; color: var(--grau); text-decoration: underline;
}

/* ---------- Absende-Bereich ---------- */
.absenden {
  margin-top: 48px; max-width: 660px; padding: 26px 24px;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
}
.feld { margin-bottom: 22px; }
.feld-label { display: block; margin-bottom: 6px; font-weight: 600; }
.feld-hinweis { margin: 6px 0 0; font-size: .875rem; color: var(--grau); }
.feld-fehler { margin: 6px 0 0; font-size: .9rem; font-weight: 600; color: var(--fehler); }

input[type="email"], input[type="text"], input[type="password"] {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--text);
  background: #fff; border: 1.5px solid #bdbdbd; border-radius: 7px;
}
input:focus { outline: 2px solid var(--akzent-dunkel); outline-offset: 1px; border-color: var(--akzent-dunkel); }
.hat-fehler input[type="email"], .hat-fehler .auswahl-liste { border-color: var(--fehler); }

.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.checkbox input { flex-shrink: 0; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--akzent); }

.auswahl-liste { list-style: none; margin: 0; padding: 0; border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; }
.auswahl-liste li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 12px; border-top: 1px solid #eee; background: #fff; }
.auswahl-liste li:first-child { border-top: 0; }
.auswahl-kat { font-size: .9rem; color: var(--grau); }
.auswahl-name { font-weight: 700; text-align: right; }
.auswahl-name.leer { font-weight: 400; font-style: italic; color: #999; }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-block; padding: 13px 26px; border: 0; border-radius: 8px; cursor: pointer;
  font: inherit; font-weight: 700; text-align: center; text-decoration: none; line-height: 1.3;
}
.knopf-haupt { background: var(--akzent); color: #fff; }
.knopf-haupt:hover { background: var(--akzent-dunkel); color: #fff; }
.knopf-zweit { background: #fff; color: var(--akzent-text); border: 1.5px solid var(--akzent); padding: 10px 18px; }
.knopf-zweit:hover { background: var(--akzent-hell); }
.knopf-gefahr { background: var(--fehler); color: #fff; padding: 10px 18px; }
.knopf[disabled] { opacity: .6; cursor: wait; }
.absenden .knopf-haupt { width: 100%; font-size: 1.06rem; }

/* ---------- Meldungen ---------- */
.meldung { margin: 16px 0; padding: 12px 16px; border-radius: 8px; border-left: 4px solid; }
.meldung-fehler { background: #fdeceb; border-color: var(--fehler); color: #6b1712; }
.meldung-ok { background: #eaf5ea; border-color: var(--ok); color: #1b4d1e; }
.meldung-info { background: #eaf1fb; border-color: #2f6db5; color: #183b66; }

.hinweis-gross {
  max-width: 660px; margin: 16px auto; padding: 32px 26px; text-align: center;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
}
.hinweis-gross.schmal { max-width: 420px; }
.hinweis-gross .karte-box { margin: 24px 0 8px; text-align: left; }
.symbol { color: var(--akzent); margin-bottom: 8px; }
.symbol-ok { color: var(--ok); }

.aufklapper { margin-top: 22px; padding-top: 14px; border-top: 1px solid #eee; text-align: left; }
.aufklapper summary { cursor: pointer; font-weight: 600; color: var(--akzent-text); }
.aufklapper[open] summary { margin-bottom: 10px; }

.zeile { display: flex; flex-wrap: wrap; gap: 8px; }
.zeile input { flex: 1 1 220px; width: auto; }
.erneut-formular { margin-top: 8px; }

/* Falle für Spam-Programme – für Menschen unsichtbar */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Kleine Bildschirme ---------- */
@media (max-width: 560px) {
  .kategorie-text { margin-left: 0; }
  .karten { grid-template-columns: 1fr; gap: 12px; }
  .karte-oben { display: flex; align-items: center; gap: 12px; padding: 12px 12px 10px; }
  .karte-bild { flex: 0 0 76px; width: 76px; border-radius: 6px; }
  .initialen { font-size: 1.5rem; }
  .karte-radio:checked ~ .karte-oben .karte-bild::after { top: 4px; right: 4px; width: 24px; height: 24px; font-size: .85rem; }
  .karte-kopf { padding: 0; }
  .karte-beschreibung { padding: 0 12px 12px; }
  .karte-text.gekuerzt { max-height: calc(1.45em * 5); }
  .karte-knopf { margin: auto 12px 12px; padding: 7px; }
  .absenden { padding: 20px 16px; }
  .auswahl-liste li { flex-direction: column; gap: 0; }
  .auswahl-name { text-align: left; }
  .hinweis-gross { padding: 24px 16px; }
}

/* ==========================================================
   Verwaltung
   ========================================================== */
.admin .inhalt { max-width: 980px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 24px; border-bottom: 2px solid var(--linie); }
.admin-nav a { padding: 10px 14px; color: var(--grau); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.admin-nav a[aria-current="page"] { color: var(--akzent-text); border-bottom-color: var(--akzent); }
.admin-nav .rechts { margin-left: auto; }
.status-zeile { color: var(--grau); }
.status { display: inline-block; padding: 2px 10px; margin-right: 8px; border-radius: 99px; font-size: .85rem; font-weight: 700; }
.status-laufend { background: #eaf5ea; color: var(--ok); }
.status-vorher { background: #eaf1fb; color: #2f6db5; }
.status-beendet { background: #eee; color: #444; }
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 20px 0; }
.kennzahl { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px; }
.kennzahl-wert { display: block; font-size: 1.8rem; font-weight: 700; }
.kennzahl-text { color: var(--grau); font-size: .9rem; }
.export-links { margin: 8px 0 24px; }
.ergebnis { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.ergebnis-summe { font-weight: 400; color: var(--grau); font-size: .95rem; margin-left: 6px; }
.ergebnis-tabelle { width: 100%; border-collapse: collapse; background: #fff; }
.ergebnis-tabelle.schmal { width: auto; min-width: 240px; }
.ergebnis-tabelle th { text-align: left; font-size: .85rem; color: var(--grau); border-bottom: 2px solid var(--linie); padding: 6px 8px; }
.ergebnis-tabelle td { padding: 8px; border-bottom: 1px solid #eee; vertical-align: middle; }
.ergebnis-tabelle tr.erster td { background: #fff8de; }
.ergebnis-tabelle tr.erster td:first-child { box-shadow: inset 4px 0 0 var(--gelb); }
.zahl { text-align: right; font-variant-numeric: tabular-nums; }
.balken-spalte { white-space: nowrap; }
progress { -webkit-appearance: none; appearance: none; width: 140px; height: 12px; vertical-align: middle; border: 0; border-radius: 6px; background: #e6e6e6; overflow: hidden; }
progress::-webkit-progress-bar { background: #e6e6e6; border-radius: 6px; }
progress::-webkit-progress-value { background: var(--akzent); border-radius: 6px; }
progress::-moz-progress-bar { background: var(--akzent); border-radius: 6px; }
.pruef-tabelle { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); margin-bottom: 20px; }
.pruef-tabelle td { padding: 10px 12px; border-bottom: 1px solid #eee; vertical-align: top; }
.pruef-symbol { width: 36px; font-weight: 700; font-size: 1.1rem; text-align: center; }
.pruef-tabelle .ok .pruef-symbol { color: var(--ok); }
.pruef-tabelle .nicht-ok .pruef-symbol { color: var(--fehler); }
.pruef-tabelle .warnung .pruef-symbol { color: #c77700; }
.admin-form { margin: 12px 0 24px; max-width: 560px; }
.login input { margin-bottom: 14px; }
.login .knopf { width: 100%; }
.protokoll { max-height: 320px; overflow: auto; background: #1f1f1f; color: #e8e8e8; padding: 12px; border-radius: 8px; font-size: 12px; white-space: pre-wrap; }
@media (max-width: 560px) {
  progress { width: 70px; }
}
.hinweis-gross form { margin-top: 20px; }
