/* Cookie consent banner, shared by the start page and /partner.
   Moved out of style.css on 13.09.2026: /partner deliberately does not
   load style.css, and the banner must look the same on both pages.
   Needs the page variables --color-*, --font-*, --radius-lg,
   --shadow-medium and the .btn-primary / .btn-secondary buttons. */

/* ═══════════════════════════════════════════════════════════════════════════
   COOKIE-EINWILLIGUNG (12.09.2026)

   ⚠️ ABLEHNEN UND ANNEHMEN SIND GLEICH GEWICHTET. Beide sind gefüllte Pillen
   derselben Grösse; nur die Farbe unterscheidet sie. Der Vorgänger
   (cookieconsent-3) hatte genau einen Knopf — das war ein Hinweis und keine
   Einwilligung. Wer hier "Nur notwendige" kleiner oder blasser macht, stellt
   diesen Zustand wieder her.

   ⚠️ Der Erklärtext nutzt NICHT --color-text-secondary (#86868b): das sind
   3.62:1 auf Weiss und damit unter 4.5:1. Gemessen für --cc-text-2 (#6b6b70):
   5.30:1 auf Weiss, 4.87:1 auf #f5f5f7. Bei einem Text, der eine Einwilligung
   trägt, ist schwer lesbar nicht nur unschön.
   ═══════════════════════════════════════════════════════════════════════════ */

.cc-banner {
    --cc-text-2: #6b6b70;

    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 10000;
    width: 420px;
    max-width: calc(100vw - 40px);
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-medium);
    font-family: var(--font-family);
    color: var(--color-text);
    padding: 22px 24px 20px;
    /* Vom Fuss her eingeblendet. transform statt top/bottom, damit der
       Browser nicht bei jedem Bild neu umbricht. */
    transform: translateY(calc(100% + 30px));
    opacity: 0;
    transition: transform .45s cubic-bezier(.22,.61,.36,1), opacity .35s ease;
}

.cc-banner.is-visible { transform: translateY(0); opacity: 1; }

/* ⚠️ [hidden] allein reicht nicht: .cc-banner setzt display über position/
   transform nicht zurück, und ein sichtbar gebliebener Banner über dem Inhalt
   wäre schlimmer als gar keiner. */
.cc-banner[hidden] { display: none !important; }

.cc-title {
    font-size: var(--font-md);
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.3;
}

.cc-text {
    font-size: var(--font-xs);
    line-height: 1.55;
    color: var(--cc-text-2);
    margin: 0 0 18px;
}

.cc-text a { color: var(--color-primary); text-decoration: none; }
.cc-text a:hover { text-decoration: underline; }

/* ── Die Knöpfe ─────────────────────────────────────────────────────────── */
.cc-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.cc-actions .btn-primary,
.cc-actions .btn-secondary { flex: 1 1 0; min-width: 140px; padding: 11px 18px; }

/* Der dritte Weg steht bewusst ABSEITS der beiden gleichwertigen Knöpfe:
   "Einstellungen" ist keine dritte Antwort auf dieselbe Frage. */
.cc-link {
    display: block;
    width: 100%;
    margin-top: 12px;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: var(--font-xs);
    color: var(--cc-text-2);
    text-decoration: underline;
    cursor: pointer;
    text-align: center;
}
/* ⚠️ Nackte <button> werden in bs23_white_chat.css global grün beim Hover.
   Hintergrund UND Farbe hier selbst setzen, sonst springt der Link grün an. */
.cc-link:hover { background: none; color: var(--color-text); }

/* ── Die Einstellungen ──────────────────────────────────────────────────── */
.cc-detail { margin: 0 0 18px; }

.cc-group {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-top: 1px solid var(--color-border);
}
.cc-group:last-child { border-bottom: 1px solid var(--color-border); }

.cc-group-body { flex: 1; min-width: 0; }

.cc-group-name {
    display: block;
    font-size: var(--font-xs);
    font-weight: 600;
    margin-bottom: 3px;
}

.cc-group-desc {
    display: block;
    font-size: var(--font-xs);
    line-height: 1.5;
    color: var(--cc-text-2);
}

.cc-always {
    font-size: var(--font-xs);
    color: var(--cc-text-2);
    white-space: nowrap;
    padding-top: 2px;
}

/* Schalter. Ein echtes <input type=checkbox> darunter — der Schalter ist nur
   sein Aussehen, damit Tastatur und Vorleseprogramme unverändert arbeiten. */
.cc-switch { position: relative; flex-shrink: 0; width: 46px; height: 28px; }

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

.cc-switch span {
    position: absolute;
    inset: 0;
    background: #d2d2d7;
    border-radius: 980px;
    transition: background .25s ease;
    pointer-events: none;
}

.cc-switch span::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform .25s cubic-bezier(.22,.61,.36,1);
}

.cc-switch input:checked + span { background: var(--color-primary); }
.cc-switch input:checked + span::after { transform: translateX(18px); }
.cc-switch input:focus-visible + span { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.cc-switch input:disabled { cursor: not-allowed; }

/* ── Der Weg zurück in die Einstellungen, nachdem entschieden wurde ─────── */
.cc-reopen {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.cc-reopen:hover { background: none; color: var(--color-primary); }

/* ── Schmale Lage ───────────────────────────────────────────────────────── */
@media (max-width: 520px) {
    .cc-banner {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        max-width: none;
        padding: 20px 18px 18px;
        /* Auf einem Telefon kann die Liste länger sein als das Fenster. */
        max-height: calc(100vh - 24px);
        overflow-y: auto;
    }
    .cc-actions .btn-primary,
    .cc-actions .btn-secondary { flex: 1 1 100%; }
}

/* Wer Bewegung abbestellt hat, bekommt den Banner ohne Fahrt — aber er
   erscheint trotzdem. */
@media (prefers-reduced-motion: reduce) {
    .cc-banner { transition: none; }
}

/* In the page footer the button sits among <a> links styled by
   `.footer-links a` (block, --font-sm, 85 % white, 6px padding). A <button>
   gets none of that and stood out at 18px pure white, inline. */
.footer-links .cc-reopen {
    display: block;
    font-size: var(--font-sm);
    color: rgba(255, 255, 255, 0.85);
    padding: 6px 0;
    line-height: inherit;   /* <button> does not inherit it by default */
    text-align: left;
    transition: var(--transition);
}
.footer-links .cc-reopen:hover { background: none; color: #fff; }
