/* =========================================================================
   EHBS Knecht – Web-Designsystem (Erste Hilfe & Brandschutz)
   Einzige Quelle für Farben, Schrift und Komponenten. Keine neuen Hex-Werte
   hinzufügen, immer die Tokens verwenden.
   Farbwerte identisch mit ehbs-knecht-grafik (references/farbpalette.md).
   Marke umschalten: <html lang="de" data-marke="ehbs-ingenieure"> bzw. "dba".
   Ohne Attribut gilt EHBS Knecht (Standard).
   ========================================================================= */

:root {
  /* Markenfarben (offizielles Farb-PDF) */
  --ehbs-blue:       #232e6a;  /* EHBS Knecht Leitfarbe – PANTONE Dark Blue C */
  --ehbs-blue-dark:  #19214d;  /* Hover auf Blau (abgedunkelt) */
  --ehbs-red:        #ac1410;  /* Akzent, Alarm, Anzeigen – PANTONE 207 C */
  --ehbs-red-dark:   #870f0c;  /* Hover auf Rot */
  --ehbs-yellow:     #f7a941;  /* Fläche/Badge – nie Text auf Weiß */
  --ehbs-orange:     #eb5c2e;  /* Fläche/Badge – nie Text auf Weiß */
  --ehbs-grey:       #706f6f;  /* Tabellenkopf, Leitfarbe EHBS Ingenieure */
  --ehbs-anthracite: #575756;  /* Rahmen, dunkle Flächen, Leitfarbe DBA */
  --ehbs-dark:       #2B2B2B;  /* Hover auf Grau/Anthrazit */

  /* Leitfarbe der aktiven Marke – Komponenten nutzen NUR diese Tokens */
  --ehbs-primary:      var(--ehbs-blue);
  --ehbs-primary-dark: var(--ehbs-blue-dark);
  --ehbs-primary-tint: #e9ebf3;  /* sehr helles Blau für Infoflächen */

  /* Neutrale Flächen (Nebentöne wie im Grafik- und Word-Skill) */
  --ehbs-white:      #ffffff;
  --ehbs-bg-soft:    #F2F2F2;  /* Abschnittshintergrund, Zebra */
  --ehbs-bg-light:   #EDEDED;
  --ehbs-line:       #D9D9D9;
  --ehbs-tint-hinweis: #FDF6E9;  /* Fläche gelbe Hinweisbox */
  --ehbs-tint-warnung: #F7E7E6;  /* Fläche rote Warnbox */

  /* Text */
  --ehbs-text:         #000000;
  --ehbs-text-sek:     #595959;  /* nur Nebentext (Bildunterschrift, Metazeile), 7:1 auf Weiß */
  --ehbs-text-on-dark: #ffffff;

  /* Fokusrahmen: auf hellem Grund Leitfarbe (Gelb auf Weiß hätte nur 2:1) */
  --ehbs-focus: var(--ehbs-primary);

  /* Fachliche Ampel – NICHT Markenfarben */
  --ampel-green:  #2E7D32;
  --ampel-yellow: #E3A615;
  --ampel-red:    #C0392B;
  --ampel-dark:   #2B2B2B;

  /* Typografie */
  --ehbs-font: Arial, "Liberation Sans", Helvetica, sans-serif;
  --fs-small: 0.875rem;
  --fs-base:  1rem;
  --fs-lg:    1.25rem;
  --fs-h3:    1.25rem;
  --fs-h2:    clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --fs-h1:    clamp(1.875rem, 1.4rem + 2vw, 2.75rem);

  /* Raster */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-6: 1.5rem;  --space-8: 2rem;   --space-12: 3rem;   --space-16: 4rem;
  --radius: 4px;
  --container: 1180px;
  --shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
}

/* ---------- Markenschalter ---------- */
/* EHBS Ingenieure: Kundenangebote und Angebotsseiten (Ansage Andreas Sauer, 14.09.2026) */
[data-marke="ehbs-ingenieure"] {
  --ehbs-primary:      var(--ehbs-grey);
  --ehbs-primary-dark: var(--ehbs-anthracite);
  --ehbs-primary-tint: var(--ehbs-bg-light);
}
/* Deutsche Brandschutz Akademie: ruht seit 14.09.2026, nur auf ausdrückliche Ansage */
[data-marke="dba"] {
  --ehbs-primary:      var(--ehbs-anthracite);
  --ehbs-primary-dark: var(--ehbs-dark);
  --ehbs-primary-tint: var(--ehbs-bg-light);
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--ehbs-font);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--ehbs-text);
  background: var(--ehbs-white);
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 var(--space-4); color: var(--ehbs-text); }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p  { margin: 0 0 var(--space-4); }
a  { color: var(--ehbs-primary); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--ehbs-red); }
:focus-visible { outline: 3px solid var(--ehbs-focus); outline-offset: 2px; }
/* Auf dunklem Grund Gelb (10,7:1 gegen Blau) */
.ehbs-topbar, .ehbs-hero, .ehbs-cta-band, .ehbs-footer, .ehbs-sidenav { --ehbs-focus: var(--ehbs-yellow); }

