/* =====================================================================
   COOKIE CONSENT — banner, preferenze, video YouTube bloccati
   Collega con: <link rel="stylesheet" href="cookie-consent.css">
   ===================================================================== */

/* ---------- BANNER ---------- */
.cc-banner {
    position: fixed;
    left: 50%;
    bottom: 1.2rem;
    z-index: 1300;
    width: min(940px, 92vw);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.3rem 3rem 1.3rem 1.6rem;
    background: rgba(21, 23, 28, 0.97);
    border: 1px solid var(--border-dark, #232630);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(14px);
    color: var(--text-main, #e2e8f0);
    font-family: var(--font-body, 'Inter', sans-serif);
    opacity: 0;
    visibility: hidden;
    translate: -50% 30px;
    transition: opacity 0.5s ease, translate 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s 0.6s;
}

.cc-banner.show {
    opacity: 1;
    visibility: visible;
    translate: -50% 0;
    transition: opacity 0.5s ease, translate 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s;
}

.cc-text { flex: 1; min-width: 0; }

.cc-text strong {
    display: block;
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.cc-text p {
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-muted, #8c95a5);
}

.cc-text a,
.yt-ph-inner a {
    color: #00CCAA;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    flex-shrink: 0;
}

/* "Accetta" e "Rifiuta" hanno lo STESSO aspetto: nessuna scelta è messa in evidenza */
.cc-btn {
    padding: 0.75rem 1.3rem;
    border-radius: 50px;
    border: 1px solid rgba(244, 244, 240, 0.35);
    background: #f4f4f0;
    color: #0b0d0c;
    font: 600 0.85rem var(--font-display, 'Space Grotesk', sans-serif);
    cursor: pointer;
    white-space: nowrap;
    transition: scale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, border-color 0.2s ease;
}

.cc-btn:hover { scale: 1.05; background: #ffffff; }

.cc-btn.cc-ghost {
    background: transparent;
    color: var(--text-main, #e2e8f0);
    border-color: rgba(244, 244, 240, 0.25);
}

.cc-btn.cc-ghost:hover { border-color: #00CCAA; color: #00CCAA; background: rgba(0, 204, 170, 0.06); }

.cc-btn:focus-visible,
.cc-x:focus-visible {
    outline: 2px solid #00CCAA;
    outline-offset: 3px;
}

.cc-x {
    position: absolute;
    top: 0.6rem;
    right: 0.8rem;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted, #8c95a5);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.cc-x:hover { color: var(--text-main, #e2e8f0); }


/* ---------- MODALE PREFERENZE ---------- */
.cc-overlay {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: grid;
    place-items: center;
    padding: 4vw;
    background: rgba(8, 9, 11, 0.8);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0s 0.35s;
}

.cc-overlay.open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s ease, visibility 0s;
}

.cc-dialog {
    width: min(560px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    border-radius: 24px;
    background: var(--card-bg, #15171c);
    border: 1px solid var(--border-dark, #232630);
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6);
    color: var(--text-main, #e2e8f0);
    font-family: var(--font-body, 'Inter', sans-serif);
    scale: 0.94;
    translate: 0 16px;
    transition: scale 0.5s cubic-bezier(0.16, 1, 0.3, 1), translate 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cc-overlay.open .cc-dialog { scale: 1; translate: 0 0; }

.cc-dialog h2 {
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.cc-intro {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-muted, #8c95a5);
    margin-bottom: 1.4rem;
}

.cc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-dark, #232630);
}

.cc-row-text strong {
    display: block;
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.cc-row-text small {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-muted, #8c95a5);
}

.cc-badge {
    flex-shrink: 0;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #00CCAA;
    background: rgba(0, 204, 170, 0.1);
    border: 1px solid rgba(0, 204, 170, 0.25);
}

.cc-switch { position: relative; flex-shrink: 0; width: 48px; height: 28px; }

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

.cc-slider {
    position: absolute;
    inset: 0;
    border-radius: 50px;
    background: #2e3340;
    transition: background 0.25s ease;
}

.cc-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    transition: translate 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cc-switch input:checked + .cc-slider { background: #00CCAA; }
.cc-switch input:checked + .cc-slider::after { translate: 20px 0; }
.cc-switch input:focus-visible + .cc-slider { outline: 2px solid #ffffff; outline-offset: 3px; }

.cc-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-end;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border-dark, #232630);
}


/* ---------- VIDEO YOUTUBE (bloccati finché non c'è consenso) ---------- */
.yt-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 20px;
    overflow: hidden;
    background: var(--card-bg, #15171c);
    border: 1px solid var(--border-dark, #232630);
}

.yt-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.yt-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    background-size: cover;
    background-position: center;
}

.yt-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(8, 9, 11, 0.84);
}

.yt-ph-inner {
    position: relative;
    max-width: 480px;
    color: var(--text-main, #e2e8f0);
    font-family: var(--font-body, 'Inter', sans-serif);
}

.yt-ph-inner strong {
    display: block;
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.yt-ph-inner p {
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-muted, #8c95a5);
    margin-bottom: 1rem;
}

.yt-ph-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}


/* ---------- MOBILE ---------- */
@media (max-width: 720px) {
    .cc-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1.2rem 1.2rem 1.2rem;
        bottom: 0.8rem;
    }
    .cc-text { padding-right: 1.6rem; }
    .cc-actions .cc-btn { flex: 1 1 auto; text-align: center; }
    .cc-dialog { padding: 1.4rem; }
    .cc-dialog-actions .cc-btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
    .cc-banner, .cc-overlay, .cc-dialog, .cc-btn, .cc-slider::after {
        transition-duration: 0.01ms !important;
    }
}