/* ==========================================================================
   Modern UI – Global Styles (Light/Dark, Fluid Type, Touch-first)
   ==========================================================================
   - Barrierearm: klare Focus-Ringe, ausreichender Kontrast
   - Touchfreundlich: große Ziele, 44px min-height
   - Responsiv: clamp(...) für Typo, Grid passt sich an
   - Kompatibel zu deinen Klassen: .toolbar, .btn, .button, .tile, .aufklaerung-grid, .header, .container
   ========================================================================== */

/* ---------------------------
   Design Tokens (Light Mode)
   --------------------------- */
:root{
  /* Base palette */
  --bg:            #f7f8fb;
  --surface:       #ffffff;
  --surface-2:     #f3f4f6;
  --ink:           #0f172a;   /* slate-900 */
  --ink-muted:     #475569;   /* slate-600 */
  --border:        #e5e7eb;   /* gray-200 */

  /* Brand */
  --brand:         #0b61a4;
  --brand-ink:     #ffffff;
  --brand-soft:    color-mix(in srgb, var(--brand) 12%, white);

  /* Accents/States */
  --ok:            #10b981;   /* green-500 */
  --warn:          #f59e0b;   /* amber-500 */
  --danger:        #ef4444;   /* red-500 */

  /* Radii & Shadows */
  --radius-xs:     10px;
  --radius-sm:     14px;
  --radius-md:     18px;
  --shadow-sm:     0 1px 2px rgba(0,0,0,.06), 0 4px 10px rgba(0,0,0,.04);
  --shadow-md:     0 6px 20px rgba(15,23,42,.08);

  /* Layout */
  --content-w:     920px;

  /* Typo scale (fluid) */
  --fs-sm: clamp(.92rem, .86rem + .2vw, 1rem);
  --fs-md: clamp(1rem, .95rem + .35vw, 1.15rem);
  --fs-lg: clamp(1.05rem, .95rem + .6vw, 1.35rem);
  --fs-xl: clamp(1.25rem, 1.05rem + 1vw, 1.8rem);

  /* Backdrop blur (for glass toolbar) */
  --blur:          12px;
}

/* ---------------------------
   Dark Mode Tokens
   --------------------------- */
@media (prefers-color-scheme: dark){
  :root{
    --bg:        #0b1020;
    --surface:   #0f1528;
    --surface-2: #0b1322;
    --ink:       #e5e9f5;
    --ink-muted: #a7b0c4;
    --border:    #1f2942;

    --brand:     #58a6ff;
    --brand-ink: #061221;
    --brand-soft: color-mix(in srgb, var(--brand) 18%, black);

    --shadow-sm: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.25);
    --shadow-md: 0 14px 34px rgba(0,0,0,.35);
  }
}

/* ---------------------------
   Reset & Base
   --------------------------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 100vh;
}

img{ display:block; max-width:100%; height:auto; }

/* Accessible focus */
:focus-visible{
  outline: 3px solid color-mix(in srgb, var(--brand) 55%, white);
  outline-offset: 2px;
}

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

/* Utility: screen-reader only */
.sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;
}

/* ---------------------------
   Toolbar (glass, sticky)
   --------------------------- */