.ehbs-container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-4); }
.ehbs-section { padding: var(--space-12) 0; }
.ehbs-section--soft { background: var(--ehbs-bg-soft); }
.ehbs-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.ehbs-skip {
  position: absolute; left: -9999px; top: 0; background: var(--ehbs-primary);
  color: var(--ehbs-text-on-dark); padding: var(--space-2) var(--space-4); z-index: 100;
}
.ehbs-skip:focus { left: var(--space-4); }
.ehbs-meta { font-size: var(--fs-small); color: var(--ehbs-text-sek); }

/* ---------- Überschrift mit roter Akzentlinie ---------- */
.ehbs-heading { position: relative; padding-bottom: var(--space-3); margin-bottom: var(--space-6); }
.ehbs-heading::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 64px; height: 4px; background: var(--ehbs-red);
}
.ehbs-heading--center { text-align: center; }
.ehbs-heading--center::after { left: 50%; transform: translateX(-50%); }

/* ---------- Topbar + Header ---------- */
.ehbs-topbar { background: var(--ehbs-primary); color: var(--ehbs-text-on-dark); font-size: var(--fs-small); }
.ehbs-topbar .ehbs-container { display: flex; justify-content: flex-end; gap: var(--space-6); padding-top: var(--space-2); padding-bottom: var(--space-2); flex-wrap: wrap; }
.ehbs-topbar a { color: var(--ehbs-text-on-dark); text-decoration: none; }
.ehbs-topbar a:hover { text-decoration: underline; color: var(--ehbs-text-on-dark); }

.ehbs-header { background: var(--ehbs-white); border-bottom: 1px solid var(--ehbs-line); position: sticky; top: 0; z-index: 50; }
.ehbs-header .ehbs-container { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 80px; }
.ehbs-logo img { height: 56px; width: auto; }
.ehbs-nav ul { list-style: none; display: flex; gap: var(--space-6); margin: 0; padding: 0; align-items: center; }
.ehbs-nav a { color: var(--ehbs-text); text-decoration: none; font-weight: 700; padding: var(--space-3) 0; display: inline-block; border-bottom: 3px solid transparent; }
.ehbs-nav a:hover, .ehbs-nav a[aria-current="page"] { color: var(--ehbs-primary); border-bottom-color: var(--ehbs-red); }
.ehbs-nav a.ehbs-btn, .ehbs-nav a.ehbs-btn:hover { color: var(--ehbs-text-on-dark); border: 2px solid transparent; padding: 0 var(--space-4); display: inline-flex; }
.ehbs-nav a.ehbs-btn--primary:hover { background: var(--ehbs-primary-dark); }
.ehbs-nav a.ehbs-btn--cta:hover { background: var(--ehbs-red-dark); }
.ehbs-nav-toggle { display: none; background: none; border: 2px solid var(--ehbs-primary); color: var(--ehbs-primary); border-radius: var(--radius); min-height: 44px; padding: 0 var(--space-3); font: inherit; font-weight: 700; cursor: pointer; }

@media (max-width: 860px) {
  .ehbs-nav-toggle { display: inline-block; }
  .ehbs-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--ehbs-white); border-bottom: 1px solid var(--ehbs-line); }
  .ehbs-nav.is-open { display: block; }
  .ehbs-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: var(--space-2) var(--space-4); }
  .ehbs-nav a { display: block; padding: var(--space-3) 0; border-bottom: 1px solid var(--ehbs-line); }
  .ehbs-nav a.ehbs-btn { display: flex; margin: var(--space-3) 0; }
  .ehbs-logo img { height: 44px; }
}

