/*
 * Förder-Radar — Minimal-UI (S6 / #7).
 * Zero Dependencies, keine externen Fonts/CDN. Alles lokal, intern/privat.
 * Farben mit Blick auf WCAG-AA-Kontrast gewählt.
 */

:root {
  /* Flächen / Text */
  --c-bg: #f4f6f8;
  --c-surface: #ffffff;
  --c-border: #d4dae0;
  --c-text: #1c2733;        /* auf #fff ~ 13:1 */
  --c-text-leise: #4a5663;  /* auf #fff ~ 7:1 */
  --c-primaer: #0b5c8a;     /* auf #fff ~ 5.6:1, weißer Text darauf ~ 5.6:1 */
  --c-primaer-dunkel: #084766;
  --c-link: #0b5c8a;

  /* Begründungs-Bullets */
  --c-positiv: #1b6b3a;     /* auf #fff ~ 5.5:1 */
  --c-negativ: #5d6873;     /* auf #fff ~ 5.2:1 */

  /* Status */
  --c-fehler-bg: #fdecea;
  --c-fehler-text: #8a1f12; /* auf hellrot ~ 7:1 */
  --c-fehler-rand: #d9897f;
  --c-info-bg: #e8f1f6;
  --c-info-text: #084766;

  /* Deadline-Buckets (Dringlichkeit, §3.4) — Text/BG je AA-kontrastiert */
  --c-bucket-7-bg: #fdecea;   --c-bucket-7-text: #8a1f12;
  --c-bucket-14-bg: #fdf0e2;  --c-bucket-14-text: #8a4b10;
  --c-bucket-30-bg: #fcf7e0;  --c-bucket-30-text: #6b5710;
  --c-bucket-60-bg: #e8f1ea;  --c-bucket-60-text: #1b6b3a;

  --radius: 8px;
  --gap: 16px;
  --maxw: 880px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
}

/* Tastatur-Sprunglink: nur sichtbar bei Fokus */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--c-primaer);
  color: #fff;
  padding: 10px 16px;
  z-index: 10;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* Sichtbarer Fokus für alle interaktiven Elemente */
:focus-visible {
  outline: 3px solid var(--c-primaer);
  outline-offset: 2px;
}

a { color: var(--c-link); }
a:hover { text-decoration: none; }

.kopf,
.hauptinhalt,
.fusszeile {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gap);
}

.kopf {
  padding-top: 28px;
  padding-bottom: 8px;
}
.kopf h1 {
  margin: 0 0 4px;
  font-size: 1.7rem;
}
.untertitel {
  margin: 0 0 8px;
  color: var(--c-text-leise);
}
.hinweis {
  margin: 0;
  font-size: 0.85rem;
  color: var(--c-text-leise);
}

.hauptinhalt {
  padding-bottom: 16px;
}

/* ---- Panel / Formular ---- */
.panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
}
.panel h2 {
  margin: 0 0 16px;
  font-size: 1.2rem;
}

.feld-gruppe {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--gap);
  flex: 1 1 0;
  min-width: 0;
}
.feld-gruppe label {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.feld-reihe {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
}

input,
select,
textarea {
  font: inherit;
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 10px 12px;
  min-height: 44px;   /* Touch-Target */
  width: 100%;
}
textarea { resize: vertical; min-height: 88px; }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--c-primaer);
}

.aktionen {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 6px;
  padding: 12px 20px;
  min-height: 44px;   /* Touch-Target */
  cursor: pointer;
  border: 1px solid transparent;
}
.btn:disabled { opacity: 0.6; cursor: progress; }

.btn-primaer {
  background: var(--c-primaer);
  color: #fff;
}
.btn-primaer:hover:not(:disabled) { background: var(--c-primaer-dunkel); }

.btn-sekundaer {
  background: var(--c-surface);
  color: var(--c-primaer);
  border-color: var(--c-primaer);
}
.btn-sekundaer:hover:not(:disabled) { background: var(--c-info-bg); }

/* ---- Status-/Fehlerzeile ---- */
.status {
  max-width: var(--maxw);
  margin: 16px auto 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
}
.status.fehler {
  background: var(--c-fehler-bg);
  color: var(--c-fehler-text);
  border-color: var(--c-fehler-rand);
}
.status.info {
  background: var(--c-info-bg);
  color: var(--c-info-text);
  border-color: #b6d2e0;
}
.status.laden::after {
  content: "";
  display: inline-block;
  width: 14px; height: 14px;
  margin-left: 8px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .status.laden::after { animation: none; }
}

