/* Consent-Banner und Einstellungs-Dialog – eigenständig, funktioniert auf
   öffentlichen Seiten und im Portal (keine Abhängigkeit von styles.css). */

/* display:flex würde das hidden-Attribut sonst aushebeln (Author- vor UA-Styles) */
.consent-banner[hidden],
.consent-modal[hidden],
.consent-fab[hidden] {
    display: none;
}

/* Schwebendes Cookie-Symbol unten links: öffnet den Einstellungs-Dialog */
.consent-fab {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 1150;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffffff;
    color: #0f6a61;
    border: 1px solid #dce5e1;
    box-shadow: 0 10px 30px rgba(14, 36, 33, .25);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}

.consent-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 14px 36px rgba(14, 36, 33, .32);
}

@media (max-width: 560px) {
    .consent-fab {
        left: 10px;
        bottom: 10px;
        width: 42px;
        height: 42px;
    }
}

.consent-banner {
    position: fixed;
    inset: auto 16px 16px 16px;
    z-index: 1200;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.consent-banner-inner {
    pointer-events: auto;
    max-width: 720px;
    width: 100%;
    background: #ffffff;
    color: #14211f;
    border: 1px solid #dce5e1;
    border-radius: 16px;
    box-shadow: 0 22px 60px rgba(14, 36, 33, .22);
    padding: 20px 24px;
}

.consent-title {
    margin: 0 0 6px;
    font-size: 1.05rem;
    line-height: 1.3;
}

.consent-text {
    margin: 0 0 14px;
    font-size: .9rem;
    line-height: 1.55;
    color: #5e6c68;
}

.consent-text a {
    color: #0f6a61;
    text-decoration: underline;
}

.consent-actions,
.consent-modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.consent-btn {
    font: inherit;
    font-size: .92rem;
    font-weight: 600;
    border-radius: 10px;
    padding: 10px 18px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

/* „Alle akzeptieren“ und „Nur notwendige“ bewusst gleichwertig gestaltet
   (keine Benachteiligung der Ablehnung, Art. 7 Abs. 3 DSGVO). */
.consent-btn-accept {
    background: #0f6a61;
    color: #ffffff;
}

.consent-btn-accept:hover {
    background: #103f3c;
}

.consent-btn-reject {
    background: #ecf3f0;
    color: #103f3c;
    border-color: #c8d6d0;
}

.consent-btn-reject:hover {
    background: #dce5e1;
}

.consent-btn-settings,
.consent-btn-save {
    background: transparent;
    color: #0f6a61;
    border-color: #0f6a61;
}

.consent-btn-settings:hover,
.consent-btn-save:hover {
    background: #ecf3f0;
}

.consent-btn:focus-visible,
.consent-close:focus-visible,
.consent-link:focus-visible,
.consent-switch input:focus-visible ~ .consent-slider {
    outline: 3px solid #c8963e;
    outline-offset: 2px;
}

/* Footer-/Textlink „Cookie-Einstellungen“ (Button, als Link gestaltet) */
.consent-link {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.consent-link:hover {
    text-decoration: underline;
}

/* Variante im Fließtext (z. B. Datenschutzerklärung) */
.consent-link-inline {
    color: #0f6a61;
    text-decoration: underline;
}

/* Einstellungs-Dialog */
.consent-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.consent-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(14, 36, 33, .55);
}

.consent-modal-dialog {
    position: relative;
    background: #ffffff;
    color: #14211f;
    width: 100%;
    max-width: 640px;
    max-height: min(85vh, 720px);
    border-radius: 16px;
    box-shadow: 0 22px 60px rgba(14, 36, 33, .3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.consent-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 24px;
    border-bottom: 1px solid #dce5e1;
}

.consent-modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.consent-close {
    background: none;
    border: 0;
    font-size: 1.6rem;
    line-height: 1;
    color: #5e6c68;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 10px;
}

.consent-close:hover {
    color: #14211f;
    background: #ecf3f0;
}

.consent-modal-body {
    padding: 18px 24px;
    overflow-y: auto;
    font-size: .9rem;
    line-height: 1.55;
}

.consent-modal-body > p {
    margin: 0 0 16px;
    color: #5e6c68;
}

.consent-category {
    border: 1px solid #dce5e1;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.consent-category-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.consent-category-head h3 {
    margin: 0 0 4px;
    font-size: .98rem;
}

.consent-category-head p {
    margin: 0;
    color: #5e6c68;
    font-size: .85rem;
}

/* Schalter */
.consent-switch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
}

.consent-switch.is-locked {
    cursor: default;
}

.consent-switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.consent-slider {
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: #c8d6d0;
    position: relative;
    transition: background .15s ease;
}

.consent-slider::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(14, 36, 33, .3);
    transition: transform .15s ease;
}

.consent-switch input:checked ~ .consent-slider {
    background: #0f6a61;
}

.consent-switch input:checked ~ .consent-slider::after {
    transform: translateX(20px);
}

.consent-switch input:disabled ~ .consent-slider {
    background: #103f3c;
    opacity: .55;
}

.consent-switch-label {
    font-size: .72rem;
    color: #5e6c68;
}

/* Dienstdetails */
.consent-services {
    margin-top: 12px;
    border-top: 1px dashed #dce5e1;
    padding-top: 10px;
}

.consent-services summary {
    cursor: pointer;
    color: #0f6a61;
    font-weight: 600;
    font-size: .85rem;
}

.consent-service {
    margin: 12px 0 0;
    padding: 12px;
    background: #f7faf8;
    border-radius: 10px;
}

.consent-service dt {
    font-weight: 700;
    margin-bottom: 6px;
}

.consent-service dd {
    margin: 0 0 4px;
    font-size: .85rem;
    color: #5e6c68;
}

.consent-service dd a {
    color: #0f6a61;
    text-decoration: underline;
}

.consent-none {
    margin: 10px 0 0;
    font-size: .82rem;
    color: #5e6c68;
    font-style: italic;
}

.consent-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #dce5e1;
    justify-content: flex-end;
}

body.consent-modal-open {
    overflow: hidden;
}

@media (max-width: 560px) {
    .consent-banner {
        inset: auto 8px 8px 8px;
    }

    .consent-banner-inner {
        padding: 16px;
    }

    .consent-actions .consent-btn,
    .consent-modal-footer .consent-btn {
        flex: 1 1 100%;
    }

    .consent-category-head {
        flex-direction: column;
    }

    .consent-switch {
        flex-direction: row;
    }
}

@media (prefers-reduced-motion: reduce) {
    .consent-btn,
    .consent-slider,
    .consent-slider::after,
    .consent-fab {
        transition: none;
    }
}
