/* =====================================================================
   SAfD – Design-System (safd.css)
   One-UI-inspiriert · barrierefrei · hochkontrast · dark · RTL · responsive
   Ergänzt style.css (Basis-Tokens, Wellen, Cookie). Theme-Variablen werden
   pro Request aus der DB in <style id="safd-theme-vars"> injiziert.
   ===================================================================== */

:root {
    --primary: #0b3b5e;
    --primary-2: #4a90e2;
    --accent: #e0a500;
    --success: #2e7d32;
    --danger: #c62828;
    --warning: #ed8f00;
    --info: #1565c0;
    --theme-bg: #f5f8fc;

    --text: #16202b;
    --text-secondary: #4b5563;
    --text-muted: #5f6875;   /* WCAG 1.4.3: ~4.9:1 auf #fff (vorher #7a8494 = 3.78:1, FAIL) */
    --surface: #ffffff;
    --surface-2: #f1f5fb;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 32px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 3px rgba(16,32,43,.08);
    --shadow-md: 0 8px 24px -8px rgba(16,32,43,.16), 0 2px 8px rgba(16,32,43,.06);
    --shadow-lg: 0 24px 48px -16px rgba(16,32,43,.22), 0 6px 18px rgba(16,32,43,.08);

    --font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --fs-scale: 1;
    --maxw: 1180px;
    --link: #0b3b5e;         /* Linkfarbe (11.66:1 auf #fff) */
    --focus-ring: #0b3b5e;   /* Fokus-Outline gut sichtbar (WCAG 1.4.11) */
    --focus: 3px solid var(--focus-ring);
}

/* ---------- Farb-Modi ------------------------------------------------ */
html[data-theme="dark"] {
    --text: #e8eef6;
    --text-secondary: #b3bccb;
    --text-muted: #8a95a6;
    --surface: #16202b;
    --surface-2: #1f2c3a;
    --border: #2b3a4b;
    --border-strong: #3a4b5f;
    --theme-bg: #0d151e;
    --link: #7fb4f0;         /* heller Link im Dunkelmodus (~6:1 auf #16202b) */
    --focus-ring: #7fb4f0;
    --shadow-md: 0 8px 24px -8px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.4);
    --shadow-lg: 0 24px 48px -16px rgba(0,0,0,.6);
}
@media (prefers-color-scheme: dark) {
    html[data-theme="auto"] {
        --text:#e8eef6; --text-secondary:#b3bccb; --text-muted:#8a95a6;
        --surface:#16202b; --surface-2:#1f2c3a; --border:#2b3a4b; --border-strong:#3a4b5f; --theme-bg:#0d151e;
        --link:#7fb4f0; --focus-ring:#7fb4f0;
    }
}
/* ---------- Hochkontrast -------------------------------------------- */
html[data-contrast="high"] {
    --text: #000000;
    --text-secondary: #000000;
    --text-muted: #1a1a1a;
    --surface: #ffffff;
    --surface-2: #ffffff;
    --border: #000000;
    --border-strong: #000000;
    --primary: #003a63;
    --primary-2: #004a8f;
    --accent: #7a4a00;
    --link: #003a63;
    --focus-ring: #000;
    --focus: 4px solid #000;
}
html[data-contrast="high"][data-theme="dark"] {
    --text:#ffffff; --text-secondary:#ffffff; --surface:#000000; --surface-2:#000000;
    --border:#ffffff; --border-strong:#ffffff; --primary:#7fc0ff; --primary-2:#a9d5ff; --accent:#ffd24d;
    --link:#a9d5ff; --focus-ring:#fff;
}
html[data-contrast="high"] * { text-shadow: none !important; }
html[data-contrast="high"] .card, html[data-contrast="high"] .btn { border-width: 2px !important; }

/* ---------- Schwarz-Weiß-Modus (Monochrom) ---------------- */
html[data-mono="on"] { filter: grayscale(100%) contrast(1.06); }
html[data-mono="on"] img, html[data-mono="on"] video { filter: grayscale(100%); }

/* ---------- Bessere Erkennbarkeit / Lesbarkeit ------------ */
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 3px; }
.btn { min-height: 44px; }               /* größere Touch-Ziele */
.icon-btn { min-width: 40px; min-height: 40px; }
.header-nav a { min-height: 40px; display: inline-flex; align-items: center; }
input, select, textarea { min-height: 44px; }
::selection { background: var(--primary); color: #fff; }

/* ---------- Schriftgrößen (A- / A / A+) ----------------------------- */
html[data-fontsize="small"]  { --fs-scale: .9; }
html[data-fontsize="normal"] { --fs-scale: 1; }
html[data-fontsize="large"]  { --fs-scale: 1.15; }
html[data-fontsize="xlarge"] { --fs-scale: 1.32; }

body {
    font-family: var(--font-family);
    background: var(--theme-bg);
    color: var(--text);
    font-size: calc(1rem * var(--fs-scale));
}
html[data-theme="dark"] body,
html[data-contrast="high"] body { background: var(--theme-bg); }

/* Fokus immer sichtbar (a11y) */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: var(--focus);
    outline-offset: 2px;
    border-radius: 4px;
}

