/* ==========================================================================
   Consent-Manager — Banner, Kategorie-Dialog, Embed-Platzhalter.
   Eigenständig gestylt (theme-unabhängig), Farben über CSS-Variablen mit
   Fallback überschreibbar.
   ========================================================================== */
.faro-consent {
    --fc-backdrop: rgba(15, 23, 42, 0.55);
    --fc-card:     #ffffff;
    --fc-text:     #1e293b;
    --fc-muted:    #475569;
    --fc-border:   #e2e8f0;
    --fc-accent:   #2f5d5a;
    --fc-accent-fg:#ffffff;

    position: fixed;
    inset: 0;
    z-index: 2147482000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--fc-backdrop);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.faro-consent[hidden] { display: none; }

/* Seiten-Scroll sperren, solange der Banner (Modal) offen ist. */
html.faro-consent-open, html.faro-consent-open body { overflow: hidden; }

.faro-consent__panel {
    background: var(--fc-card);
    color: var(--fc-text);
    width: 100%;
    max-width: 720px;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    animation: faro-consent-in 0.2s ease-out;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}
@keyframes faro-consent-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .faro-consent__panel { animation: none; }
}

.faro-consent__title {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    line-height: 1.3;
    color: var(--fc-text);
}
.faro-consent__text {
    margin: 0 0 1rem;
    color: var(--fc-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}
.faro-consent__text a { color: var(--fc-accent); text-decoration: underline; }

/* ── Kategorie-Liste (nur im „Einstellungen"-Modus sichtbar) ── */
.faro-consent__cats { margin: 0 0 1rem; display: grid; gap: 0.6rem; }
.faro-consent__cats[hidden] { display: none; }

.faro-consent__cat {
    border: 1px solid var(--fc-border);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}
.faro-consent__cat-main { flex: 1; }
.faro-consent__cat-label { font-weight: 600; font-size: 0.95rem; }
.faro-consent__cat-desc  { color: var(--fc-muted); font-size: 0.85rem; margin-top: 0.15rem; line-height: 1.5; }
.faro-consent__cat-services { margin-top: 0.35rem; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.faro-consent__chip {
    background: #f1f5f9; color: var(--fc-muted);
    border-radius: 999px; padding: 0.1rem 0.55rem; font-size: 0.75rem;
}

/* Toggle-Switch */
.faro-consent__switch { position: relative; width: 44px; height: 24px; flex: 0 0 auto; margin-top: 0.15rem; }
.faro-consent__switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.faro-consent__slider {
    position: absolute; inset: 0; border-radius: 999px;
    background: #cbd5e1; transition: background 0.15s ease;
}
.faro-consent__slider::before {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff; transition: transform 0.15s ease;
}
.faro-consent__switch input:checked + .faro-consent__slider { background: var(--fc-accent); }
.faro-consent__switch input:checked + .faro-consent__slider::before { transform: translateX(20px); }
.faro-consent__switch input:disabled + .faro-consent__slider { opacity: 0.6; }
.faro-consent__switch input:focus-visible + .faro-consent__slider {
    outline: 3px solid var(--fc-accent); outline-offset: 2px;
}

/* ── Aktionen ── */
.faro-consent__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.faro-consent__btn {
    flex: 1 1 auto;
    min-width: 140px;
    padding: 0.7rem 1.1rem;
    border-radius: 9px;
    border: 2px solid var(--fc-accent);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    background: var(--fc-card);
    color: var(--fc-accent);
}
.faro-consent__btn--primary { background: var(--fc-accent); color: var(--fc-accent-fg); }
.faro-consent__btn:hover { filter: brightness(1.05); }
.faro-consent__btn:focus-visible { outline: 3px solid var(--fc-accent); outline-offset: 2px; }

/* ── Reopen-Trigger (dauerhaft, für Widerruf) ── */
.faro-consent-reopen {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 2147481000;
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    font-family: inherit;
}
.faro-consent-reopen[hidden] { display: none; }
.faro-consent-reopen:hover { background: #f8fafc; }
.faro-consent-reopen:focus-visible { outline: 3px solid #2f5d5a; outline-offset: 2px; }

/* ==========================================================================
   Embed-Platzhalter (blockierte iframes im html-Block)
   ========================================================================== */
.faro-consent-embed {
    position: relative;
    display: block;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    min-height: 220px;
}
.faro-consent-embed.is-loaded { background: none; min-height: 0; }
.faro-consent-embed > iframe[data-src] { display: none; }
.faro-consent-embed.is-loaded > iframe { display: block; width: 100%; }

.faro-consent-embed__prompt {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    padding: 1.25rem;
}
.faro-consent-embed__label { font-weight: 700; font-size: 1.05rem; margin: 0; }
.faro-consent-embed__note  { margin: 0; font-size: 0.85rem; color: #cbd5e1; max-width: 34ch; line-height: 1.5; }
.faro-consent-embed__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 0.3rem; }
.faro-consent-embed__btn {
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    border: 1px solid #475569;
    background: #1e293b;
    color: #f8fafc;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.faro-consent-embed__btn--accept { background: #2f5d5a; border-color: #2f5d5a; }
.faro-consent-embed__btn:hover { filter: brightness(1.1); }
.faro-consent-embed__btn:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
