/* Cookie consent banner — bottom-sheet style. Always-visible until the
   user makes a choice. Equal-prominence Accept all / Reject all (no
   dark pattern). Customize panel reveals granular toggles inline. */

#cc-banner {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 9998;                              /* below toasts (9999) */
    display: flex;
    justify-content: center;
    pointer-events: none;
    padding: 14px;
    animation: cc-slide-up 0.3s cubic-bezier(.2,.8,.2,1);
}

@keyframes cc-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

#cc-banner .cc-card {
    pointer-events: auto;
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    box-shadow: 0 12px 40px -8px rgba(0, 0, 0, 0.65);
    padding: 18px 22px 16px;
    width: 100%;
    max-width: 660px;
    font-family: 'Manrope', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
}

.cc-headline {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 6px;
    color: #f8fafc;
}

.cc-body {
    font-size: 0.86rem;
    color: rgba(226, 232, 240, 0.85);
    margin: 0 0 14px;
}

.cc-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.cc-btn {
    appearance: none;
    border: 0;
    border-radius: 10px;
    padding: 9px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: filter 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.cc-btn:active { transform: scale(0.97); }
.cc-btn:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

.cc-btn-primary {
    background: #38bdf8;
    color: #0f172a;
}
.cc-btn-primary:hover { filter: brightness(1.06); }

.cc-btn-secondary {
    background: rgba(148, 163, 184, 0.16);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.25);
}
.cc-btn-secondary:hover { background: rgba(148, 163, 184, 0.22); }

.cc-btn-link {
    background: transparent;
    color: rgba(148, 163, 184, 1);
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 9px 8px;
}
.cc-btn-link:hover { color: #38bdf8; }

.cc-customize {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cc-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.cc-row-text {
    flex: 1;
    cursor: pointer;
    user-select: none;
}

.cc-row-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
}
.cc-row-desc {
    font-size: 0.78rem;
    color: rgba(148, 163, 184, 0.95);
    margin-top: 3px;
    line-height: 1.45;
}

.cc-toggle-locked {
    font-size: 0.75rem;
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.1);
    border-radius: 6px;
    padding: 4px 10px;
    flex-shrink: 0;
    align-self: center;
}

input[type="checkbox"].cc-toggle {
    appearance: none;
    -webkit-appearance: none;
    width: 38px;
    height: 22px;
    border-radius: 22px;
    background: rgba(148, 163, 184, 0.25);
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    align-self: center;
    transition: background 0.18s ease;
    border: 1px solid rgba(148, 163, 184, 0.2);
}
input[type="checkbox"].cc-toggle::after {
    content: '';
    position: absolute;
    inset: 2px auto 2px 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #f8fafc;
    transition: transform 0.18s ease;
}
input[type="checkbox"].cc-toggle:checked {
    background: #38bdf8;
}
input[type="checkbox"].cc-toggle:checked::after {
    transform: translateX(16px);
}
input[type="checkbox"].cc-toggle:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

.cc-customize-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.cc-footer {
    margin-top: 12px;
    text-align: center;
    font-size: 0.78rem;
}
.cc-footer a {
    color: rgba(148, 163, 184, 0.95);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cc-footer a:hover { color: #38bdf8; }

/* Light theme — match the rest of the app's light palette. */
body.theme-light #cc-banner .cc-card {
    background: #f8fafc;
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 12px 40px -8px rgba(0, 0, 0, 0.18);
}
body.theme-light .cc-headline { color: #0f172a; }
body.theme-light .cc-body { color: rgba(15, 23, 42, 0.78); }
body.theme-light .cc-row-title { color: #0f172a; }
body.theme-light .cc-row-desc { color: rgba(15, 23, 42, 0.65); }
body.theme-light .cc-btn-secondary { background: rgba(15, 23, 42, 0.08); color: #0f172a; border-color: rgba(15, 23, 42, 0.12); }
body.theme-light .cc-btn-secondary:hover { background: rgba(15, 23, 42, 0.13); }
body.theme-light .cc-btn-link { color: rgba(15, 23, 42, 0.7); }
body.theme-light .cc-btn-link:hover { color: #0284c7; }
body.theme-light .cc-toggle-locked { background: rgba(15, 23, 42, 0.08); color: rgba(15, 23, 42, 0.7); }
body.theme-light input[type="checkbox"].cc-toggle { background: rgba(15, 23, 42, 0.18); border-color: rgba(15, 23, 42, 0.12); }
body.theme-light .cc-customize { border-top-color: rgba(15, 23, 42, 0.12); }
body.theme-light .cc-footer a { color: rgba(15, 23, 42, 0.7); }

/* Mobile — stack actions vertically, full-width buttons. */
@media (max-width: 540px) {
    #cc-banner { padding: 10px; }
    #cc-banner .cc-card { padding: 16px 16px 14px; }
    .cc-actions { flex-direction: column; align-items: stretch; }
    .cc-btn { width: 100%; }
    .cc-btn-link { width: auto; align-self: center; padding-top: 6px; }
    .cc-row { flex-direction: row; }      /* Keep label + toggle side-by-side */
}

/* Reduced motion — respect the user's preference. */
@media (prefers-reduced-motion: reduce) {
    #cc-banner { animation: none; }
}
