/* Smarter Analytics — cookie consent banner, preferences modal, reopen button. */

.sanl-consent {
    --sanl-accent: #2271b1;
    --sanl-bg: #1f2430;
    --sanl-fg: #f3f4f6;
    --sanl-muted: #b6bcc8;
    --sanl-border: rgba(255, 255, 255, 0.14);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.sanl-consent--light {
    --sanl-bg: #ffffff;
    --sanl-fg: #1f2430;
    --sanl-muted: #5b6372;
    --sanl-border: rgba(0, 0, 0, 0.12);
}

/* ---- Banner ---------------------------------------------------------- */

.sanl-consent__banner {
    position: fixed;
    z-index: 99999;
    background: var(--sanl-bg);
    color: var(--sanl-fg);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
}

/* Must beat the card-placement display:block (higher specificity) and any
   theme display rules — visibility is controlled solely by the attribute. */
.sanl-consent__banner[hidden] {
    display: none !important;
}

.sanl-consent--bottom .sanl-consent__banner {
    left: 0;
    right: 0;
    bottom: 0;
}

.sanl-consent--top .sanl-consent__banner {
    left: 0;
    right: 0;
    top: 0;
}

.sanl-consent--bottom_left .sanl-consent__banner,
.sanl-consent--bottom_right .sanl-consent__banner {
    bottom: 16px;
    max-width: 380px;
    border-radius: 10px;
    display: block;
}

.sanl-consent--bottom_left .sanl-consent__banner {
    left: 16px;
}

.sanl-consent--bottom_right .sanl-consent__banner {
    right: 16px;
}

.sanl-consent--bottom_left .sanl-consent__actions,
.sanl-consent--bottom_right .sanl-consent__actions {
    margin-top: 12px;
}

.sanl-consent__text {
    margin: 0;
    flex: 1 1 280px;
}

.sanl-consent__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* ---- Buttons ---------------------------------------------------------- */

.sanl-consent__btn {
    font: inherit;
    cursor: pointer;
    border: 1px solid var(--sanl-border);
    border-radius: 6px;
    padding: 8px 16px;
    background: transparent;
    color: var(--sanl-fg);
    transition: opacity 0.15s ease;
}

.sanl-consent__btn:hover {
    opacity: 0.85;
}

.sanl-consent__btn--primary {
    background: var(--sanl-accent);
    border-color: var(--sanl-accent);
    color: #fff;
}

.sanl-consent__btn--link {
    border: none;
    background: transparent;
    text-decoration: underline;
    padding: 8px 4px;
}

/* ---- Modal ------------------------------------------------------------ */

.sanl-consent__modal {
    z-index: 100000;
    width: min(92vw, 480px);
    max-height: 85vh;
    overflow-y: auto;
    border: none;
    border-radius: 12px;
    padding: 24px;
    background: var(--sanl-bg);
    color: var(--sanl-fg);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
}

.sanl-consent__modal::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.sanl-consent__modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.sanl-consent__modal h2 {
    margin: 0;
    font-size: 18px;
    color: inherit;
}

.sanl-consent__close {
    font-size: 22px;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--sanl-muted);
    padding: 4px 8px;
}

.sanl-consent__category {
    border-top: 1px solid var(--sanl-border);
    padding: 14px 0;
}

.sanl-consent__category p {
    margin: 6px 0 0;
    color: var(--sanl-muted);
    font-size: 13px;
}

.sanl-consent__category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sanl-consent__category h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: inherit;
}

.sanl-consent__always-on {
    font-size: 12px;
    color: var(--sanl-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sanl-consent__modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* ---- Toggle switch ----------------------------------------------------- */

.sanl-consent__switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex: 0 0 auto;
}

.sanl-consent__switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.sanl-consent__slider {
    position: absolute;
    inset: 0;
    border-radius: 11px;
    background: var(--sanl-border);
    transition: background 0.15s ease;
    pointer-events: none;
}

.sanl-consent__slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s ease;
}

.sanl-consent__switch input:checked + .sanl-consent__slider {
    background: var(--sanl-accent);
}

.sanl-consent__switch input:checked + .sanl-consent__slider::before {
    transform: translateX(18px);
}

.sanl-consent__switch input:focus-visible + .sanl-consent__slider {
    outline: 2px solid var(--sanl-accent);
    outline-offset: 2px;
}

/* ---- Floating reopen button -------------------------------------------- */

.sanl-consent__reopen {
    position: fixed;
    z-index: 99998;
    bottom: 16px;
    left: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--sanl-border);
    background: var(--sanl-bg);
    color: var(--sanl-fg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.sanl-consent--bottom_left .sanl-consent__reopen {
    left: auto;
    right: 16px;
}

.sanl-consent__reopen[hidden] {
    display: none !important;
}
