/* ADITES Consent: Stil für Banner, Einstellungen, Einzelabfrage und Platzhalter (consent.js).
   Farben und Radien kommen aus den Tokens der Seite (style.css :root); fehlen sie, gelten die ADITES-Werte. */

.cc {
    --cc-accent: var(--accent-green, #145a28);
    --cc-accent-dark: var(--accent-green-dark, #0f441e);
    --cc-yellow: var(--accent-yellow, #ffed00);
    --cc-ink: var(--text-primary, #242b4d);
    --cc-muted: var(--text-secondary, #475569);
    --cc-line: var(--border-color, rgba(36, 43, 77, 0.12));
    --cc-radius: var(--radius-lg, 16px);
    --cc-radius-sm: var(--radius-md, 12px);
    box-sizing: border-box;
    font-family: inherit;
    color: var(--cc-ink);
    line-height: 1.5;
    text-align: left;
}

.cc *,
.cc *::before,
.cc *::after {
    box-sizing: border-box;
}

.cc [hidden],
.cc[hidden] {
    display: none !important;
}

.cc p {
    margin: 0;
}

.cc a {
    color: var(--cc-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cc a:hover {
    color: var(--cc-accent-dark);
}

.cc :focus-visible {
    outline: 2px solid var(--cc-accent);
    outline-offset: 2px;
}

html.cc-lock {
    overflow: hidden;
}

/* ---------- Buttons: Ablehnen und Akzeptieren sind gleich gestaltet ---------- */
.cc-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border: 1.5px solid var(--cc-accent);
    border-radius: 10px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.cc-btn--solid {
    background: var(--cc-accent);
    color: #fff;
}

.cc-btn--solid:hover {
    background: var(--cc-accent-dark);
    border-color: var(--cc-accent-dark);
}

.cc-btn--line {
    background: #fff;
    color: var(--cc-accent);
}

.cc-btn--line:hover {
    background: rgba(20, 90, 40, 0.08);
}

/* ---------- Banner ---------- */
.cc-banner {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 1100;
    width: min(440px, calc(100vw - 48px));
    padding: 20px 22px 22px;
    background: #fff;
    border: 1px solid var(--cc-line);
    border-radius: var(--cc-radius);
    box-shadow: 0 24px 60px -18px rgba(36, 43, 77, 0.45), 0 4px 14px rgba(36, 43, 77, 0.1);
    animation: cc-rise 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.cc-banner__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.cc-banner__title svg {
    flex: none;
    width: 22px;
    height: 22px;
    color: var(--cc-accent);
}

.cc-banner__text {
    font-size: 0.9rem;
    color: var(--cc-muted);
}

.cc-banner__links {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--cc-muted);
}

.cc-banner__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.cc-btn--wide {
    grid-column: 1 / -1;
}

@keyframes cc-rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
}

/* ---------- Dialoge ---------- */
.cc-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(36, 43, 77, 0.55);
    animation: cc-fade 0.2s ease both;
}

@keyframes cc-fade {
    from {
        opacity: 0;
    }
}

.cc-modal {
    display: flex;
    flex-direction: column;
    width: min(480px, 100%);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    background: #fff;
    border-radius: var(--cc-radius);
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5);
    outline: none;
}

.cc-modal--wide {
    width: min(620px, 100%);
}

.cc-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px 14px;
    border-bottom: 3px solid var(--cc-yellow);
}

.cc-modal__title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--cc-ink);
}

.cc-x {
    flex: none;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin: -4px -6px 0 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--cc-muted);
    cursor: pointer;
}

.cc-x:hover {
    background: rgba(36, 43, 77, 0.08);
}

.cc-x svg {
    width: 20px;
    height: 20px;
}

.cc-modal__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 22px;
    font-size: 0.92rem;
    color: var(--cc-muted);
}

.cc-modal__body > p + p {
    margin-top: 10px;
}

.cc-lead {
    color: var(--cc-ink);
    margin-bottom: 14px;
}

.cc-small {
    font-size: 0.85rem;
}

.cc-modal__foot {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 22px 18px;
    border-top: 1px solid var(--cc-line);
}

.cc-modal__foot .cc-btn {
    flex: 1 1 140px;
}

/* ---------- Gruppen und Dienste ---------- */
.cc-group {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--cc-line);
}

.cc-lead + .cc-group {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.cc-group__name,
.cc-row__name {
    display: block;
    font-weight: 700;
    color: var(--cc-ink);
}

.cc-group__head {
    margin-bottom: 4px;
}

.cc-group__head p {
    font-size: 0.85rem;
}

.cc-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
}

