/* =============================================================================
   Banner del consenso delle statistiche (kit StatsKitDSMC). Prefisso stk-.
   Ha sempre il suo fondo e il suo testo (leggibile su qualsiasi pagina); i colori
   sono variabili che il Sito puo' ridare per il suo chiaro/scuro: le nostre sono
   dentro :where(), quindi qualsiasi regola del Sito su html o :root vince.
   ============================================================================= */
:where(:root) {
    --stk-bg: #ffffff;
    --stk-fg: #1d1b22;
    --stk-muted: #4d4957;
    --stk-accent: #3b2f6b;
    --stk-accent-fg: #ffffff;
    --stk-border: rgba(29, 27, 34, .18);
    --stk-shadow: 0 10px 40px rgba(0, 0, 0, .22);
}

@media (prefers-color-scheme: dark) {
    :where(:root:not([data-theme="light"]):not([data-bs-theme="light"])) {
        --stk-bg: #1f1c27;
        --stk-fg: #f3f0f8;
        --stk-muted: #c9c3d6;
        --stk-accent: #d9ccff;
        --stk-accent-fg: #1f1c27;
        --stk-border: rgba(243, 240, 248, .22);
    }
}

:where(:root[data-theme="dark"], :root[data-bs-theme="dark"]) {
    --stk-bg: #1f1c27;
    --stk-fg: #f3f0f8;
    --stk-muted: #c9c3d6;
    --stk-accent: #d9ccff;
    --stk-accent-fg: #1f1c27;
    --stk-border: rgba(243, 240, 248, .22);
}

.stk-consent {
    position: fixed;
    z-index: 2147483000;
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: 560px;
    margin: 0 auto;
    padding: 18px 20px;
    box-sizing: border-box;
    background: var(--stk-bg);
    color: var(--stk-fg);
    border: 1px solid var(--stk-border);
    border-radius: 14px;
    box-shadow: var(--stk-shadow);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    text-align: left;
}

.stk-consent[hidden], .stk-consent [hidden], .stk-reopen[hidden] {
    display: none !important;
}

.stk-title {
    margin: 0 0 6px;
    font: 600 17px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--stk-fg);
    letter-spacing: 0;
    text-transform: none;
}

.stk-text {
    margin: 0 0 12px;
    color: var(--stk-muted);
}

.stk-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0 0 12px;
    color: var(--stk-fg);
    cursor: pointer;
}

.stk-check input {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    flex: none;
    accent-color: var(--stk-accent);
}

/* "Rifiuta" e "Accetta" affiancati e sempre della stessa grandezza (anche a 360 px), "Scegli" sotto */
.stk-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stk-actions > .stk-btn--quiet,
.stk-actions > [data-stats-save] {
    grid-column: 1 / -1;
}

/* "Accetta" e "Rifiuta" uguali: stessa forma, stesso colore, stessa grandezza */
.stk-btn {
    min-width: 0;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid var(--stk-accent);
    border-radius: 10px;
    background: var(--stk-accent);
    color: var(--stk-accent-fg);
    font: 600 15px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    cursor: pointer;
}

.stk-btn--quiet {
    background: transparent;
    color: var(--stk-fg);
    border-color: var(--stk-border);
}

.stk-btn:focus-visible, .stk-reopen:focus-visible, .stk-link a:focus-visible, .stk-check input:focus-visible {
    outline: 3px solid var(--stk-accent);
    outline-offset: 2px;
}

.stk-link {
    margin: 10px 0 0;
    font-size: 14px;
}

.stk-link a {
    color: var(--stk-fg);
    text-decoration: underline;
}

.stk-reopen {
    position: fixed;
    z-index: 2147482999;
    left: 12px;
    bottom: 12px;
    padding: 6px 12px;
    border: 1px solid var(--stk-border);
    border-radius: 999px;
    background: var(--stk-bg);
    color: var(--stk-fg);
    font: 500 13px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    opacity: .85;
    cursor: pointer;
}

.stk-reopen:hover {
    opacity: 1;
}

@media print {
    .stk-consent, .stk-reopen {
        display: none !important;
    }
}
