/* ==========================================================================
   Cookie consent banner + preferences dialog (website and login pages).
   Dark glass to match the website header; brand colours from brand.css.
   ========================================================================== */
#cookieConsent {
    --cc-bg: rgba(10, 14, 28, .9);
    --cc-line: rgba(255, 255, 255, .12);
    --cc-text: #cbd5e1;
    --cc-muted: #94a3b8;
    --cc-gradient: linear-gradient(135deg, var(--brand-500, #6366f1), var(--brand-accent, #0ea5e9));
    font-family: inherit;
}

.cc-banner {
    position: fixed; z-index: 1090; left: 50%; bottom: 1.25rem; transform: translateX(-50%);
    width: min(1080px, calc(100% - 2rem));
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1.1rem 1.4rem;
    padding: 1.15rem 1.35rem; border-radius: 22px; color: var(--cc-text);
    background: var(--cc-bg); box-shadow: 0 0 0 1px var(--cc-line) inset, 0 30px 70px -20px rgba(0, 0, 0, .75);
    backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
    animation: cc-rise .45s cubic-bezier(.2, .8, .2, 1);
}
.cc-banner[hidden] { display: none; }
.cc-banner::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--brand-500, #6366f1), var(--brand-accent, #0ea5e9), transparent);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); opacity: .7;
}
@keyframes cc-rise { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }

.cc-banner-icon {
    width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-size: 1.25rem;
    background: var(--cc-gradient); box-shadow: 0 10px 24px -10px var(--brand-500, #6366f1);
}
.cc-title { margin: 0 0 .25rem; font-size: 1.02rem; font-weight: 700; color: #fff; letter-spacing: -.01em; }
.cc-text { margin: 0; font-size: .87rem; line-height: 1.55; color: var(--cc-text); }
.cc-text strong { color: #fff; font-weight: 600; }
.cc-text a, .cc-policy-link { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.cc-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; }
.cc-btn {
    border: 0; border-radius: 999px; padding: .62rem 1.15rem; font: inherit; font-size: .88rem; font-weight: 600; white-space: nowrap; cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.cc-btn:active { transform: translateY(1px); }
.cc-btn:focus-visible, .cc-close:focus-visible, .cc-switch input:focus-visible + .cc-slider { outline: 2px solid #fff; outline-offset: 2px; }
.cc-btn-primary { color: #fff; background: var(--cc-gradient); box-shadow: 0 10px 24px -10px var(--brand-500, #6366f1); }
.cc-btn-primary:hover { filter: brightness(1.08); }
.cc-btn-ghost { color: #fff; background: rgba(255, 255, 255, .06); box-shadow: 0 0 0 1px var(--cc-line) inset; }
.cc-btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.cc-btn[disabled] { opacity: .6; cursor: progress; }

@media (max-width: 900px) {
    .cc-banner { grid-template-columns: auto minmax(0, 1fr); bottom: .75rem; }
    .cc-banner > .cc-actions { grid-column: 1 / -1; justify-content: stretch; }
    .cc-banner > .cc-actions .cc-btn { flex: 1 1 auto; }
}

/* ---------- preferences dialog ---------- */
.cc-dialog {
    width: min(620px, calc(100% - 2rem)); max-height: calc(100% - 2rem); padding: 0; border: 0; border-radius: 22px; color: var(--cc-text);
    background: #0b1020; box-shadow: 0 0 0 1px var(--cc-line), 0 40px 90px -20px rgba(0, 0, 0, .85); overflow: auto;
}
.cc-dialog::backdrop { background: rgba(3, 6, 15, .65); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.cc-dialog[open] { animation: cc-pop .25s ease-out; }
@keyframes cc-pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.cc-dialog-head { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; padding: 1.4rem 1.5rem 1rem; border-bottom: 1px solid var(--cc-line); }
.cc-close { flex: none; width: 36px; height: 36px; border-radius: 10px; border: 0; color: #fff; background: rgba(255, 255, 255, .06); cursor: pointer; }
.cc-close:hover { background: rgba(255, 255, 255, .12); }
.cc-categories { padding: .5rem 1.5rem; }
.cc-category { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.25rem; padding: 1rem 0; }
.cc-category + .cc-category { border-top: 1px solid var(--cc-line); }
.cc-category-label { display: block; color: #fff; font-weight: 600; font-size: .95rem; margin-bottom: .2rem; }
.cc-category p { margin: 0; font-size: .84rem; line-height: 1.5; color: var(--cc-muted); }
.cc-always { flex: none; font-size: .74rem; font-weight: 700; letter-spacing: .04em; padding: .3rem .65rem; border-radius: 999px; color: #fff; background: var(--cc-gradient); }
.cc-dialog-foot { display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; justify-content: space-between; padding: 1rem 1.5rem 1.4rem; border-top: 1px solid var(--cc-line); }

/* toggle switch */
.cc-switch { position: relative; flex: none; width: 48px; height: 28px; margin-top: .1rem; cursor: pointer; }
.cc-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.cc-slider { position: absolute; inset: 0; border-radius: 999px; background: rgba(255, 255, 255, .14); transition: background .2s ease; }
.cc-slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); transition: transform .2s ease; }
.cc-switch input:checked + .cc-slider { background: var(--cc-gradient); }
.cc-switch input:checked + .cc-slider::after { transform: translateX(20px); }

@media (prefers-reduced-motion: reduce) {
    .cc-banner, .cc-dialog[open] { animation: none; }
}
