:root{
  --header-h: 92px;
  --bg: #ffffff;
  --text: #000000;
  --c-blue: #1b4fff;
  --c-green: #10b981;
  --c-neutral: #111111;
}

/* ── Header: Diagonal weiß → Navy (analog Email-Header) ─────────── */
.site-header{
  position:fixed; left:0; right:0; top:0;
  height:var(--header-h);
  /* Navy-Gradient auf rechter Seite: etwas heller nah an der Diagonale */
  background: linear-gradient(to right, #1c3a6e 0%, #0B1F3A 40%);
  z-index:30;
  border-bottom: 3px solid #FFD54A;
}

/* Weißer Bereich links: exakte Diagonale via clip-path
   Oben: Kante bei 215px | Unten: Kante bei 315px (Versatz = Header-Höhe 92px * ~1.09) */
.site-header::before{
  content:'';
  position:absolute;
  inset:0;
  background: #ffffff;
  clip-path: polygon(0 0, 215px 0, 315px 100%, 0 100%);
  z-index:0;
  pointer-events:none;
}

/* Glanzlinie an der Diagonale (analog ja_make_header_bg Gloss) */
.site-header::after{
  content:'';
  position:absolute;
  inset:0;
  background: rgba(255,255,255,.82);
  clip-path: polygon(208px 0, 228px 0, 328px 100%, 308px 100%);
  z-index:1;
  pointer-events:none;
}

.header-inner{
  position: relative;
  z-index: 31;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding: 0 22px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

.brand{display:flex;align-items:center;height:100%;text-decoration:none;color:inherit;flex-shrink:0;}
.logo{height:52px;width:auto;max-width:180px;display:block;transform:translateY(3px)}

/* Desktop Nav */
.nav{
  display:flex;
  gap:10px;
  flex-wrap:nowrap;
  justify-content:flex-end;
  align-items:center;
}

/* Gruppierung: Desktop ohne Layout-Änderung */
.nav-section{display:contents;}
.nav-section-title{display:none;}

/* Nav-Buttons auf dunklem Header */
.nav-btn{
  text-decoration:none;
  color: rgba(255,255,255,.88);
  font-size:13px;
  padding:8px 10px;
  border-radius:999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.05);
  white-space:nowrap;
  position:relative;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.nav-btn:hover{
  background: rgba(255,255,255,.10);
  transform: translateY(-1px);
}

/* Farbliche Akzente auf dunklem Grund */
.nav-btn[data-group="neutral"]:hover{
  background: rgba(255,255,255,.10);
  box-shadow: 0 0 0 3px rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.28);
}
.nav-btn[data-group="blue"]:hover{
  background: rgba(27,79,255,.22);
  box-shadow: 0 0 0 3px rgba(27,79,255,.28);
  border-color: rgba(27,79,255,.50);
}
.nav-btn[data-group="green"]:hover{
  background: rgba(16,185,129,.20);
  box-shadow: 0 0 0 3px rgba(16,185,129,.25);
  border-color: rgba(16,185,129,.45);
}

/* Tastatur-Fokus */
.nav-btn:focus-visible{
  outline:none;
  box-shadow: 0 0 0 3px rgba(255,213,74,.40);
}

/* ── Aktive Seite ─────────────────────────────────────────────── */
.nav-btn.is-active{
  font-weight: 700;
  color: #fff;
}
.nav-btn.is-active[data-group="neutral"]{
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.55);
  box-shadow: 0 0 0 2px rgba(255,255,255,.18), inset 0 1px 0 rgba(255,255,255,.15);
}
.nav-btn.is-active[data-group="blue"]{
  background: rgba(27,79,255,.45);
  border-color: rgba(27,79,255,.85);
  box-shadow: 0 0 0 2px rgba(27,79,255,.28), inset 0 1px 0 rgba(255,255,255,.12);
}
.nav-btn.is-active[data-group="green"]{
  background: rgba(16,185,129,.38);
  border-color: rgba(16,185,129,.85);
  box-shadow: 0 0 0 2px rgba(16,185,129,.24), inset 0 1px 0 rgba(255,255,255,.12);
}

/* Header appear
   WICHTIG: keine transform auf .site-header selbst */
.site-header.is-hidden{
  opacity:0;
  pointer-events:none;
}
.site-header.is-visible{
  opacity:1;
  pointer-events:auto;
  transition: opacity 420ms ease;
}

