/* Privacy / Cookie Consent Framework — Phase 1 — visual layer. */

.bm-privacy { font-family: var(--font-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif); }

/* ------- banner -------
   Compact bottom-left corner card so it never blocks dashboard content
   (was a full-width bottom bar covering the page). Slim bottom sheet on
   mobile — see the media query below. */

.bm-privacy-banner {
    position: fixed; left: 20px; right: auto; bottom: 20px;
    width: min(420px, calc(100vw - 40px));
    transform: translateY(180%);
    transition: transform 320ms cubic-bezier(.2, .8, .2, 1);
    z-index: 2147483640;
    background: #ffffff;
    border: 1px solid var(--bm-line, #e8eaf0);
    border-radius: 16px;
    box-shadow: 0 16px 44px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(15, 23, 42, 0.06);
}
body.bm-privacy-banner-open .bm-privacy-banner { transform: translateY(0); }

.bm-privacy-banner__inner {
    padding: 16px 18px;
    display: flex; flex-direction: column; align-items: stretch; gap: 13px;
}
.bm-privacy-banner__copy { min-width: 0; }
.bm-privacy-banner__title { font-weight: 700; font-size: .95rem; color: #0f172a; margin-bottom: 4px; }
.bm-privacy-banner__text  { font-size: .82rem; color: #475569; line-height: 1.5; margin: 0; }
.bm-privacy-banner__text a { color: var(--bm-accent, #4f46e5); text-decoration: underline; }
.bm-privacy-banner__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ------- buttons ------- */

.bm-btn {
    appearance: none; border: 1px solid transparent; border-radius: 8px;
    padding: 8px 14px; font-size: .82rem; font-weight: 600; line-height: 1.2;
    cursor: pointer; transition: transform .12s ease, background .12s ease, color .12s ease;
}
.bm-btn:active { transform: translateY(1px); }
.bm-btn-primary   { background: #4f46e5; color: #ffffff; }
.bm-btn-primary:hover  { background: #4338ca; }
.bm-btn-secondary { background: #f1f5f9; color: #0f172a; border-color: #e2e8f0; }
.bm-btn-secondary:hover { background: #e2e8f0; }
.bm-btn-ghost     { background: transparent; color: #475569; }
.bm-btn-ghost:hover { background: #f1f5f9; color: #0f172a; }

/* ------- preference center ------- */

.bm-privacy-center { display: none; }
body.bm-privacy-center-open .bm-privacy-center { display: block; }

.bm-privacy-center { position: fixed; inset: 0; z-index: 2147483645; }
.bm-privacy-center__backdrop {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}
.bm-privacy-center__panel {
    position: relative;
    max-width: 560px; margin: 5vh auto;
    background: #ffffff; border-radius: 14px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .25);
    max-height: 90vh; display: flex; flex-direction: column;
    overflow: hidden;
}
.bm-privacy-center__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px; border-bottom: 1px solid #e2e8f0;
}
.bm-privacy-center__header h2 { font-size: 1.05rem; margin: 0; color: #0f172a; }
.bm-privacy-center__close {
    background: transparent; border: none; font-size: 1.6rem; color: #64748b;
    cursor: pointer; padding: 0 6px; line-height: 1;
}
.bm-privacy-center__intro { padding: 14px 22px 4px; color: #475569; font-size: .85rem; }
.bm-privacy-center__categories { padding: 6px 22px 14px; margin: 0; list-style: none; overflow-y: auto; flex: 1 1 auto; }
.bm-privacy-center__footer {
    display: flex; gap: 8px; flex-wrap: wrap;
    padding: 14px 22px; border-top: 1px solid #e2e8f0; background: #f8fafc;
}
.bm-privacy-center__footer .bm-btn-primary { margin-left: auto; }

/* ------- category card + toggle ------- */

.bm-privacy-cat {
    border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 12px 14px; margin-bottom: 10px;
}
.bm-privacy-cat__head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.bm-privacy-cat__name { font-weight: 600; color: #0f172a; font-size: .9rem; }
.bm-privacy-cat__desc { margin: 6px 0 0; font-size: .78rem; color: #64748b; line-height: 1.5; }
.bm-privacy-cat.is-locked .bm-privacy-cat__name::after {
    content: 'Always on'; margin-left: 8px; font-size: .65rem;
    background: #e0e7ff; color: #4338ca; padding: 2px 6px; border-radius: 6px; font-weight: 700;
}

.bm-toggle { position: relative; display: inline-block; width: 40px; height: 22px; flex: 0 0 auto; }
.bm-toggle input { opacity: 0; width: 0; height: 0; }
.bm-toggle__slider {
    position: absolute; inset: 0; cursor: pointer;
    background: #cbd5e1; border-radius: 22px; transition: background .2s;
}
.bm-toggle__slider::before {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px; background: #ffffff; border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .25);
}
.bm-toggle input:checked + .bm-toggle__slider { background: #4f46e5; }
.bm-toggle input:checked + .bm-toggle__slider::before { transform: translateX(18px); }
.bm-toggle.is-locked .bm-toggle__slider { background: #94a3b8; cursor: not-allowed; }

/* ------- marketing sub-channels (Phase 3) ------- */

.bm-privacy-subs {
    list-style: none; margin: 12px 0 0; padding: 0 0 0 6px;
    border-left: 2px solid #e2e8f0;
}
.bm-privacy-sub { margin-bottom: 8px; }
.bm-privacy-sub:last-child { margin-bottom: 0; }
.bm-privacy-sub__label {
    display: flex; gap: 10px; cursor: pointer;
    padding: 6px 8px; border-radius: 6px;
    transition: background .12s;
}
.bm-privacy-sub__label:hover { background: #f8fafc; }
.bm-privacy-sub__label input[type="checkbox"] {
    margin-top: 3px; flex: 0 0 auto;
    accent-color: #4f46e5;
}
.bm-privacy-sub__label input:disabled { opacity: 0.4; cursor: not-allowed; }
.bm-privacy-sub__title { font-size: .82rem; color: #0f172a; font-weight: 600; }
.bm-privacy-sub__desc  { font-size: .72rem; color: #64748b; margin-top: 2px; line-height: 1.4; }

/* ------- responsive ------- */

@media (max-width: 640px) {
    /* Full-width bottom sheet on phones. */
    .bm-privacy-banner {
        left: 0; right: 0; bottom: 0;
        width: 100%;
        border-radius: 16px 16px 0 0;
        border-left: 0; border-right: 0; border-bottom: 0;
    }
    .bm-privacy-banner__inner { gap: 12px; }
    .bm-privacy-banner__actions { justify-content: stretch; }
    .bm-privacy-banner__actions .bm-btn { flex: 1 1 auto; }
    .bm-privacy-center__panel { margin: 0; max-height: 100vh; height: 100vh; border-radius: 0; }
}
