/* ============================================================================
   Cookie Consent — styles (consent.css)
   ----------------------------------------------------------------------------
   Scoped under .cc-* classes; nothing leaks into the host site.
   Follows the site theme: light by default, dark when <body> has .dark
   (your site toggles body.light / body.dark automatically).
   Accent color is injected by consent.js from config (--cc-accent).
   ========================================================================== */

:root {
    --cc-accent: #4C6FFF;
    --cc-accent-2: #213E76;
    --cc-accent-ring: rgba(76, 111, 255, 0.25);
    --cc-surface: #FFFFFF;
    --cc-ink: #17233B;
    --cc-muted: #5B6B85;
    --cc-border: #E4E8F1;
    --cc-field: #F5F7FB;
    --cc-shadow: 0 18px 50px rgba(10, 20, 45, 0.22);
    --cc-radius: 16px;
    --cc-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --cc-z: 99000;
    /* Distance from the bottom of the screen — raised so the site's bottom
       blur effect never covers the popup. Adjust freely. */
    --cc-offset: 80px;
}

body.dark {
    --cc-surface: #1B1D23;
    --cc-ink: #F2F4F8;
    --cc-muted: #9AA4B5;
    --cc-border: rgba(255, 255, 255, 0.13);
    --cc-field: #23262d;
    --cc-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

/* Lock page scroll while the preferences modal is open */
html.cc-lock,
html.cc-lock body {
    overflow: hidden !important;
}

.cc-banner__icon svg,
.cc-close svg{
    margin: auto;
}

/* ---------------------------------------------------------------------------
   Floating banner (bottom-left card)
   ------------------------------------------------------------------------- */
.cc-banner {
    position: fixed;
    right: 18px;
    bottom: var(--cc-offset);
    z-index: var(--cc-z);
    width: min(calc(100vw - 36px), 400px);
    background: var(--cc-surface);
    color: var(--cc-ink);
    border: 1px solid var(--cc-border);
    border-top: 3px solid var(--cc-accent);
    border-radius: var(--cc-radius);
    box-shadow: var(--cc-shadow);
    padding: 20px 22px;
    opacity: 0;
    transform: translateY(24px);
    transition: transform 0.5s var(--cc-ease), opacity 0.5s var(--cc-ease);
}

.cc-banner.cc-show {
    opacity: 1;
    transform: translateY(0);
}

.cc-banner__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.cc-banner__logo {
    height: 26px;
    width: auto;
}

.cc-banner__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
    background: rgba(76, 111, 255, 0.12);
    color: var(--cc-accent);
}

.cc-banner__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--cc-ink);
    line-height: 1.3;
}

.cc-banner__desc {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--cc-muted);
}

.cc-banner__links {
    margin: 0 0 14px;
    display: flex;
    gap: 8px;
    font-size: 12px;
}

