/* =============================================================================
 * Cookie consent banner + preferences dialog
 * Self-contained: no framework classes, all selectors namespaced .utc-*, and
 * every rule pinned so a page's own CSS can't reshape the banner.
 * ===========================================================================*/

.utc-root {
    --utc-accent: #00FF9D;
    --utc-bg: #0A1512;
    --utc-surface: #0F1F1A;
    --utc-border: #1E3B30;
    --utc-text: #E8F5EF;
    --utc-muted: #8FB6A4;
    --utc-radius: 14px;
    --utc-shadow: 0 18px 50px rgba(0, 0, 0, .55);
    font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.utc-root *,
.utc-root *::before,
.utc-root *::after { box-sizing: border-box; }

/* ── Banner ──────────────────────────────────────────────────────────────── */

.utc-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 2147483000;
    margin: 0 auto;
    max-width: 1120px;
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    background: var(--utc-bg);
    border: 1px solid var(--utc-border);
    border-radius: var(--utc-radius);
    box-shadow: var(--utc-shadow);
    color: var(--utc-text);
    transform: translateY(140%);
    opacity: 0;
    transition: transform .45s cubic-bezier(.16, 1, .3, 1), opacity .3s ease;
}

.utc-banner.utc-in { transform: translateY(0); opacity: 1; }

.utc-banner__icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(0, 255, 157, .1);
    border: 1px solid rgba(0, 255, 157, .25);
    color: var(--utc-accent);
}

.utc-banner__body { flex: 1 1 340px; min-width: 0; }

.utc-banner__title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
}

.utc-banner__text {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--utc-muted);
}

.utc-banner__text a {
    color: var(--utc-accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 255, 157, .35);
}
.utc-banner__text a:hover { border-bottom-color: var(--utc-accent); }

.utc-banner__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.utc-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    border-radius: 9px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .12s ease;
}

.utc-btn:active { transform: translateY(1px); }
.utc-btn:focus-visible { outline: 2px solid var(--utc-accent); outline-offset: 2px; }

.utc-btn--primary { background: var(--utc-accent); color: #04140E; }
.utc-btn--primary:hover { background: #3affb5; }

.utc-btn--secondary {
    background: transparent;
    border-color: var(--utc-border);
    color: var(--utc-text);
}
.utc-btn--secondary:hover { background: rgba(255, 255, 255, .05); border-color: #2c5745; }

.utc-btn--ghost {
    background: transparent;
    color: var(--utc-muted);
    padding: 11px 12px;
}
.utc-btn--ghost:hover { color: var(--utc-text); }

/* ── Preferences dialog ──────────────────────────────────────────────────── */

.utc-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(1, 8, 6, .72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .25s ease;
}

.utc-modal.utc-in { opacity: 1; }

.utc-modal__panel {
    width: 100%;
    max-width: 560px;
    max-height: min(86vh, 720px);
    display: flex;
    flex-direction: column;
    background: var(--utc-bg);
    border: 1px solid var(--utc-border);
    border-radius: var(--utc-radius);
    box-shadow: var(--utc-shadow);
    color: var(--utc-text);
    transform: scale(.96);
    transition: transform .25s cubic-bezier(.16, 1, .3, 1);
}

.utc-modal.utc-in .utc-modal__panel { transform: scale(1); }

.utc-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--utc-border);
}

.utc-modal__head h2 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 650;
    color: #fff;
}

.utc-modal__head p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--utc-muted);
}

.utc-modal__close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--utc-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.utc-modal__close:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.utc-modal__body {
    padding: 8px 24px 4px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.utc-modal__foot {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding: 16px 24px 22px;
    border-top: 1px solid var(--utc-border);
}

/* ── Category rows ───────────────────────────────────────────────────────── */

.utc-cat {
    padding: 16px 0;
    border-bottom: 1px solid rgba(30, 59, 48, .6);
}
.utc-cat:last-child { border-bottom: 0; }

.utc-cat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.utc-cat__name {
    font-size: 14.5px;
    font-weight: 600;
    color: #fff;
}

.utc-cat__desc {
    margin: 7px 0 0;
    font-size: 12.8px;
    line-height: 1.6;
    color: var(--utc-muted);
}

.utc-cat__always {
    font-size: 12px;
    font-weight: 600;
    color: var(--utc-accent);
    white-space: nowrap;
}

/* Toggle */
.utc-switch {
    position: relative;
    flex: 0 0 auto;
    width: 44px;
    height: 25px;
    display: inline-block;
}
.utc-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}
.utc-switch__track {
    position: absolute;
    inset: 0;
    background: #22362E;
    border: 1px solid var(--utc-border);
    border-radius: 999px;
    transition: background .2s ease, border-color .2s ease;
    pointer-events: none;
}
.utc-switch__track::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #7E9C90;
    transition: transform .2s cubic-bezier(.16, 1, .3, 1), background .2s ease;
}
.utc-switch input:checked + .utc-switch__track {
    background: rgba(0, 255, 157, .22);
    border-color: rgba(0, 255, 157, .5);
}
.utc-switch input:checked + .utc-switch__track::before {
    transform: translateX(19px);
    background: var(--utc-accent);
}
.utc-switch input:focus-visible + .utc-switch__track { outline: 2px solid var(--utc-accent); outline-offset: 2px; }

/* ── Floating re-open button (after a decision has been made) ────────────── */

.utc-reopen {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 2147482000;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--utc-surface);
    border: 1px solid var(--utc-border);
    color: var(--utc-muted);
    cursor: pointer;
    opacity: .55;
    transition: opacity .2s ease, color .2s ease, transform .2s ease;
}
.utc-reopen:hover { opacity: 1; color: var(--utc-accent); transform: translateY(-2px); }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 820px) {
    .utc-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
        padding: 18px;
        gap: 16px;
    }
    .utc-banner__icon { display: none; }
    .utc-banner__actions { width: 100%; }
    .utc-banner__actions .utc-btn { flex: 1 1 auto; }
    .utc-modal__foot .utc-btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
    .utc-banner,
    .utc-modal,
    .utc-modal__panel,
    .utc-switch__track::before { transition: none; }
    .utc-banner { transform: none; }
}