/* Animation nur auf innerem Container */
.header-inner{
  transform: translateY(-10px);
  transition: transform 420ms ease;
}
.site-header.is-visible .header-inner{
  transform: translateY(0);
}

/* ── Burger ──────────────────────────────────────────────────────── */
.nav-toggle{
  display:none;
  width:44px; height:44px;
  border-radius:12px;
  border: 1.5px solid #FFD54A;
  background: rgba(11,31,58,.85);
  cursor:pointer;
  position:relative;
  z-index: 32;
}
.nav-toggle span{
  position:absolute; left:11px; right:11px;
  height:2px;
  background: #FFD54A;
  border-radius:2px;
}
.nav-toggle span:nth-child(1){ top:14px; }
.nav-toggle span:nth-child(2){ top:21px; }
.nav-toggle span:nth-child(3){ top:28px; }

.nav-toggle:hover{ background: #0B1F3A; border-color: rgba(255,213,74,.75); }

/* Burger zu X animieren wenn Menü offen */
.site-header.nav-open .nav-toggle span:nth-child(1){ top:21px; transform: rotate(45deg); }
.site-header.nav-open .nav-toggle span:nth-child(2){ opacity:0; }
.site-header.nav-open .nav-toggle span:nth-child(3){ top:21px; transform: rotate(-45deg); }
.site-header.nav-open .nav-toggle span{ transition: transform .18s ease, top .18s ease, opacity .18s ease; }


/* ── Burger ab 1390px ────────────────────────────────────────────
   Surface Pro 11: 2880×1920 @ 200% = 1440px CSS → Burger bei ≤1390px */
@media (max-width: 1390px){
  .header-inner{ padding: 0 14px; gap:12px; }
  .logo{ height:52px; width:auto; max-width:180px; transform:translateY(3px); }

  /* Transform deaktivieren damit position:fixed im Nav korrekt funktioniert */
  .header-inner{
    transform: none !important;
    transition: none !important;
  }

  .nav-toggle{ display:block; }

  /* ── Dropdown: weißes Panel mit echten Buttons ── */
  .nav{
    position: fixed;
    top: var(--header-h);
    right: 12px;
    left: auto;
    width: max-content;
    min-width: 200px;
    max-width: calc(100vw - 24px);
    background: #ffffff;
    border: 1px solid rgba(11,31,58,.12);
    border-top: 3px solid #FFD54A;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 16px 48px rgba(11,31,58,.22);
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
    max-height: calc(100svh - var(--header-h) - 12px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    transform: translateY(-6px) scale(.98);
    opacity: 0;
    pointer-events: none;
    z-index: 31;
  }

  .nav-section{ display: contents; }
  .nav-section-title{ display: none; }

  .site-header.nav-open .nav{
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  /* Echte Buttons im Dropdown */
  .nav-btn{
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    padding: 11px 16px;
    border-radius: 10px;
    border: 1px solid rgba(27,79,255,.20);
    background: rgba(27,79,255,.05);
    color: #1b4fff;
    box-shadow: none;
    white-space: nowrap;
    text-align: left;
    transition: background .12s, border-color .12s;
    transform: none;
  }
  .nav-btn:hover, .nav-btn:active{
    background: rgba(27,79,255,.12);
    border-color: rgba(27,79,255,.35);
    color: #1b4fff;
    transform: none;
    box-shadow: none;
  }
  .nav-btn[data-group="blue"],
  .nav-btn[data-group="neutral"]{
    color: #1b4fff;
    border-color: rgba(27,79,255,.25);
    background: rgba(27,79,255,.07);
    box-shadow: none;
  }
  .nav-btn[data-group="blue"]:hover,
  .nav-btn[data-group="neutral"]:hover{
    background: rgba(27,79,255,.14);
    border-color: rgba(27,79,255,.40);
    box-shadow: none;
  }

  /* Grüne Gruppe (Fachkräfte etc.) klar erkennbar */
  .nav-btn[data-group="green"]{
    color: #047857;
    border-color: rgba(16,185,129,.35);
    background: rgba(16,185,129,.10);
    box-shadow: none;
  }
  .nav-btn[data-group="green"]:hover,
  .nav-btn[data-group="green"]:active{
    background: rgba(16,185,129,.18);
    border-color: rgba(16,185,129,.50);
    color: #047857;
    box-shadow: none;
  }

  /* Aktiv im Mobile-Dropdown */
  .nav-btn.is-active,
  .nav-btn.is-active[data-group="blue"],
  .nav-btn.is-active[data-group="neutral"]{
    background: rgba(27,79,255,.12);
    border-color: rgba(27,79,255,.45);
    color: #1b4fff;
    font-weight: 800;
    box-shadow: inset 3px 0 0 #1b4fff;
  }
  .nav-btn.is-active[data-group="green"]{
    background: rgba(16,185,129,.15);
    border-color: rgba(16,185,129,.55);
    color: #047857;
    font-weight: 800;
    box-shadow: inset 3px 0 0 #10b981;
  }
}

/* Phones: volle Breite + sicher scrollbar */
@media (max-width: 768px){
  .nav{
    right: 0;
    left: 0;
    width: auto;
    border-radius: 0;
    border-left: none;
    border-right: none;
    max-height: calc(100svh - var(--header-h) - var(--footer-h) - env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
    transform: translateY(-6px) scale(.98);
  }
  .site-header.nav-open .nav{
    transform: translateY(0) scale(1);
  }
}


/* Blind links (Platzhalter) */
.is-blind{
  opacity:.95;
  cursor:pointer;
}
.is-blind:active{
  transform:none;
}

/* ── Notfall Burst Button ─────────────────────────────────────── */
.nav-notfall{
  position: relative;
  width: 100px;
  height: 100px;
  background: url('/images/button.png') center/contain no-repeat;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 14px;
  top: 10px;
  margin-left: -18px;
  margin-right: -18px;
  z-index: 5;
  flex-shrink: 0;
  transform-origin: center center;
  animation: notfall-pulse 2s ease-in-out infinite;
  text-shadow: 0 1px 3px rgba(0,0,0,.50);
}

.nav-notfall:hover{
  animation: none;
  transform: scale(1.08);
  filter: brightness(.88);
}
.nav-notfall:focus-visible{
  outline: 3px solid #fbbf24;
  outline-offset: 6px;
}

@keyframes notfall-pulse{
  0%,100%{ transform: scale(1);    }
  50%     { transform: scale(1.08); }
}

/* Mobile: Notfall als einfacher roter Listeneintrag */
@media (max-width: 1390px){
  .nav-notfall{
    width: 100%;
    height: auto;
    top: 0;
    margin: 0;
    border-radius: 10px;
    border: 1px solid rgba(185,28,28,.35);
    background: #dc2626;
    color: #fff;
    font-size: 13.5px;
    font-weight: 700;
    padding: 11px 16px;
    text-align: left;
    animation: notfall-pulse-flat 2s ease-in-out infinite;
    box-shadow: none;
    text-shadow: none;
    filter: none;
  }
  .nav-notfall br{
    display: none;
  }
  .nav-notfall:hover, .nav-notfall:active{
    background: #b91c1c;
    transform: none;
    filter: none;
    box-shadow: none;
  }
  @keyframes notfall-pulse-flat{
    0%,100%{ opacity:1; }
    50%     { opacity:.88; }
  }
}

/* ── Notfall Modal ────────────────────────────────────────────── */
.notfall-modal{
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notfall-modal[hidden]{ display: none; }

.notfall-modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.52);
  backdrop-filter: blur(3px);
}

.notfall-modal__box{
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 22px;
  padding: 32px 28px 28px;
  width: min(90vw, 360px);
  box-shadow: 0 24px 80px rgba(0,0,0,.28);
  text-align: center;
  animation: notfall-modal-in .22s ease;
}

@keyframes notfall-modal-in{
  from{ transform: scale(.92) translateY(10px); opacity:0; }
  to  { transform: scale(1)   translateY(0);    opacity:1; }
}

.notfall-modal__close{
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.04);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
}
.notfall-modal__close:hover{ background: rgba(0,0,0,.08); }

.notfall-modal__icon{
  font-size: 32px;
  margin-bottom: 10px;
}

.notfall-modal__title{
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #0b0f19;
}

.notfall-modal__sub{
  margin: 0 0 22px;
  font-size: 14px;
  color: rgba(11,15,25,.62);
  line-height: 1.5;
}

.notfall-modal__actions{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notfall-modal__btn{
  display: block;
  padding: 13px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.03);
  color: #0b0f19;
  transition: background .15s, box-shadow .15s;
}
.notfall-modal__btn:hover{
  background: rgba(0,0,0,.07);
}
.notfall-modal__btn--primary{
  background: #dc2626;
  border-color: #b91c1c;
  color: #fff;
}
.notfall-modal__btn--primary:hover{
  background: #b91c1c;
  box-shadow: 0 4px 14px rgba(220,38,38,.35);
}