h1,h2,h3,h4 { color: var(--text); line-height: 1.2; }
a { color: var(--link); }
p { line-height: 1.65; }

/* Pflichtfeld-Kennzeichnung: sichtbarer Stern (nicht nur Farbe) – WCAG 1.4.1/3.3.2 */
label.req::after { content: " *"; color: var(--danger); font-weight: 700; }
.form-required-note { font-size: .82rem; color: var(--text-secondary); }
.form-required-note::before { content: "* "; color: var(--danger); font-weight: 700; }

/* Mindest-Zielgröße für Karussell-Punkte – WCAG 2.5.8 (24×24) */
.carousel-dot { min-width: 24px; min-height: 24px; }

/* Karussell Pause/Play-Umschalter (WCAG 2.2.2) */
[data-carousel] { position: relative; }
.carousel-play { position: absolute; right: .6rem; bottom: .6rem; z-index: 5; width: 40px; height: 40px;
    border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text);
    cursor: pointer; font-size: 1rem; line-height: 1; display: grid; place-items: center; }
.carousel-play:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Inline-Barrierefreiheits-Block (Baukasten „Barrierefreiheit") */
.a11y-block { display: flex; flex-direction: column; gap: 1rem; }
.a11y-block-head { display: flex; align-items: center; gap: .9rem; }
.a11y-block-icon { font-size: 2rem; line-height: 1; flex: 0 0 auto; }
.a11y-block-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.a11y-block-grp { display: inline-flex; align-items: center; gap: .35rem; }
.a11y-block-lbl { font-size: .85rem; color: var(--text-secondary); font-weight: 600; margin-right: .2rem; }

/* =====================================================================
   HEADER-Ergänzungen (Tools, Sprache, Hamburger)
   ===================================================================== */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
html[data-theme="dark"] .site-header { background: rgba(22,32,43,.85); }
.logo-area { text-decoration: none; }
.header-tools { display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; }
.a11y-bar { display:flex; align-items:center; gap:.35rem; }

.icon-btn {
    width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text-secondary); font-size: 1rem; cursor: pointer;
    display: grid; place-items: center; transition: .2s;
}
.icon-btn:hover, .icon-btn[aria-pressed="true"] { background: var(--primary); color:#fff; border-color: var(--primary); }

.lang-switcher { position: relative; }
.lang-toggle {
    border:1px solid var(--border); background:var(--surface-2); color:var(--text-secondary);
    border-radius: var(--radius-pill); padding:.45rem .9rem; font-weight:600; cursor:pointer; font-size:.9rem;
}
.lang-toggle:hover { background: var(--primary); color:#fff; }
.lang-menu {
    position:absolute; right:0; top:calc(100% + .4rem); background:var(--surface);
    border:1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md);
    min-width: 190px; padding:.4rem; display:none; z-index:200; flex-direction:column;
}
.lang-switcher.open .lang-menu { display:flex; }
.lang-menu a { display:flex; align-items:center; gap:.6rem; padding:.6rem .8rem; border-radius:var(--radius-sm); text-decoration:none; color:var(--text); font-weight:500; }
.lang-menu a:hover, .lang-menu a[aria-current="true"] { background: var(--surface-2); color: var(--primary); }
.lang-menu-head { font-size:.72rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--text-secondary); padding:.3rem .8rem .5rem; }
.lang-flag { font-size:1.25rem; line-height:1; flex:0 0 auto; }

/* Barrierefreiheits-Menü – aufgeräumt: ein ♿-Knopf statt vieler Buttons */
.a11y-menu { position: relative; }
.a11y-panel {
    position:absolute; right:0; top:calc(100% + .4rem); background:var(--surface);
    border:1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md);
    min-width: 210px; padding:.55rem .7rem; display:none; z-index:200;
}
.a11y-menu.open .a11y-panel { display:block; }
.a11y-row { display:flex; align-items:center; justify-content:space-between; gap:.8rem; padding:.35rem 0; }
.a11y-row + .a11y-row { border-top:1px solid var(--border); margin-top:.15rem; padding-top:.55rem; }
.a11y-lbl { font-size:.8rem; color:var(--text-secondary); font-weight:600; white-space:nowrap; }

