/* ====================================================================
   INVIMPRESA - Cookie consent (self-hosted, GDPR / Linee guida Garante)
   ==================================================================== */

:root {
    --inv-cc-bg: #ffffff;
    --inv-cc-fg: #12203f;
    --inv-cc-muted: #5b6780;
    --inv-cc-accent: #010B2B;
    --inv-cc-accent-2: #c9a227;
    --inv-cc-border: #e2e6ee;
}

.inv-cc-hidden { display: none !important; }

/* ---------- Banner ---------- */
.inv-cc-banner {
    position: fixed;
    z-index: 99999;
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: 980px;
    margin: 0 auto;
    background: var(--inv-cc-bg);
    color: var(--inv-cc-fg);
    border: 1px solid var(--inv-cc-border);
    border-radius: 10px;
    box-shadow: 0 18px 48px rgba(1, 11, 43, .28);
    padding: 22px 24px;
    font-family: "Raleway", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.inv-cc-banner h2 {
    margin: 0 0 8px;
    font-size: 19px;
    line-height: 1.3;
    color: var(--inv-cc-accent);
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}

.inv-cc-banner p { margin: 0 0 14px; color: var(--inv-cc-muted); font-size: 14px; }
.inv-cc-banner a { color: var(--inv-cc-accent); text-decoration: underline; }

.inv-cc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.inv-cc-btn {
    display: inline-block;
    border: 1px solid var(--inv-cc-accent);
    border-radius: 6px;
    padding: 11px 20px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: pointer;
    background: #fff;
    color: var(--inv-cc-accent);
    line-height: 1.2;
    transition: background .18s ease, color .18s ease;
}

.inv-cc-btn:hover, .inv-cc-btn:focus { background: var(--inv-cc-accent); color: #fff; outline: none; }
.inv-cc-btn--primary { background: var(--inv-cc-accent); color: #fff; }
.inv-cc-btn--primary:hover, .inv-cc-btn--primary:focus { background: var(--inv-cc-accent-2); border-color: var(--inv-cc-accent-2); color: #12203f; }
.inv-cc-btn--link { border-color: transparent; background: transparent; text-decoration: underline; padding-left: 6px; padding-right: 6px; }
.inv-cc-btn--link:hover, .inv-cc-btn--link:focus { background: transparent; color: var(--inv-cc-accent-2); }

.inv-cc-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: transparent;
    color: var(--inv-cc-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}
.inv-cc-close:hover, .inv-cc-close:focus { color: var(--inv-cc-fg); }

/* ---------- Pannello preferenze ---------- */
.inv-cc-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(1, 11, 43, .6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.inv-cc-panel {
    background: var(--inv-cc-bg);
    color: var(--inv-cc-fg);
    width: 100%;
    max-width: 720px;
    border-radius: 10px;
    padding: 26px 28px;
    font-family: "Raleway", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
}

.inv-cc-panel h2 { margin: 0 0 6px; font-size: 20px; color: var(--inv-cc-accent); font-weight: 700; }
.inv-cc-panel > p { color: var(--inv-cc-muted); margin: 0 0 18px; }

.inv-cc-group {
    border: 1px solid var(--inv-cc-border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.inv-cc-group-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.inv-cc-group-head strong { font-size: 15px; color: var(--inv-cc-fg); }
.inv-cc-group p { margin: 8px 0 0; color: var(--inv-cc-muted); font-size: 13px; }
.inv-cc-always { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--inv-cc-muted); }

/* switch */
.inv-cc-switch { position: relative; display: inline-block; width: 48px; height: 26px; flex: 0 0 auto; }
.inv-cc-switch input { opacity: 0; width: 0; height: 0; }
.inv-cc-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: #c6ccda; border-radius: 26px; transition: .2s;
}
.inv-cc-slider:before {
    content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: .2s;
}
.inv-cc-switch input:checked + .inv-cc-slider { background: var(--inv-cc-accent-2); }
.inv-cc-switch input:checked + .inv-cc-slider:before { transform: translateX(22px); }
.inv-cc-switch input:focus + .inv-cc-slider { box-shadow: 0 0 0 3px rgba(201, 162, 39, .35); }

.inv-cc-panel-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---------- Placeholder contenuti bloccati ---------- */
.inv-cc-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    min-height: 220px;
    padding: 28px 20px;
    background: #f4f6fa;
    border: 1px dashed #c6ccda;
    border-radius: 8px;
    color: var(--inv-cc-muted);
    font-family: "Raleway", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
}
.inv-cc-placeholder p { margin: 0; max-width: 460px; }

@media (max-width: 600px) {
    .inv-cc-banner { left: 8px; right: 8px; bottom: 8px; padding: 18px 16px; }
    .inv-cc-actions .inv-cc-btn { flex: 1 1 100%; text-align: center; }
    .inv-cc-panel { padding: 20px 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .inv-cc-btn, .inv-cc-slider, .inv-cc-slider:before { transition: none; }
}
