/* ==========================================================================
   GWSBS-Design „Bildung“ – gemeinsames Stylesheet aller Schul-Tools
   Marineblau #002647 · Lato · Sekundärfarbe Himbeere #B8406A (per Branding änderbar)

   Die Sekundärfarbe schmückt und orientiert nur (Streifen, aktiver Schritt,
   Akzente). Meldungen nutzen ausschließlich die Statusfarben – immer mit
   Symbol und Wort, nie nur über die Farbe.
   ========================================================================== */

:root {
  /* Grundfarben */
  --marine: #002647;
  --marine-hell: #1a3d5c;
  --papier: #faf7f0;
  --flaeche: #ffffff;
  --text: #1b2230;
  --text-leise: #5b6272;
  --linie: #e2dccf;
  --linie-fein: #efeae0;
  --eingabe-rand: #cfc6b4;

  /* Sekundärfarbe – wird von gwsbs-branding.js überschrieben */
  --akzent: #b8406a;
  --akzent-schrift: #ffffff;
  --akzent-toenung: #f8e7ee;

  /* Statusfarben: Vollton / Tönung / Schrift auf Tönung */
  --ok: #2e7d4f;       --ok-toenung: #e4f3ea;       --ok-schrift: #1e5a38;
  --info: #1f6fb2;     --info-toenung: #e7f0fa;     --info-schrift: #164f80;
  --warnung: #c07a00;  --warnung-toenung: #fff4db;  --warnung-schrift: #6e4600;
  --fehler: #c8331e;   --fehler-toenung: #fdeae5;   --fehler-schrift: #8f2412;
  --offen: #6b7280;    --offen-toenung: #eef0f3;    --offen-schrift: #3f4656;

  --schrift: Lato, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --radius: 8px;
  --radius-karte: 10px;
  --schatten: 0 1px 3px rgba(27, 34, 48, 0.10);
  --fokus: 0 0 0 3px rgba(0, 38, 71, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body.gw {
  margin: 0;
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--papier);
}

.gw :focus-visible { outline: none; box-shadow: var(--fokus); border-radius: var(--radius); }

/* ---------- Kopfband ---------- */
.gw-kopf {
  background: var(--marine);
  color: #fff;
  padding: 16px clamp(16px, 4vw, 48px);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.gw-logo { display: flex; align-items: center; min-height: 44px; }
.gw-logo img { max-height: 52px; max-width: 220px; display: block; }
.gw-logo:empty { display: none; }
.gw-kopf-titel { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gw-kopf-titel h1 { margin: 0; font-size: 22px; font-weight: 900; line-height: 1.2; }
.gw-kopf-titel .gw-schulname { font-size: 14px; color: rgba(255, 255, 255, 0.8); }
.gw-kopf-aktionen { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.gw-streifen { height: 5px; background: var(--akzent); }

/* ---------- Seitenaufbau ---------- */
.gw-inhalt { padding: 24px clamp(16px, 4vw, 48px) 40px; max-width: 1400px; margin: 0 auto; }
.gw-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }

.gw-karte {
  background: var(--flaeche);
  border-radius: var(--radius-karte);
  box-shadow: var(--schatten);
  padding: 24px 28px;
}
.gw-karte + .gw-karte { margin-top: 24px; }
.gw-raster .gw-karte + .gw-karte { margin-top: 0; }
.gw-karte h2 { margin: 0 0 12px; font-size: 22px; font-weight: 900; color: var(--marine); line-height: 1.25; }
.gw-karte h3 { margin: 20px 0 8px; font-size: 17px; font-weight: 700; color: var(--marine); }
.gw-leise { color: var(--text-leise); }
.gw-klein { font-size: 14px; }

/* ---------- Schritte ---------- */
.gw-schritte {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 20px clamp(16px, 4vw, 48px) 0; max-width: 1400px; margin: 0 auto;
}
.gw-schritt {
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 18px 0 8px;
  border-radius: 999px; border: 2px solid transparent;
  background: transparent; color: var(--text-leise);
  font: 700 16px var(--schrift); cursor: pointer;
}
.gw-schritt .gw-nr {
  width: 32px; height: 32px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #b9b2a3; font-size: 15px;
}
.gw-schritt.erledigt { background: var(--flaeche); color: var(--marine); box-shadow: var(--schatten); }
.gw-schritt.erledigt .gw-nr { background: var(--marine); border-color: var(--marine); color: #fff; }
.gw-schritt[aria-current="step"] { background: var(--akzent-toenung); border-color: var(--akzent); color: var(--text); }
.gw-schritt[aria-current="step"] .gw-nr { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-schrift); }
.gw-schritt-trenner { width: 28px; height: 2px; background: #d8cfbd; }
@media (max-width: 640px) {
  .gw-schritt-trenner { display: none; }
  .gw-schritte { gap: 6px; }
}

/* ---------- Schaltflächen ---------- */
.gw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border-radius: var(--radius); border: 1.5px solid var(--marine);
  background: var(--marine); color: #fff;
  font: 700 15px var(--schrift); cursor: pointer; text-decoration: none;
}
.gw-btn:hover { background: var(--marine-hell); border-color: var(--marine-hell); }
.gw-btn.zweit { background: var(--flaeche); color: var(--marine); border-color: var(--eingabe-rand); }
.gw-btn.zweit:hover { border-color: var(--marine); }
.gw-btn.hell { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.55); }
.gw-btn.hell:hover { border-color: #fff; }
.gw-btn.gefahr { background: var(--flaeche); color: var(--fehler-schrift); border-color: var(--fehler); }
.gw-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.gw-zeile { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------- Formulare ---------- */
.gw-feld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gw-feld > label, .gw-label { font-size: 14px; font-weight: 700; color: #3f4656; }
.gw input[type="text"], .gw input[type="number"], .gw input[type="password"],
.gw input[type="email"], .gw input[type="date"], .gw input[type="datetime-local"],
.gw input[type="time"], .gw input[type="search"], .gw input[type="tel"], .gw input[type="url"],
.gw select, .gw textarea {
  min-height: 44px; padding: 8px 12px;
  border: 1.5px solid var(--eingabe-rand); border-radius: var(--radius);
  background: var(--flaeche); color: var(--text); font: 16px var(--schrift);
  width: 100%;
}
.gw textarea { min-height: 96px; resize: vertical; }
.gw input[type="checkbox"], .gw input[type="radio"] { width: 20px; height: 20px; accent-color: var(--marine); }
.gw-wahl { display: flex; gap: 10px; align-items: center; font-size: 16px; cursor: pointer; }
.gw-hinweis { font-size: 14px; color: var(--text-leise); }

/* ---------- Tabellen ---------- */
.gw-tabelle-rahmen { overflow-x: auto; }
.gw-tabelle { width: 100%; border-collapse: collapse; font-size: 15px; }
.gw-tabelle th {
  text-align: left; font-size: 14px; font-weight: 700; color: var(--text-leise);
  padding: 10px 12px; border-bottom: 1.5px solid var(--linie); white-space: nowrap;
}
.gw-tabelle td { padding: 11px 12px; border-bottom: 1px solid var(--linie-fein); vertical-align: top; }
.gw-tabelle td.zahl, .gw-tabelle th.zahl { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Status ---------- */
.gw-meldung {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 18px; border-radius: var(--radius); border: 1.5px solid;
  font-size: 16px; line-height: 1.45; margin: 12px 0;
}
.gw-meldung::before { flex-shrink: 0; font-weight: 900; width: 20px; text-align: center; }
.gw-meldung.ok      { background: var(--ok-toenung);      border-color: var(--ok);      color: var(--ok-schrift); }
.gw-meldung.info    { background: var(--info-toenung);    border-color: var(--info);    color: var(--info-schrift); }
.gw-meldung.warnung { background: var(--warnung-toenung); border-color: var(--warnung); color: var(--warnung-schrift); }
.gw-meldung.fehler  { background: var(--fehler-toenung);  border-color: var(--fehler);  color: var(--fehler-schrift); }
.gw-meldung.offen   { background: var(--offen-toenung);   border-color: var(--offen);   color: var(--offen-schrift); }
.gw-meldung.ok::before { content: "✓"; }
.gw-meldung.info::before { content: "i"; }
.gw-meldung.warnung::before { content: "▲"; }
.gw-meldung.fehler::before { content: "✕"; }
.gw-meldung.offen::before { content: "○"; }

.gw-marke {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.gw-marke.ok      { background: var(--ok-toenung);      color: var(--ok-schrift); }
.gw-marke.info    { background: var(--info-toenung);    color: var(--info-schrift); }
.gw-marke.warnung { background: var(--warnung-toenung); color: var(--warnung-schrift); }
.gw-marke.fehler  { background: var(--fehler-toenung);  color: var(--fehler-schrift); }
.gw-marke.offen   { background: var(--offen-toenung);   color: var(--offen-schrift); }
.gw-marke.ok::before { content: "✓"; }
.gw-marke.info::before { content: "i"; }
.gw-marke.warnung::before { content: "▲"; }
.gw-marke.fehler::before { content: "✕"; }
.gw-marke.offen::before { content: "○"; }

/* ---------- Dialog ---------- */
.gw-dialog {
  border: none; border-radius: var(--radius-karte); padding: 0;
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  box-shadow: 0 12px 40px rgba(0, 38, 71, 0.25); color: var(--text);
  font-family: var(--schrift);
}
.gw-dialog::backdrop { background: rgba(0, 38, 71, 0.45); }
.gw-dialog-kopf { background: var(--marine); color: #fff; padding: 18px 24px; }
.gw-dialog-kopf h2 { margin: 0; font-size: 20px; font-weight: 900; }
.gw-dialog-inhalt { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.gw-dialog-fuss { padding: 16px 24px; border-top: 1px solid var(--linie); display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.gw-farbwahl { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.gw-farbwahl button {
  width: 44px; height: 44px; border-radius: 999px; cursor: pointer;
  border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--eingabe-rand);
}
.gw-farbwahl button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--marine); }
.gw-logo-vorschau {
  min-height: 72px; border: 1.5px dashed var(--eingabe-rand); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; padding: 10px; background: var(--papier);
}
.gw-logo-vorschau img { max-height: 64px; max-width: 100%; }

/* ---------- Druckkopf/-fuß (nur im Druck sichtbar) ---------- */
.gw-druckkopf, .gw-druckfuss { display: none; }

@media print {
  @page { size: A4; margin: 14mm 16mm 16mm; }
  body.gw { background: #fff; font-size: 11pt; }
  .gw-nur-bildschirm, .gw-kopf, .gw-streifen, .gw-schritte, .gw-dialog { display: none !important; }
  .gw-inhalt { padding: 0; max-width: none; }
  .gw-karte { box-shadow: none; padding: 0; border-radius: 0; }
  .gw-karte + .gw-karte { margin-top: 18pt; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .gw-druckkopf {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding-bottom: 8pt; margin-bottom: 14pt; border-bottom: 3pt solid var(--akzent);
  }
  .gw-druckkopf img { max-height: 16mm; max-width: 70mm; }
  .gw-druckkopf .gw-druck-schule { text-align: right; font-size: 9.5pt; color: #333; }
  .gw-druckfuss {
    display: flex; justify-content: space-between; margin-top: 18pt; padding-top: 6pt;
    border-top: 1px solid #999; font-size: 8.5pt; color: #444;
  }
  .gw-tabelle { font-size: 10pt; }
  .gw-tabelle th { color: #fff; background: var(--marine); border-bottom: none; }
  .gw-tabelle tr { break-inside: avoid; }
  .gw-seitenumbruch { break-before: page; }
  h1, h2, h3 { break-after: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