.cc-row__text {
    min-width: 0;
}

.cc-row__text p {
    margin-top: 2px;
    font-size: 0.88rem;
}

.cc-row__name span {
    font-weight: 500;
    color: var(--cc-muted);
}

.cc-always {
    display: inline-block;
    margin-left: 6px;
    vertical-align: 1px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(20, 90, 40, 0.1);
    color: var(--cc-accent);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.cc-details {
    margin-top: 6px;
    font-size: 0.85rem;
}

.cc-details summary {
    display: inline-block;
    cursor: pointer;
    color: var(--cc-accent);
    font-weight: 600;
}

.cc-details p {
    margin-top: 6px;
}

.cc-legal {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--cc-line);
    font-size: 0.85rem;
}

/* ---------- Schalter ---------- */
.cc-switch {
    position: relative;
    flex: none;
    display: block;
    width: 48px;
    height: 28px;
    margin-top: 2px;
}

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

.cc-track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #b8c1cf;
    transition: background-color 0.2s;
    pointer-events: none;
}

.cc-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.cc-switch input:checked + .cc-track {
    background: var(--cc-accent);
}

.cc-switch input:checked + .cc-track::after {
    transform: translateX(20px);
}

.cc-switch input:focus-visible + .cc-track {
    outline: 2px solid var(--cc-accent);
    outline-offset: 2px;
}

/* ---------- Platzhalter für eingebettete Inhalte ---------- */
.cc-wrap {
    position: relative;
}

.cc-ph {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px 24px;
    background: linear-gradient(160deg, #f6f9f7, #eaf1ec);
    text-align: center;
}

.cc-ph__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff;
    color: var(--cc-accent);
    box-shadow: 0 6px 18px -6px rgba(20, 90, 40, 0.35);
}

.cc-ph__icon svg {
    width: 28px;
    height: 28px;
}

.cc-ph__title {
    font-size: 1.15rem;
    font-weight: 700;
}

.cc-ph__text {
    max-width: 380px;
    font-size: 0.9rem;
    color: var(--cc-muted);
}

.cc-ph .cc-btn {
    margin-top: 4px;
    padding-inline: 26px;
}

.cc-ph__link {
    font-size: 0.85rem;
}

/* ---------- Breite Bildschirme: flache Leiste unten, verdeckt die Buttons im Hero nicht ---------- */
@media (min-width: 1024px) {
    .cc-banner {
        left: 24px;
        right: 24px;
        width: auto;
        max-width: 1120px;
        margin-inline: auto;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 32px;
        align-items: center;
        padding: 18px 24px;
    }

    .cc-banner__title,
    .cc-banner__text,
    .cc-banner__links {
        grid-column: 1;
    }

    .cc-banner__actions {
        grid-column: 2;
        grid-row: 1 / span 3;
        grid-template-columns: repeat(3, auto);
        margin-top: 0;
    }

    .cc-banner__actions .cc-btn {
        min-width: 150px;
    }

    .cc-banner__actions .cc-btn--wide {
        grid-column: auto;
        grid-row: 1;
    }
}

/* hohe Einbettungen auf dem Handy: Inhalt oben statt in der Mitte der langen Fläche */
@media (max-width: 992px) {
    .cc-ph--tall {
        justify-content: flex-start;
        padding-top: 72px;
    }
}

/* ---------- Handy: Banner als Bottom Sheet ---------- */
@media (max-width: 600px) {
    .cc-banner {
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        max-height: 85vh;
        max-height: 85dvh;
        overflow-y: auto;
        padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
        border-width: 1px 0 0;
        border-radius: var(--cc-radius) var(--cc-radius) 0 0;
    }

    .cc-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .cc-modal,
    .cc-modal--wide {
        width: 100%;
        max-height: 92vh;
        max-height: 92dvh;
        border-radius: var(--cc-radius) var(--cc-radius) 0 0;
    }

    .cc-modal__foot {
        padding-bottom: calc(18px + env(safe-area-inset-bottom));
    }

    .cc-modal__foot .cc-btn {
        flex: 1 1 calc(50% - 5px);
        padding-inline: 10px;
    }

    .cc-modal__foot .cc-btn--line {
        order: 3;
        flex-basis: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cc-banner,
    .cc-backdrop {
        animation: none;
    }

    .cc-track,
    .cc-track::after,
    .cc-btn {
        transition: none;
    }
}

@media print {
    .cc-banner,
    .cc-backdrop {
        display: none;
    }
}