/* ---- Ergebnisse ---- */
.ergebnisse {
  margin-top: 8px;
}
.ergebnis-kopf {
  margin: 24px 0 8px;
  font-size: 1.25rem;
}
.leer-hinweis {
  background: var(--c-info-bg);
  color: var(--c-info-text);
  border: 1px solid #b6d2e0;
  border-radius: var(--radius);
  padding: 16px;
}

.karte {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: var(--gap);
}
.karte-kopf {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.rang {
  font-weight: 700;
  color: var(--c-text-leise);
}
.karte-name { margin: 0; font-size: 1.1rem; }
.karte-traeger {
  margin: 0 0 12px;
  color: var(--c-text-leise);
  font-size: 0.95rem;
}

/* Scores */
.scores {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--c-text-leise);
}
.score-total {
  font-weight: 700;
  color: var(--c-text);
}
.score-bar {
  display: inline-block;
  height: 8px;
  width: 120px;
  max-width: 40vw;
  background: var(--c-border);
  border-radius: 4px;
  overflow: hidden;
  vertical-align: middle;
}
.score-bar > span {
  display: block;
  height: 100%;
  background: var(--c-primaer);
}

/* Eckdaten */
.eckdaten {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
}
.eckdaten dt { font-weight: 600; display: inline; }
.eckdaten dd { display: inline; margin: 0 0 0 4px; }
.eckdaten > div { white-space: nowrap; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-7  { background: var(--c-bucket-7-bg);  color: var(--c-bucket-7-text); }
.badge-14 { background: var(--c-bucket-14-bg); color: var(--c-bucket-14-text); }
.badge-30 { background: var(--c-bucket-30-bg); color: var(--c-bucket-30-text); }
.badge-60 { background: var(--c-bucket-60-bg); color: var(--c-bucket-60-text); }

/* Begründung */
.begruendung {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
}
.begruendung li { display: flex; gap: 8px; padding: 2px 0; }
.begruendung .marker { font-weight: 700; flex: 0 0 auto; }
.passt-weil .marker { color: var(--c-positiv); }
.passt-nicht .marker { color: var(--c-negativ); }
.passt-nicht { color: var(--c-text-leise); }

/* Provenienz + Attribution */
.provenienz {
  font-size: 0.85rem;
  color: var(--c-text-leise);
  margin: 12px 0 6px;
  padding-top: 10px;
  border-top: 1px solid var(--c-border);
}
.provenienz .trenner { margin: 0 6px; }

/* PFLICHT (Legal §7.1): sichtbare Attribution je Karte */
.attribution {
  font-size: 0.82rem;
  color: var(--c-text-leise);
  margin: 0;
  font-style: italic;
}

/* Antrags-Absatz + Kosten */
.antrag {
  background: var(--c-info-bg);
  border: 1px solid #b6d2e0;
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 8px;
}
.antrag h3 { margin: 0 0 8px; font-size: 1.05rem; }
.antrag-text { margin: 0 0 10px; white-space: pre-wrap; }
.kosten {
  margin: 0;
  font-size: 0.82rem;
  color: var(--c-text-leise);
}

/* Alert-Zeilen */
.alert-zeile {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left-width: 5px;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 10px;
}
.alert-zeile.bucket-7  { border-left-color: var(--c-bucket-7-text); }
.alert-zeile.bucket-14 { border-left-color: var(--c-bucket-14-text); }
.alert-zeile.bucket-30 { border-left-color: var(--c-bucket-30-text); }
.alert-zeile.bucket-60 { border-left-color: var(--c-bucket-60-text); }
.alert-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.alert-name { font-weight: 600; }
.alert-meta { color: var(--c-text-leise); font-size: 0.9rem; }

.fusszeile {
  margin-top: 24px;
  padding-top: 16px;
  padding-bottom: 32px;
  border-top: 1px solid var(--c-border);
  font-size: 0.82rem;
  color: var(--c-text-leise);
}
.fusszeile p { margin: 0; }

/* ---- Responsive ---- */
@media (max-width: 560px) {
  .feld-reihe { flex-direction: column; gap: 0; }
  .aktionen .btn { width: 100%; }
  .score-bar { max-width: 100%; }
}
