/* Cookie consent: banner and preference centre. Same two levels as the main
   site, careers palette. Colours come from variables.css, nothing is written
   twice. */

.ff-cc[hidden] { display: none !important; }

/* ── Level 1: the banner, fixed at the bottom, never blocking ────────── */
.ff-cc-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    background: var(--white);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 24px var(--shadow-medium);
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
    transition: transform .45s cubic-bezier(.16, 1, .3, 1), opacity .35s ease;
    will-change: transform, opacity;
}
.ff-cc-banner.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.ff-cc-banner[hidden] { display: none !important; }

.ff-cc-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 22px 40px;
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}
.ff-cc-banner__text { flex: 1 1 420px; min-width: 0; }
.ff-cc-banner__text h2 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-family: 'Franklin Gothic Demi', Arial, sans-serif;
    color: var(--ink);
}
.ff-cc-banner__text p {
    margin: 0;
    font-size: .92rem;
    line-height: 1.55;
    color: var(--muted-3);
}
.ff-cc-banner__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

/* ── Buttons, shared by both levels ──────────────────────────────────── */
.ff-cc-btn {
    font-family: 'Franklin Gothic Demi', Arial, sans-serif;
    font-size: .9rem;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-2);
    background: var(--white);
    color: var(--ink);
    cursor: pointer;
    transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
.ff-cc-btn:hover { background: var(--surface); }
.ff-cc-btn:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.ff-cc-btn--primary {
    background: var(--violet);
    border-color: var(--violet);
    color: var(--white);
}
.ff-cc-btn--primary:hover { background: var(--violet-dark); border-color: var(--violet-dark); }

.ff-cc-link {
    color: var(--violet);
    text-decoration: underline;
    white-space: nowrap;
}
.ff-cc-link:hover { color: var(--violet-dark); }

/* ── Level 2: the preference centre ──────────────────────────────────── */
.ff-cc-modal {
    position: fixed;
    inset: 0;
    z-index: 950;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.ff-cc-modal[hidden] { display: none !important; }
.ff-cc-modal__backdrop {
    position: absolute;
    inset: 0;
    background: var(--overlay-strong);
}
.ff-cc-modal__panel {
    position: relative;
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 20px 60px var(--shadow-medium);
    width: 100%;
    max-width: 620px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ff-cc-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.ff-cc-modal__head h2 {
    margin: 0;
    font-size: 1.15rem;
    font-family: 'Franklin Gothic Demi', Arial, sans-serif;
    color: var(--ink);
}
.ff-cc-modal__close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    border-radius: 6px;
}
.ff-cc-modal__close:hover { color: var(--ink); background: var(--surface); }
.ff-cc-modal__close:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

.ff-cc-modal__body {
    padding: 20px 24px;
    overflow-y: auto;
}
.ff-cc-modal__intro {
    margin: 0 0 20px;
    font-size: .9rem;
    line-height: 1.55;
    color: var(--muted-3);
}

.ff-cc-cat {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.ff-cc-cat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 6px;
}
.ff-cc-cat__title {
    font-family: 'Franklin Gothic Demi', Arial, sans-serif;
    font-size: .98rem;
    color: var(--ink);
}
.ff-cc-cat__always {
    font-size: .78rem;
    color: var(--muted);
    background: var(--surface);
    border-radius: 999px;
    padding: 3px 10px;
    white-space: nowrap;
}
.ff-cc-cat__desc {
    margin: 0;
    font-size: .86rem;
    line-height: 1.5;
    color: var(--muted-3);
}

/* ── The switch: a real checkbox, styled, never hidden from assistive tech ─── */
.ff-cc-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    cursor: pointer;
}
.ff-cc-switch input {
    position: absolute;
    opacity: 0;
    width: 44px;
    height: 24px;
    margin: 0;
    cursor: pointer;
}
.ff-cc-switch__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.ff-cc-slider {
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: var(--border-2);
    position: relative;
    transition: background-color .2s ease;
}
.ff-cc-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--white);
    transition: transform .2s ease;
}
.ff-cc-switch input:checked + .ff-cc-slider { background: var(--violet); }
.ff-cc-switch input:checked + .ff-cc-slider::after { transform: translateX(20px); }
.ff-cc-switch input:focus-visible + .ff-cc-slider { outline: 2px solid var(--violet); outline-offset: 2px; }

.ff-cc-modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}

@media (max-width: 768px) {
    .ff-cc-banner__inner { padding: 18px 20px; gap: 16px; }
    .ff-cc-banner__actions { width: 100%; }
    .ff-cc-banner__actions .ff-cc-btn { flex: 1 1 auto; }
    .ff-cc-modal__foot { justify-content: stretch; }
    .ff-cc-modal__foot .ff-cc-btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
    .ff-cc-banner { transition: none; }
    .ff-cc-slider, .ff-cc-slider::after { transition: none; }
}