/* ---------- Buttons ---------- */
.ehbs-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-6); border-radius: var(--radius);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
/* Standard-Hauptaktion: Leitfarbe */
.ehbs-btn--primary { background: var(--ehbs-primary); color: var(--ehbs-text-on-dark); }
.ehbs-btn--primary:hover { background: var(--ehbs-primary-dark); color: var(--ehbs-text-on-dark); }
/* Rot NUR auf Landingpages/Anzeigen (Domäne D) und bei Alarmthemen */
.ehbs-btn--cta { background: var(--ehbs-red); color: var(--ehbs-text-on-dark); }
.ehbs-btn--cta:hover { background: var(--ehbs-red-dark); color: var(--ehbs-text-on-dark); }
.ehbs-btn--outline { background: transparent; color: var(--ehbs-primary); border-color: var(--ehbs-primary); }
.ehbs-btn--outline:hover { background: var(--ehbs-primary); color: var(--ehbs-text-on-dark); }
/* Auf dunklem Grund: Weiß als Hauptaktion, Rahmen als Nebenaktion */
.ehbs-btn--on-dark { background: var(--ehbs-white); color: var(--ehbs-primary); }
.ehbs-btn--on-dark:hover { background: var(--ehbs-bg-light); color: var(--ehbs-primary); }
.ehbs-btn--ghost-dark { background: transparent; color: var(--ehbs-text-on-dark); border-color: var(--ehbs-text-on-dark); }
.ehbs-btn--ghost-dark:hover { background: var(--ehbs-white); color: var(--ehbs-primary); }
.ehbs-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Hero ---------- */
.ehbs-hero { background: var(--ehbs-primary); color: var(--ehbs-text-on-dark); padding: var(--space-16) 0; position: relative; overflow: hidden; }
.ehbs-hero::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--ehbs-red); }
.ehbs-hero h1, .ehbs-hero p { color: var(--ehbs-text-on-dark); }
.ehbs-hero__lead { font-size: var(--fs-lg); max-width: 40rem; }
.ehbs-hero__actions { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-6); }
.ehbs-hero .ehbs-heading::after { background: var(--ehbs-yellow); } /* auf Blau Gelb statt Rot (Kontrast) */

/* ---------- Raster & Karten ---------- */
.ehbs-grid { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.ehbs-card {
  background: var(--ehbs-white); border: 1px solid var(--ehbs-line); border-top: 4px solid var(--ehbs-primary);
  border-radius: var(--radius); padding: var(--space-6); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.ehbs-card--accent { border-top-color: var(--ehbs-red); }
.ehbs-card h3 { margin-bottom: var(--space-2); }
.ehbs-card__icon { width: 48px; height: 48px; border-radius: 50%; background: var(--ehbs-primary); color: var(--ehbs-text-on-dark); display: grid; place-items: center; margin-bottom: var(--space-4); }
.ehbs-card__footer { margin-top: auto; padding-top: var(--space-4); }
.ehbs-card__meta { font-size: var(--fs-small); }

/* ---------- Badges ---------- */
.ehbs-badge { display: inline-block; font-size: var(--fs-small); font-weight: 700; padding: 2px var(--space-2); border-radius: var(--radius); background: var(--ehbs-yellow); color: var(--ehbs-text); }
.ehbs-badge--orange { background: var(--ehbs-orange); color: var(--ehbs-text); }
.ehbs-badge--blue { background: var(--ehbs-primary); color: var(--ehbs-text-on-dark); }

/* ---------- Status (Ampel) – immer mit Text ---------- */
.ehbs-status { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 700; color: var(--ehbs-text); }
.ehbs-status::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: currentColor; flex: none; }
.ehbs-status--ok::before   { background: var(--ampel-green); }
.ehbs-status--mid::before  { background: var(--ampel-yellow); }
.ehbs-status--bad::before  { background: var(--ampel-red); }
.ehbs-status--none::before { background: var(--ampel-dark); }

/* ---------- Tabelle ---------- */
.ehbs-table-wrap { overflow-x: auto; border: 1px solid var(--ehbs-line); border-radius: var(--radius); }
.ehbs-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.ehbs-table th { background: var(--ehbs-grey); color: var(--ehbs-text-on-dark); text-align: left; font-weight: 700; padding: var(--space-3) var(--space-4); }
.ehbs-table td { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--ehbs-line); vertical-align: top; }
.ehbs-table tbody tr:nth-child(even) td { background: var(--ehbs-bg-soft); }
.ehbs-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Hinweisboxen ---------- */
.ehbs-box { border-left: 6px solid var(--ehbs-primary); background: var(--ehbs-primary-tint); padding: var(--space-4) var(--space-6); border-radius: 0 var(--radius) var(--radius) 0; margin: var(--space-6) 0; }
.ehbs-box__title { font-weight: 700; margin-bottom: var(--space-1); }
.ehbs-box > :last-child { margin-bottom: 0; }
.ehbs-box--hinweis { border-left-color: var(--ehbs-yellow); background: var(--ehbs-tint-hinweis); }
.ehbs-box--warnung { border-left-color: var(--ehbs-red); background: var(--ehbs-tint-warnung); }