.toolbar{
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px clamp(12px, 4vw, 24px);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(var(--blur));
  border-bottom: 1px solid var(--border);
}
.btns{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.status{ color: var(--ink-muted); font-size: var(--fs-sm); }

/* ---------------------------
   Header (Logo + Titel, zentriert)
   --------------------------- */
.header{
  display:flex;
  align-items:center;
  justify-content:center; /* mittig */
  gap: clamp(10px, 2vw, 16px);
  padding: clamp(12px, 3vw, 20px) clamp(12px, 4vw, 24px);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header img{ height: clamp(28px, 5vw, 44px); width:auto; }
.header h1{
  margin: 0;
  text-align: center;
  font-size: var(--fs-xl);
  letter-spacing: .2px;
  color: var(--ink);
}

/* ---------------------------
   Main Container Card
   --------------------------- */
.container{
  width: min(100%, var(--content-w));
  margin: clamp(12px, 3vw, 26px) auto;
  padding: clamp(14px, 3.2vw, 22px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

h2, h3{
  margin: .25rem 0 1rem 0;
  text-align: center;
  color: var(--ink);
  font-size: var(--fs-lg);
}
p{ color: var(--ink-muted); font-size: var(--fs-sm); }

/* ---------------------------
   Inputs (baseline styling)
   --------------------------- */
input, select, textarea{
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: var(--radius-xs);
  font-size: var(--fs-sm);
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
input:focus, select:focus, textarea:focus{
  background: var(--surface);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
}

/* ---------------------------
   Buttons (toolbar & generic)
   --------------------------- */
.btn, .toolbar .btns button, .toolbar .inline-form button{
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: .9rem 1.1rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  font-weight: 650;
  font-size: clamp(.98rem, .84rem + .5vw, 1.1rem);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  box-shadow: var(--shadow-sm);
  transition: transform .06s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
  white-space: normal; text-wrap: balance; overflow-wrap: anywhere; hyphens: auto;
}
.btn:hover, .toolbar .btns button:hover, .toolbar .inline-form button:hover{
  background: color-mix(in srgb, var(--surface) 80%, var(--brand) 4%);
}
.btn:active, .toolbar .btns button:active, .toolbar .inline-form button:active{
  transform: translateY(1px);
}

/* Primary variant */
.btn.primary, .toolbar .btns .primary, .toolbar .inline-form .primary{
  border-color: color-mix(in srgb, var(--brand) 30%, var(--border));
  background: var(--brand);
  color: var(--brand-ink);
}
.btn.primary:hover, .toolbar .btns .primary:hover, .toolbar .inline-form .primary:hover{
  filter: brightness(1.05);
}

/* Legacy grüner .button – Grundstil (wird auf Startseite glossy überschrieben) */
.button{
  background: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--border));
  color: #063a2e;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-sm);
  min-height: 44px;
  font-weight: 700;
  font-size: clamp(1rem, .85rem + .5vw, 1.15rem);
  text-align: center;
  text-decoration: none;
  display: inline-flex; align-items:center; justify-content:center;
  box-shadow: var(--shadow-sm);
  transition: transform .06s ease, filter .2s ease;
  white-space: normal; text-wrap: balance; overflow-wrap: anywhere; hyphens:auto;
}
.button:hover{ filter: brightness(1.03); }
.button:active{ transform: translateY(1px); }

/* Ensure inline forms don't break toolbar layout */
.inline-form{ display:inline; margin:0; }

/* ---------------------------
   Grid of Tiles (cards as buttons)
   --------------------------- */
.aufklaerung-grid{
  display: grid;
  gap: clamp(10px, 2.6vw, 18px);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: stretch;
  margin-top: 14px;
}

/* Card-style links – big tappable targets */
.tile{
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  padding: clamp(16px, 5.5vh, 28px);
  min-block-size: clamp(84px, 12vh, 140px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background:
    radial-gradient(1200px 1200px at 10% -10%, var(--brand-soft), transparent 40%),
    var(--surface);
  color: var(--ink);
  font-weight: 750;
  font-size: clamp(1rem, .8rem + .55vw, 1.2rem);
  line-height: 1.25;
  box-shadow: var(--shadow-md);
  transition: transform .14s ease, box-shadow .2s ease, border-color .2s ease, background .3s ease;
  white-space: normal; text-wrap: balance; overflow-wrap:anywhere; hyphens:auto;
}
.tile:hover{
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 16px 40px rgba(17,24,39,.12);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
}
.tile:active{ transform: translateY(-1px) scale(.997); }

/* Ensure nested text doesn’t add underlines/odd colors */
.tile *{ color: inherit; text-decoration: none; }

/* ---------------------------
   Tables / small helpers
   --------------------------- */
.checkbox-table{ width:100%; border-collapse: collapse; }
.checkbox-table td{ padding: 6px 10px; vertical-align: middle; }

/* ---------------------------
   Layout tweaks for small screens
   --------------------------- */
@media (max-width: 920px){
  .container{ width: calc(100% - clamp(12px, 4vw, 24px)*2); }
}

@media (pointer: coarse){
  .btn, .button, .tile{ padding-block: max(14px, 1.1rem); }
}

@media (max-width: 560px){
  .header{ flex-direction: column; }
}

/* Tighten spacing on very small screens */
@media (max-width: 520px){
  .header{ padding: 12px 14px; }
  .header h1{ font-size: clamp(1.15rem, 1rem + 3.2vw, 1.45rem); }
  .toolbar{ padding: 10px 12px; }
}

/* ---------------------------
   Print (keep simple)
   --------------------------- */
@media print{
  .toolbar{ position: static; backdrop-filter:none; }
  .container{ box-shadow:none; border-color:#ccc; }
  .tile{ box-shadow:none; background:#fff; }
}

/* =========================================================
   STARTSEITE: Buttons im glossy Stil (gleich wie .tile)
   ========================================================= */

/* Gruppe auf Grid – gleiche Breite & responsives Layout */
.container .buttons{
  display: grid !important; /* überschreibt evtl. vorhandenes Flex */
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(10px, 2.6vw, 18px);
  align-items: stretch;
}

/* Buttons in der Gruppe: glossy Card-Optik + identische Maße */
.container .buttons .button,
.container .buttons .btn,
.container .buttons a.button,
.container .buttons a.btn{
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;  /* <a> ohne Unterstreichung */
  cursor: pointer;

  /* Typografie & Umbrüche */
  font-weight: 750;
  font-size: clamp(1rem, .8rem + .55vw, 1.2rem);
  line-height: 1.25;
  white-space: normal; text-wrap: balance; overflow-wrap:anywhere; hyphens:auto;

  /* Gleiche Größe wie die Tiles */
  padding: clamp(16px, 5.5vh, 28px);
  min-block-size: clamp(84px, 12vh, 140px);
  width: 100%;

  /* Glossy Stil (analog .tile) */
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background:
    /* zarter Glanz */
    linear-gradient(180deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,.08) 36%, rgba(255,255,255,0) 100%),
    radial-gradient(1200px 1200px at 10% -10%, var(--brand-soft), transparent 45%),
    var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  transition: transform .14s ease, box-shadow .2s ease, border-color .2s ease, background .3s ease;
}

.container .buttons .button:hover,
.container .buttons .btn:hover,
.container .buttons a.button:hover,
.container .buttons a.btn:hover{
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 16px 40px rgba(17,24,39,.12);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
}

.container .buttons .button:active,
.container .buttons .btn:active,
.container .buttons a.button:active,
.container .buttons a.btn:active{
  transform: translateY(-1px) scale(.997);
}

/* Optional: Primär-Variante im glossy Stil (z. B. class="button btn--primary") */
.container .buttons .btn--primary{
  background:
    linear-gradient(180deg, rgba(255,255,255,.20) 0%, rgba(255,255,255,.06) 40%, rgba(255,255,255,0) 100%),
    linear-gradient(0deg, color-mix(in srgb, var(--brand) 90%, black 0%), color-mix(in srgb, var(--brand) 80%, black 0%));
  color: var(--brand-ink);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--border));
}
.container .buttons .btn--primary:hover{
  filter: brightness(1.03);
  border-color: color-mix(in srgb, var(--brand) 55%, var(--border));
}
/* ================================
   Outlook-Style Appbar + Menü
   ================================ */
.appbar{
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px clamp(12px, 4vw, 20px);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(var(--blur));
  border-bottom: 1px solid var(--border);
}
.appbar-left, .appbar-right{ display:flex; align-items:center; gap:10px; }

.appbar-mail{
  border-color: color-mix(in srgb, var(--brand) 30%, var(--border));
  background: linear-gradient(180deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,.06) 36%, rgba(255,255,255,0) 100%),
              var(--brand);
  color: var(--brand-ink);
  border-radius: 999px; /* pill wie Outlook */
  padding: .85rem 1.1rem;
  font-weight: 700;
}
.appbar-mail:hover{ filter: brightness(1.05); }

.appbar-menu{
  background: var(--surface);
  border-color: var(--border);
  border-radius: var(--radius-sm);
  padding: .7rem .95rem;
  font-weight: 650;
}

/* Dropdown-Panel */
.menu-panel{
  position: absolute;
  right: clamp(12px, 4vw, 20px);
  top: calc(100% + 8px);
  min-width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 8px;
  display: none; /* via .open sichtbar */
}
.menu-panel.open{ display:block; }

.menu-item{
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 0; background: transparent; color: var(--ink);
  font: inherit; text-align: left; cursor: pointer;
  border-radius: 10px; min-height: 44px;
  white-space: normal; text-wrap: balance; overflow-wrap:anywhere; hyphens:auto;
}
.menu-item:hover, .menu-item:focus-visible{
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  outline: none;
}

/* Mobile: Panel vollbreit unten an Appbar rechts ausrichten */
@media (max-width: 560px){
  .menu-panel{ left: 12px; right: 12px; }
  .appbar-mail span{ display:none; }  /* nur Icon falls eng */
}
:root,
html,
body {
  background-color: #ffffff !important;
  color: #111111 !important;
  color-scheme: light !important;
}