/* =====================================================================
   Header-Menüs (Sprache · Barrierefreiheit) klappen ZENTRIERT auf –
   nie links/rechts aus dem Bild. Fixiert, horizontal in der Mitte,
   direkt unter dem Header, mit abdunkelndem Hintergrund.
   ===================================================================== */
.site-header { position: relative; z-index: 1300; }
body.menu-open::before {
    content: ''; position: fixed; left: 0; right: 0;
    top: var(--safd-header-h, 68px); bottom: 0;
    background: rgba(0, 0, 0, .34); z-index: 1100;
    animation: safdBackdrop .18s ease;
}
.lang-switcher.open .lang-menu,
.a11y-menu.open .a11y-panel {
    position: fixed;
    top: calc(var(--safd-header-h, 68px) + 8px);
    left: 50%; right: auto;
    transform: translateX(-50%);
    width: min(340px, calc(100vw - 1.6rem));
    max-width: calc(100vw - 1.6rem);
    max-height: calc(100vh - var(--safd-header-h, 68px) - 26px);
    overflow-y: auto;
    z-index: 1200;
    box-shadow: var(--shadow-lg);
    animation: safdMenuPop .18s ease;
}
@keyframes safdBackdrop { from { opacity: 0 } to { opacity: 1 } }
@keyframes safdMenuPop {
    from { opacity: 0; transform: translate(-50%, -6px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

.nav-toggle { display:none; width:44px; height:44px; border:1px solid var(--border); background:var(--surface-2); border-radius:var(--radius-sm); cursor:pointer; padding:10px; }
.nav-toggle span { display:block; height:2px; background:var(--text); border-radius:2px; margin:3px 0; transition:.25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform:translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity:0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform:translateY(-5px) rotate(-45deg); }

/* Nav-Link-Farben ans Theme koppeln */
.header-nav a { color: var(--text-secondary); }
.header-nav a:hover { background: var(--surface-2); color: var(--primary); }
.header-nav a.active { background: var(--primary); color:#fff; }

/* =====================================================================
   MAIN LAYOUT
   ===================================================================== */
.main-content { align-items: flex-start; justify-content: center; padding: 2rem 1.25rem 4rem; }
.main-content.wide { display: block; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; }
.section { padding: 3rem 0; }
.section-tight { padding: 1.5rem 0; }
.section-head { text-align:center; max-width: 720px; margin: 0 auto 2rem; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; }
.section-head p { color: var(--text-secondary); margin-top:.5rem; }
.eyebrow { display:inline-block; text-transform:uppercase; letter-spacing:.14em; font-size:.72rem; font-weight:800; color:var(--primary-2); margin-bottom:.6rem; }

/* =====================================================================
   BUTTONS
   ===================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font-family: inherit; font-weight: 700; font-size: .95rem; line-height: 1;
    padding: .8rem 1.4rem; border-radius: var(--radius-pill);
    border: 2px solid transparent; cursor: pointer; text-decoration: none;
    transition: transform .12s ease, box-shadow .2s ease, background .2s, color .2s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--primary); color:#fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: var(--shadow-md); filter: brightness(1.06); }
.btn-accent { background: var(--accent); color:#1a1200; }
.btn-accent:hover { filter: brightness(1.06); }
.btn-success { background: var(--success); color:#fff; }
.btn-danger { background: var(--danger); color:#fff; }
.btn-ghost { background: transparent; color: var(--primary); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color:#fff; }
.btn-sm { padding: .5rem .95rem; font-size: .85rem; }
.btn-lg { padding: 1rem 1.9rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* =====================================================================
   CARDS & GRIDS
   ===================================================================== */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
    padding: 1.6rem; transition: transform .2s, box-shadow .25s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-hover:hover { transform: translateY(-4px); }
.card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: .4rem; }
.card .card-icon { font-size: 1.8rem; }

.grid { display: grid; gap: 1.2rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.feature-card { text-align:center; }
.feature-card .card-icon {
    width: 64px; height: 64px; border-radius: var(--radius-md); display:grid; place-items:center;
    margin: 0 auto 1rem; font-size: 1.8rem;
    background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary);
}

/* =====================================================================
   HERO / CAROUSEL (Startseite)
   ===================================================================== */
.hero {
    position: relative; border-radius: var(--radius-xl); overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color:#fff; box-shadow: var(--shadow-lg); margin-bottom: 2rem;
}
.carousel { position: relative; }
.carousel-track { display: flex; transition: transform .6s cubic-bezier(.16,1,.3,1); }
.carousel-slide {
    min-width: 100%; padding: clamp(2rem, 6vw, 4.5rem);
    display: flex; flex-direction: column; justify-content: center; min-height: 360px;
    background: linear-gradient(135deg, rgba(0,0,0,.15), rgba(0,0,0,0));
}
.carousel-slide .eyebrow { color: rgba(255,255,255,.85); }
.carousel-slide h2 { color:#fff; font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 800; max-width: 18ch; }
.carousel-slide p { color: rgba(255,255,255,.92); font-size: 1.1rem; max-width: 52ch; margin: 1rem 0 1.6rem; }
.carousel-nav { position:absolute; bottom: 1.2rem; left: 50%; transform: translateX(-50%); display:flex; gap:.5rem; }
.carousel-dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); background: transparent; cursor:pointer; padding:0; }
.carousel-dot.active { background:#fff; }
.carousel-arrow {
    position:absolute; top: 50%; transform: translateY(-50%); z-index:3;
    width: 46px; height: 46px; border-radius: 50%; border:none; cursor:pointer;
    background: rgba(255,255,255,.22); color:#fff; font-size: 1.4rem; backdrop-filter: blur(6px);
}
.carousel-arrow:hover { background: rgba(255,255,255,.35); }
.carousel-arrow.prev { left: 1rem; } .carousel-arrow.next { right: 1rem; }
[dir="rtl"] .carousel-arrow.prev { left:auto; right:1rem; } [dir="rtl"] .carousel-arrow.next { right:auto; left:1rem; }

/* =====================================================================
   FORMS
   ===================================================================== */
.form-card { max-width: 640px; margin: 0 auto; }
.form-group { margin-bottom: 1.1rem; }
.form-row { display:grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { display:block; font-weight:600; margin-bottom:.4rem; color: var(--text); font-size: .95rem; }
label .req { color: var(--danger); }
.input, input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=number], input[type=date], input[type=search], input[type=url], select, textarea {
    width: 100%; font-family: inherit; font-size: 1rem; color: var(--text);
    background: var(--surface); border: 2px solid var(--border-strong);
    border-radius: var(--radius-md); padding: .8rem 1rem; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-2) 25%, transparent); outline: none;
}
textarea { min-height: 130px; resize: vertical; }
.form-hint { font-size:.85rem; color: var(--text-muted); margin-top:.3rem; }
.checkbox-row { display:flex; align-items:flex-start; gap:.6rem; }
.checkbox-row input { width: 20px; height: 20px; margin-top: 2px; flex-shrink:0; }

/* =====================================================================
   ALERTS / BADGES / CHIPS
   ===================================================================== */
.alert { border-radius: var(--radius-md); padding: .9rem 1.1rem; margin-bottom: 1rem; border-left: 4px solid; font-weight: 500; }
.alert-success { background: color-mix(in srgb, var(--success) 12%, var(--surface)); border-color: var(--success); color: var(--success); }
.alert-error, .alert-danger { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); border-color: var(--danger); color: var(--danger); }
.alert-warning { background: color-mix(in srgb, var(--warning) 14%, var(--surface)); border-color: var(--warning); color: #8a5a00; }
.alert-info { background: color-mix(in srgb, var(--info) 12%, var(--surface)); border-color: var(--info); color: var(--info); }

.badge { display:inline-flex; align-items:center; gap:.3rem; font-size:.75rem; font-weight:700; padding:.25rem .6rem; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-secondary); }
.badge-primary { background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); }
.badge-success { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.badge-danger { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.chip { display:inline-block; padding:.35rem .8rem; border-radius: var(--radius-pill); background: var(--surface-2); border:1px solid var(--border); font-size:.85rem; }

/* =====================================================================
   TABLES
   ===================================================================== */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border:1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; background: var(--surface); font-size:.94rem; }
.table th, .table td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: var(--surface-2); font-weight: 700; color: var(--text-secondary); position: sticky; top:0; }
.table tbody tr:hover, .table tr:hover { background: var(--surface-2); }
[dir="rtl"] .table th, [dir="rtl"] .table td { text-align: right; }