/* ---------- KPI-Kacheln ---------- */
.ehbs-kpis { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.ehbs-kpi { background: var(--ehbs-white); border: 1px solid var(--ehbs-line); border-radius: var(--radius); padding: var(--space-6); border-bottom: 4px solid var(--ehbs-primary); }
.ehbs-kpi__value { font-size: 2.25rem; font-weight: 700; line-height: 1.1; color: var(--ehbs-primary); font-variant-numeric: tabular-nums; }
.ehbs-kpi__label { margin-top: var(--space-2); }

/* ---------- Formulare ---------- */
.ehbs-form { display: grid; gap: var(--space-4); max-width: 640px; }
.ehbs-form__row { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.ehbs-field label { display: block; font-weight: 700; margin-bottom: var(--space-1); }
.ehbs-field input, .ehbs-field select, .ehbs-field textarea {
  width: 100%; min-height: 44px; padding: var(--space-2) var(--space-3);
  font: inherit; color: var(--ehbs-text); background: var(--ehbs-white);
  border: 1px solid var(--ehbs-anthracite); border-radius: var(--radius);
}
.ehbs-field textarea { min-height: 120px; resize: vertical; }
.ehbs-field input:focus, .ehbs-field select:focus, .ehbs-field textarea:focus { outline: 3px solid var(--ehbs-focus); outline-offset: 1px; border-color: var(--ehbs-primary); }
.ehbs-field__hint { font-size: var(--fs-small); margin-top: var(--space-1); }
.ehbs-field--error input, .ehbs-field--error select, .ehbs-field--error textarea { border: 2px solid var(--ampel-red); }
.ehbs-field__error { color: var(--ampel-red); font-size: var(--fs-small); font-weight: 700; margin-top: var(--space-1); }
.ehbs-check { display: flex; gap: var(--space-2); align-items: flex-start; }
.ehbs-check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--ehbs-primary); }

/* ---------- CTA-Band ---------- */
/* Standard in Leitfarbe. Rote Variante nur für Landingpages/Anzeigen und Alarmthemen. */
.ehbs-cta-band { background: var(--ehbs-primary); color: var(--ehbs-text-on-dark); padding: var(--space-8) 0; border-top: 4px solid var(--ehbs-red); }
.ehbs-cta-band--rot { background: var(--ehbs-red); border-top-color: var(--ehbs-red-dark); }
.ehbs-cta-band .ehbs-container { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.ehbs-cta-band h2, .ehbs-cta-band p { color: var(--ehbs-text-on-dark); margin: 0; }

/* ---------- Seitliche Navigation (Web-App) ---------- */
.ehbs-sidenav { background: var(--ehbs-primary); color: var(--ehbs-text-on-dark); padding: var(--space-4) 0; }
.ehbs-sidenav a { display: block; color: var(--ehbs-text-on-dark); text-decoration: none; padding: var(--space-3) var(--space-4); border-left: 4px solid transparent; min-height: 44px; }
.ehbs-sidenav a:hover { background: var(--ehbs-primary-dark); color: var(--ehbs-text-on-dark); }
.ehbs-sidenav a[aria-current="page"] { border-left-color: var(--ehbs-red); font-weight: 700; }

/* ---------- Footer ---------- */
.ehbs-footer { background: var(--ehbs-primary); color: var(--ehbs-text-on-dark); padding: var(--space-12) 0 var(--space-6); font-size: var(--fs-small); }
.ehbs-footer h2, .ehbs-footer h3 { color: var(--ehbs-text-on-dark); font-size: var(--fs-base); }
.ehbs-footer a { color: var(--ehbs-text-on-dark); }
.ehbs-footer a:hover { color: var(--ehbs-yellow); }
.ehbs-footer__grid { display: grid; gap: var(--space-8); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ehbs-footer ul { list-style: none; margin: 0; padding: 0; }
.ehbs-footer li { margin-bottom: var(--space-2); }
.ehbs-footer__legal { border-top: 1px solid rgba(255,255,255,.25); margin-top: var(--space-8); padding-top: var(--space-4); display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.ehbs-footer__legal ul { display: flex; gap: var(--space-6); flex-wrap: wrap; }

/* ---------- Platzhalter ---------- */
.ehbs-placeholder { background: var(--ehbs-bg-light); border: 2px dashed var(--ehbs-grey); display: grid; place-items: center; min-height: 200px; text-align: center; padding: var(--space-4); border-radius: var(--radius); font-size: var(--fs-small); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .ehbs-topbar, .ehbs-nav, .ehbs-nav-toggle, .ehbs-cta-band { display: none; }
  .ehbs-header { position: static; }
  .ehbs-hero, .ehbs-footer { background: none; color: var(--ehbs-text); }
  .ehbs-hero h1, .ehbs-hero p, .ehbs-footer a, .ehbs-footer h2, .ehbs-footer h3 { color: var(--ehbs-text); }
}
