/*
 * GLASSLINE Cookie-Consent – Banner & Einstellungen
 * Theme-aware (body.light / body.dark). Markenfarben: #00b1e9 / #0053A1.
 */

#gl-consent[hidden] { display: none !important; }

#gl-consent {
    --gl-c-accent: #00b1e9;
    --gl-c-accent-dark: #0053a1;
    --gl-c-bg: #ffffff;
    --gl-c-fg: #1a1a1a;
    --gl-c-muted: #55606b;
    --gl-c-border: #e2e6ea;
    --gl-c-surface: #f5f7f9;

    position: fixed;
    inset: auto 0 0 0;
    z-index: 2147483000; /* über allem */
    display: flex;
    justify-content: center;
    padding: 16px;
    font-family: inherit;
    box-sizing: border-box;
}

body.dark #gl-consent {
    --gl-c-bg: #16202b;
    --gl-c-fg: #eef3f7;
    --gl-c-muted: #a7b3bf;
    --gl-c-border: #2b3a49;
    --gl-c-surface: #1f2c39;
}

#gl-consent * { box-sizing: border-box; }

/* Dezente Abdunkelung des Hintergrunds im Einstellungsmodus */
#gl-consent::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 200ms ease;
    pointer-events: none;
}
#gl-consent.is-settings::before { opacity: 1; }

.gl-consent__panel {
    position: relative;
    width: 100%;
    max-width: 720px;
    background: var(--gl-c-bg);
    color: var(--gl-c-fg);
    border: 1px solid var(--gl-c-border);
    border-top: 4px solid var(--gl-c-accent);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    padding: 24px 26px;
    animation: gl-consent-in 260ms ease;
}

@keyframes gl-consent-in {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.gl-consent__title {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 700;
    color: var(--gl-c-fg);
}

.gl-consent__text {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--gl-c-muted);
}

.gl-consent__text a {
    color: var(--gl-c-accent);
    text-decoration: underline;
}

/* --- Buttons --- */
.gl-consent__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gl-consent__btn {
    flex: 1 1 auto;
    min-width: 150px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
    text-align: center;
    line-height: 1.2;
}

/* "Akzeptieren" und "Ablehnen" gleichwertig gestaltet (kein Dark Pattern):
   beide nutzen --equal und sind damit optisch identisch gewichtet. */
.gl-consent__btn--equal {
    background: var(--gl-c-accent);
    color: #fff;
}
.gl-consent__btn--equal:hover { background: var(--gl-c-accent-dark); }

.gl-consent__btn--primary {
    background: var(--gl-c-accent);
    color: #fff;
}
.gl-consent__btn--primary:hover { background: var(--gl-c-accent-dark); }

.gl-consent__btn--secondary {
    background: transparent;
    color: var(--gl-c-fg);
    border-color: var(--gl-c-border);
}
.gl-consent__btn--secondary:hover { border-color: var(--gl-c-accent); }

.gl-consent__btn--ghost {
    background: transparent;
    color: var(--gl-c-muted);
    border-color: var(--gl-c-border);
    flex: 0 1 auto;
}
.gl-consent__btn--ghost:hover { color: var(--gl-c-fg); border-color: var(--gl-c-accent); }

.gl-consent__btn:focus-visible {
    outline: 3px solid var(--gl-c-accent);
    outline-offset: 2px;
}

/* --- Kategorien / Einstellungen --- */
.gl-consent__categories { margin: 4px 0 20px; }

.gl-consent__cat {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--gl-c-border);
}
.gl-consent__cat:last-child { border-bottom: none; }

.gl-consent__cat-info h3 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--gl-c-fg);
}
.gl-consent__cat-info p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--gl-c-muted);
}

/* Toggle-Switch */
.gl-consent__switch {
    position: relative;
    flex: 0 0 auto;
    width: 48px;
    height: 26px;
    margin-top: 2px;
}
.gl-consent__switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}
.gl-consent__slider {
    position: absolute;
    inset: 0;
    background: #b9c2cb;
    border-radius: 999px;
    transition: background 160ms ease;
    pointer-events: none;
}
.gl-consent__slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 160ms ease;
}
.gl-consent__switch input:checked + .gl-consent__slider { background: var(--gl-c-accent); }
.gl-consent__switch input:checked + .gl-consent__slider::before { transform: translateX(22px); }
.gl-consent__switch input:disabled + .gl-consent__slider { background: var(--gl-c-accent-dark); opacity: 0.7; cursor: not-allowed; }
.gl-consent__switch input:focus-visible + .gl-consent__slider { outline: 3px solid var(--gl-c-accent); outline-offset: 2px; }

.gl-consent__settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

@media (max-width: 560px) {
    #gl-consent { padding: 10px; }
    .gl-consent__panel { padding: 20px 18px; }
    .gl-consent__btn { flex: 1 1 100%; }
}

/* ---------------------------------------------------------
 * Dauerhafter Wiederöffnen-Button (FAB) + Ablehnungs-Hinweis
 * --------------------------------------------------------- */
.gl-consent-fab[hidden],
.gl-consent-toast[hidden] { display: none !important; }

.gl-consent-fab {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 2147482000; /* unter dem Banner, über der Seite */
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
    color: #0053a1;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 150ms ease, box-shadow 150ms ease;
}
.gl-consent-fab:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28); }
.gl-consent-fab:focus-visible { outline: 3px solid #00b1e9; outline-offset: 2px; }
body.dark .gl-consent-fab { background: #16202b; border-color: #2b3a49; }

.gl-consent-toast {
    position: fixed;
    left: 18px;
    bottom: 78px;
    z-index: 2147482001;
    max-width: 360px;
    background: #ffffff;
    color: #1a1a1a;
    border: 1px solid #e2e6ea;
    border-left: 4px solid #00b1e9;
    border-radius: 10px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.22);
    padding: 14px 16px;
    font-family: inherit;
    animation: gl-consent-toast-in 240ms ease;
}
@keyframes gl-consent-toast-in {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
body.dark .gl-consent-toast { background: #16202b; color: #eef3f7; border-color: #2b3a49; border-left-color: #00b1e9; }

.gl-consent-toast__text { margin: 0 0 10px; font-size: 13.5px; line-height: 1.5; }
.gl-consent-toast__actions { display: flex; align-items: center; gap: 10px; }
.gl-consent-toast__btn {
    background: #00b1e9;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.gl-consent-toast__btn:hover { background: #0053a1; }
.gl-consent-toast__close {
    margin-left: auto;
    background: transparent;
    border: none;
    color: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 4px;
}
.gl-consent-toast__close:hover { opacity: 1; }
.gl-consent-toast__btn:focus-visible,
.gl-consent-toast__close:focus-visible { outline: 3px solid #00b1e9; outline-offset: 2px; }

@media (max-width: 560px) {
    .gl-consent-toast { left: 12px; right: 12px; max-width: none; bottom: 74px; }
    .gl-consent-fab { left: 12px; bottom: 12px; }
}