.cc-banner__links a {
    color: var(--cc-accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cc-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

/* ---------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.cc-btn {
    appearance: none;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
        transform 0.15s ease, box-shadow 0.2s ease;
}

.cc-btn:active {
    transform: translateY(1px);
}

.cc-btn:focus-visible {
    outline: 3px solid var(--cc-accent-ring);
    outline-offset: 2px;
}

.cc-btn--primary {
    background: linear-gradient(135deg, var(--cc-accent), var(--cc-accent-2));
    color: #fff;
}

.cc-btn--primary:hover {
    filter: brightness(1.12);
    box-shadow: 0 8px 18px rgba(76, 111, 255, 0.35);
}

.cc-btn--outline {
    background: transparent;
    color: var(--cc-ink);
    border-color: var(--cc-border);
}

.cc-btn--outline:hover {
    border-color: var(--cc-accent);
    color: var(--cc-accent);
}

.cc-btn--ghost {
    background: var(--cc-field);
    color: var(--cc-ink);
}

.cc-btn--ghost:hover {
    background: var(--cc-border);
}

/* ---------------------------------------------------------------------------
   Preferences modal
   ------------------------------------------------------------------------- */
.cc-modal-wrap {
    position: fixed;
    inset: 0;
    z-index: calc(var(--cc-z) + 5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* The hidden attribute must always win over display:flex above. */
.cc-modal-wrap[hidden] {
    display: none !important;
}

.cc-overlay {
    position: absolute;
    inset: 0;
    background: rgba(6, 10, 20, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.35s var(--cc-ease);
    cursor: pointer;
}

.cc-modal-wrap.cc-show .cc-overlay {
    opacity: 1;
}

.cc-modal {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(100%, 560px);
    max-height: min(86vh, 680px);
    background: var(--cc-surface);
    color: var(--cc-ink);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    box-shadow: var(--cc-shadow);
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    transition: transform 0.4s var(--cc-ease), opacity 0.4s var(--cc-ease);
}

.cc-modal-wrap.cc-show .cc-modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.cc-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--cc-border);
}

.cc-modal__head h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--cc-ink);
}

.cc-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    cursor: pointer;
    line-height: 0;
    background: var(--cc-field);
    border: 1px solid var(--cc-border);
    color: var(--cc-ink);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cc-close:hover {
    background: var(--cc-accent);
    border-color: var(--cc-accent);
    color: #fff;
}

.cc-close:focus-visible {
    outline: 3px solid var(--cc-accent-ring);
    outline-offset: 2px;
}

.cc-modal__body {
    overflow-y: auto;
    padding: 16px 20px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.cc-modal__intro {
    margin: 0 0 14px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--cc-muted);
}

.cc-modal__intro a {
    color: var(--cc-accent);
    font-weight: 600;
}

/* Category rows */
.cc-cat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--cc-border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: var(--cc-surface);
}

.cc-cat__text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cc-cat__name {
    font-size: 14px;
    font-weight: 700;
    color: var(--cc-ink);
}

.cc-cat__desc {
    font-size: 12px;
    line-height: 1.55;
    color: var(--cc-muted);
}

.cc-cat__always {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    color: #1B8A4C;
    background: rgba(27, 138, 76, 0.12);
    padding: 5px 11px;
    border-radius: 999px;
}

body.dark .cc-cat__always {
    color: #4ADE80;
    background: rgba(74, 222, 128, 0.12);
}

/* Toggle switch */
.cc-switch {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.cc-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    margin: 0;
    cursor: pointer;
    z-index: 2;
}

.cc-switch__track {
    display: block;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: var(--cc-border);
    position: relative;
    transition: background 0.25s ease;
}

.cc-switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s var(--cc-ease);
}

.cc-switch input:checked+.cc-switch__track {
    background: var(--cc-accent);
}

.cc-switch input:checked+.cc-switch__track::after {
    transform: translateX(20px);
}

.cc-switch input:focus-visible+.cc-switch__track {
    outline: 3px solid var(--cc-accent-ring);
    outline-offset: 3px;
}

.cc-modal__foot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    padding: 14px 20px;
    border-top: 1px solid var(--cc-border);
}

/* ---------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .cc-banner {
        left: 10px;
        right: 10px;
        bottom: var(--cc-offset);
        width: auto;
        padding: 16px;
    }

    .cc-banner__actions .cc-btn {
        flex: 1 1 100%;
    }

    .cc-modal-wrap {
        padding: 0;
    }

    .cc-modal {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .cc-modal__foot .cc-btn {
        flex: 1 1 100%;
    }
}

/* ---------------------------------------------------------------------------
   Accessibility
   ------------------------------------------------------------------------- */
@media (prefers-contrast: more) {

    .cc-banner,
    .cc-modal {
        border-width: 2px;
    }

    .cc-banner__desc,
    .cc-modal__intro,
    .cc-cat__desc {
        color: var(--cc-ink);
    }
}

@media (prefers-reduced-motion: reduce) {

    .cc-banner,
    .cc-modal,
    .cc-overlay,
    .cc-btn,
    .cc-switch__track,
    .cc-switch__track::after {
        transition-duration: 0.01ms !important;
    }
}