/* =====================================================================
   MEMBER / ADMIN HELPERS
   ===================================================================== */
.page-title { font-size: clamp(1.6rem,4vw,2.4rem); font-weight:800; margin-bottom:.3rem; }
.page-lead { color: var(--text-secondary); margin-bottom: 1.5rem; }
.stat-grid { display:grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 1rem; }
.stat { background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-lg); padding:1.2rem; text-align:center; }
.stat .val { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat .lbl { color: var(--text-muted); font-size:.85rem; margin-top:.2rem; }
.toolbar { display:flex; gap:.6rem; flex-wrap:wrap; align-items:center; margin-bottom:1.2rem; }
.spacer { flex:1; }

/* =====================================================================
   FOOTER
   ===================================================================== */
.site-footer { flex-direction: column; align-items: stretch; gap:0; background: var(--surface); border-top:1px solid var(--border); padding: 2.5rem 2rem 1.5rem; }
.footer-cols { display:grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap:2rem; max-width: var(--maxw); margin:0 auto; width:100%; }
.footer-brand { font-weight: 800; font-size: 1.3rem; color: var(--primary); }
.footer-heading { font-size:.9rem; text-transform:uppercase; letter-spacing:.08em; color:var(--text-secondary); margin-bottom:.8rem; }
.footer-muted { color: var(--text-muted); font-size:.9rem; margin:.2rem 0; }
.footer-muted a { color: var(--text-secondary); }
.footer-col .footer-links { flex-direction: column; gap:.5rem; }
.footer-socials { display:flex; gap:.6rem; font-size:1.3rem; }
.footer-socials a { text-decoration:none; }
.footer-copy { text-align:center; color:var(--text-muted); font-size:.85rem; margin-top:2rem; padding-top:1.2rem; border-top:1px solid var(--border); }

/* =====================================================================
   UTILITIES
   ===================================================================== */
.text-center{text-align:center}.text-muted{color:var(--text-muted)}.text-secondary{color:var(--text-secondary)}
.mt-0{margin-top:0}.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}.mt-4{margin-top:2rem}
.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}.mb-4{margin-bottom:2rem}
.flex{display:flex}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}
.gap-1{gap:.5rem}.gap-2{gap:1rem}.wrap{flex-wrap:wrap}.w-full{width:100%}.hidden{display:none}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 900px) {
    .grid-4 { grid-template-columns: repeat(2,1fr); }
    .grid-3 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 780px) {
    /* Kopf: Logo links, Werkzeuge (Sprache · ♿ · CTA · ☰) kompakt rechts, Menü einklappbar */
    .site-header { flex-wrap: wrap; gap: .4rem .5rem; padding: .7rem .9rem; align-items: center; }
    .logo-area { flex: 1 1 auto; min-width: 0; margin-right: auto; }
    .header-tools { flex: 0 0 auto; gap: .35rem; flex-wrap: nowrap; margin: 0; }
    .nav-toggle { display: block; order: 9; }
    .header-nav {
        display:none; order: 20; width:100%; flex-basis:100%; flex-direction:column; gap:.2rem;
        background: var(--surface); border-top:1px solid var(--border); margin-top:.5rem; padding-top:.5rem;
    }
    .header-nav.open { display:flex; }
    .header-nav a { width:100%; }
    .grid-2, .grid-3, .grid-4, .grid-auto { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .main-content { padding: 1.1rem .8rem 3rem; }
    /* Footer mittig */
    .footer-cols { text-align: center; }
    .footer-col .footer-links { align-items: center; }
    .footer-socials { justify-content: center; }
}

@media (max-width: 560px) {
    /* Kopfzeile scrollt mit (mehr Platz für Inhalt auf dem Handy) */
    .site-header { position: static; }
    /* Buttons einheitlich: volle Breite, gestapelt (eine Spalte), zentriert */
    .main-content .flex.wrap, .hero .flex, .card > .flex.wrap { flex-direction: column; align-items: stretch; }
    .btn { width: 100%; justify-content: center; }
    /* Ausnahmen: kleine/Steuer-Buttons bleiben kompakt */
    .btn-sm, .header-tools .btn, .icon-btn, .lang-toggle, .a11y-bar .btn,
    .carousel-arrow, .cookie-btn, .toolbar .btn { width: auto; }
    .cookie-buttons { justify-content: center; }
    .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; }
    /* Alles aufgeräumt & zentriert */
    .section { padding: 2rem 0; }
    .section-head { text-align: center; }
    .card { padding: 1.2rem; }
    .toolbar { justify-content: center; }
    h1, .page-title { font-size: 1.5rem; line-height: 1.25; }
    .carousel-slide { min-height: 300px; padding: 1.6rem 1.2rem; text-align: center; align-items: center; }
    .carousel-slide h2 { font-size: 1.7rem; }
    .carousel-slide p { font-size: 1rem; }
    /* Kopf-Werkzeuge kompakt; Dropdowns klappen zentriert auf (siehe oben) */
    .header-tools { gap: .3rem; }
    .header-cta { padding: .5rem .8rem; }
}

/* =====================================================================
   REDUCED MOTION
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; }
    .waves svg { animation: none; }
}
html[data-motion="off"] * { animation: none !important; transition: none !important; }
