/*----------------------------------------------
*
* [Consent Manager]
*
* DSGVO-konformer Cookie-/Consent-Banner
* Opt-in, keine Vorauswahl, jederzeit widerrufbar
*
----------------------------------------------*/

/*----------------------------------------------

[ALL CONTENTS]

1. Banner
2. Buttons
3. Einstellungs-Dialog
4. Schalter
5. Platzhalter fuer externe Inhalte
6. Responsive

----------------------------------------------*/

/*----------------------------------------------
1. Banner
----------------------------------------------*/

.consent-banner {
    position: fixed;
    z-index: 2000;
    right: 20px;
    bottom: 20px;
    left: 20px;
    max-width: 560px;
    margin-left: auto;
    padding: 28px 30px;
    background-color: var(--white-color, #fff);
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
    font-family: var(--p-font, 'Montserrat', sans-serif);
    font-size: .9rem;
    line-height: 1.6;
    color: var(--primary-p-color, #606d75);
}

.consent-banner[hidden],
.consent-dialog[hidden] {
    display: none;
}

.consent-banner h2 {
    margin: 0 0 12px;
    font-family: var(--h2-font, 'Poppins', sans-serif);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--primary-t-color, #21333e);
}

.consent-banner p {
    margin: 0 0 18px;
}

.consent-links {
    margin-top: 18px;
    font-size: .8rem;
}

.consent-links a {
    color: var(--primary-p-color, #606d75);
    text-decoration: underline;
}

.consent-links a:hover,
.consent-links a:focus {
    color: var(--primary-color, #058283);
}

.consent-links span {
    margin: 0 8px;
    opacity: .5;
}

/*----------------------------------------------
2. Buttons

Akzeptieren und Ablehnen sind bewusst optisch
gleichwertig - das verlangt die DSGVO.
----------------------------------------------*/

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

.consent-btn {
    flex: 1 1 0;
    min-width: 150px;
    padding: 11px 20px;
    border: 1px solid var(--primary-color, #058283);
    border-radius: 4px;
    font-family: inherit;
    font-size: .9rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all .3s ease-out;
}

.consent-btn-accept {
    background-color: var(--primary-color, #058283);
    color: var(--white-color, #fff);
}

.consent-btn-accept:hover,
.consent-btn-accept:focus {
    background-color: var(--secondary-color, #00a6a6);
    border-color: var(--secondary-color, #00a6a6);
}

.consent-btn-reject {
    background-color: transparent;
    color: var(--primary-color, #058283);
}

.consent-btn-reject:hover,
.consent-btn-reject:focus {
    background-color: var(--primary-color, #058283);
    color: var(--white-color, #fff);
}

.consent-btn-settings {
    flex: 1 1 100%;
    min-width: 0;
    padding: 4px;
    background: none;
    border: 0;
    color: var(--primary-p-color, #606d75);
    font-size: .8rem;
    text-decoration: underline;
}

.consent-btn-settings:hover,
.consent-btn-settings:focus {
    color: var(--primary-color, #058283);
}

/*----------------------------------------------
3. Einstellungs-Dialog
----------------------------------------------*/

.consent-dialog {
    position: fixed;
    z-index: 2001;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: rgba(0, 0, 7, .7);
    font-family: var(--p-font, 'Montserrat', sans-serif);
}

.consent-dialog-inner {
    width: 100%;
    max-width: 620px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 34px;
    background-color: var(--white-color, #fff);
    border-radius: 4px;
    font-size: .9rem;
    line-height: 1.6;
    color: var(--primary-p-color, #606d75);
}

.consent-dialog-inner h2 {
    margin: 0 0 10px;
    font-family: var(--h2-font, 'Poppins', sans-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-t-color, #21333e);
}

.consent-dialog-inner > p {
    margin: 0 0 24px;
}

.consent-dialog .consent-actions {
    margin-top: 26px;
}

/*----------------------------------------------
4. Schalter
----------------------------------------------*/

.consent-group {
    padding: 18px 0;
    border-top: 1px solid rgba(0, 0, 0, .1);
}

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

.consent-group-head h3 {
    margin: 0;
    font-family: var(--h2-font, 'Poppins', sans-serif);
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-t-color, #21333e);
}

.consent-group p {
    margin: 8px 0 0;
    font-size: .82rem;
}

.consent-group-fixed {
    flex: 0 0 auto;
    font-size: .78rem;
    font-weight: 500;
    color: var(--primary-color, #058283);
    text-transform: uppercase;
}

.consent-switch {
    position: relative;
    flex: 0 0 auto;
    width: 48px;
    height: 26px;
}

.consent-switch input {
    position: absolute;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.consent-switch span {
    position: absolute;
    inset: 0;
    background-color: #c8ccd0;
    border-radius: 26px;
    pointer-events: none;
    transition: background-color .3s ease-out;
}

.consent-switch span::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform .3s ease-out;
}

.consent-switch input:checked + span {
    background-color: var(--primary-color, #058283);
}

.consent-switch input:checked + span::before {
    transform: translateX(22px);
}

.consent-switch input:focus-visible + span {
    outline: 2px solid var(--primary-t-color, #21333e);
    outline-offset: 2px;
}

/*----------------------------------------------
5. Platzhalter fuer externe Inhalte
----------------------------------------------*/

.consent-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 320px;
    height: 100%;
    padding: 40px 30px;
    background-color: var(--header-bg-color, #21333e);
    font-family: var(--p-font, 'Montserrat', sans-serif);
    font-size: .9rem;
    line-height: 1.6;
    text-align: center;
    color: var(--secondary-p-color, #c0c3d0);
}

.consent-placeholder h3 {
    margin: 0 0 12px;
    font-family: var(--h2-font, 'Poppins', sans-serif);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--white-color, #fff);
}

.consent-placeholder p {
    max-width: 420px;
    margin: 0 0 20px;
}

.consent-placeholder .consent-btn {
    flex: 0 0 auto;
    max-width: 260px;
}

.consent-placeholder-note {
    margin-top: 16px;
    font-size: .78rem;
    opacity: .75;
}

/*----------------------------------------------
6. Responsive
----------------------------------------------*/

@media (max-width: 767.98px) {

    .consent-banner {
        right: 10px;
        bottom: 10px;
        left: 10px;
        max-height: 90vh;
        overflow-y: auto;
        padding: 22px 20px;
    }

    .consent-banner h2 {
        font-size: 1.2rem;
    }

    .consent-btn {
        flex: 1 1 100%;
    }

    .consent-dialog-inner {
        padding: 24px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .consent-btn,
    .consent-switch span,
    .consent-switch span::before {
        transition: none;
    }
}
