/**
 * Andrea Bellotto - Cookie & Privacy Banner CSS
 * Conforme alle Linee Guida Cookie Garante Privacy (10 Giugno 2021) & GDPR
 * Stile Scuro Cinematografico / Premiere Pro Aesthetic
 */

:root {
    --cb-bg: rgba(14, 15, 20, 0.94);
    --cb-surface: #13141c;
    --cb-surface-light: #1b1d28;
    --cb-border: rgba(255, 255, 255, 0.12);
    --cb-border-hover: rgba(226, 6, 19, 0.5);
    --cb-red: #e20613;
    --cb-red-glow: rgba(226, 6, 19, 0.35);
    --cb-text: #f5f5f7;
    --cb-muted: #8e8e9c;
    --cb-dim: #5c5c6b;
    --cb-font-ui: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    --cb-font-mono: 'JetBrains Mono', monospace;
    --cb-radius: 14px;
}

/* ==========================================================================
   COOKIE BANNER (Floating Card in basso)
   ========================================================================== */

.ab-cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: 24px;
    max-width: 680px;
    margin: 0 auto;
    background: var(--cb-bg);
    border: 1px solid var(--cb-border);
    border-radius: var(--cb-radius);
    padding: 22px 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999990;
    display: none;
    flex-direction: column;
    gap: 16px;
    color: var(--cb-text);
    font-family: var(--cb-font-ui);
    animation: abCookieSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.ab-cookie-banner.is-visible {
    display: flex;
}

@keyframes abCookieSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ab-cookie-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ab-cookie-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ab-cookie-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(226, 6, 19, 0.12);
    border: 1px solid rgba(226, 6, 19, 0.3);
    font-family: var(--cb-font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ff4a58;
}

.ab-cookie-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--cb-red);
    box-shadow: 0 0 8px var(--cb-red);
}

.ab-cookie-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.01em;
}

.ab-cookie-close {
    background: transparent;
    border: none;
    color: var(--cb-muted);
    font-size: 1.25rem;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.ab-cookie-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.ab-cookie-body {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--cb-muted);
    margin: 0;
}

.ab-cookie-body a {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.ab-cookie-body a:hover {
    color: var(--cb-red);
}

.ab-cookie-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* Pulsanti Banner */
.ab-cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-family: var(--cb-font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    border: 1px solid transparent;
}

.ab-cookie-btn-primary {
    background: var(--cb-red);
    color: #ffffff;
    border-color: var(--cb-red);
    box-shadow: 0 4px 15px rgba(226, 6, 19, 0.3);
}

.ab-cookie-btn-primary:hover {
    background: #ff1c2a;
    border-color: #ff1c2a;
    box-shadow: 0 6px 20px rgba(226, 6, 19, 0.5);
    transform: translateY(-1px);
}

.ab-cookie-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e2ea;
    border-color: rgba(255, 255, 255, 0.12);
}

.ab-cookie-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    transform: translateY(-1px);
}

.ab-cookie-btn-outline {
    background: transparent;
    color: var(--cb-muted);
    border-color: rgba(255, 255, 255, 0.08);
}

.ab-cookie-btn-outline:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

/* ==========================================================================
   MODALE PREFERENZE (Gestione Consensi Dettagliata)
   ========================================================================== */

.ab-cookie-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: abFadeIn 0.3s ease forwards;
}

.ab-cookie-modal-backdrop.is-visible {
    display: flex;
}

.ab-cookie-modal {
    background: var(--cb-surface);
    border: 1px solid var(--cb-border);
    border-radius: var(--cb-radius);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    color: var(--cb-text);
    font-family: var(--cb-font-ui);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
    position: relative;
    overflow: hidden;
    animation: abModalPop 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes abFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes abModalPop {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ab-cookie-modal-header {
    padding: 22px 24px;
    border-bottom: 1px solid var(--cb-border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    background: rgba(255, 255, 255, 0.02);
}

.ab-cookie-modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px 0;
    letter-spacing: -0.02em;
}

.ab-cookie-modal-header p {
    font-size: 0.85rem;
    color: var(--cb-muted);
    margin: 0;
    line-height: 1.45;
}

.ab-cookie-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Schede Categorie Cookie */
.ab-cookie-category {
    background: var(--cb-surface-light);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 16px 18px;
    transition: border-color 0.2s ease;
}

.ab-cookie-category:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.ab-cookie-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.ab-cookie-cat-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ab-cookie-cat-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
}

.ab-cookie-cat-pill {
    font-family: var(--cb-font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #a1a1aa;
    text-transform: uppercase;
}

.ab-cookie-cat-pill.always-on {
    background: rgba(37, 211, 102, 0.15);
    color: #4ade80;
    border: 1px solid rgba(37, 211, 102, 0.3);
}

.ab-cookie-cat-desc {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--cb-muted);
    margin: 0;
}

/* Switch personalizzato */
.ab-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.ab-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ab-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.12);
    transition: 0.25s;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.ab-slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
}

.ab-switch input:checked + .ab-slider {
    background-color: var(--cb-red);
    border-color: var(--cb-red);
    box-shadow: 0 0 10px rgba(226, 6, 19, 0.4);
}

.ab-switch input:checked + .ab-slider::before {
    transform: translateX(20px);
}

.ab-switch input:disabled + .ab-slider {
    cursor: not-allowed;
    opacity: 0.6;
    background-color: rgba(37, 211, 102, 0.25);
    border-color: rgba(37, 211, 102, 0.4);
}

.ab-switch input:disabled + .ab-slider::before {
    background-color: #4ade80;
}

.ab-cookie-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--cb-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   FEEDBACK TOAST (Preferenze Salvate)
   ========================================================================== */

.ab-cookie-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #181922;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: var(--cb-font-ui);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ab-cookie-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   STILI PER IL FOOTER A TUTTA LARGHEZZA (Full-Width Studio / Premiere Pro Style)
   ========================================================================== */

.footer {
    width: 100% !important;
    background: #060607 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 2.8rem 0 2.2rem !important;
    position: relative;
    z-index: 10;
}

.footer-full-container {
    width: 100%;
    max-width: 100%;
    padding: 0 clamp(1.5rem, 4vw, 4rem);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.footer-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
}

.footer-seq-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--cb-font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.3em;
    color: var(--cb-red);
    text-transform: uppercase;
}

.footer-end-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--cb-red);
    box-shadow: 0 0 10px var(--cb-red);
    display: inline-block;
    animation: abPulseDot 2s infinite ease-in-out;
}

@keyframes abPulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

.footer-geo {
    font-size: 0.85rem;
    color: #8e8e9c;
    margin: 0;
    text-align: right;
}

.footer-divider-line {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(226, 6, 19, 0.5) 0%, rgba(255, 255, 255, 0.08) 20%, rgba(255, 255, 255, 0.08) 80%, rgba(226, 6, 19, 0.4) 100%);
    margin: 1.4rem 0 1.6rem 0;
}

.footer-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    width: 100%;
}

.footer-info-col {
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: left;
}

.footer-copy {
    font-size: 0.88rem;
    color: #e4e4eb;
    font-weight: 500;
    margin: 0;
}

.footer-fiscal {
    font-size: 0.82rem;
    color: #8e8e9c;
    line-height: 1.5;
    margin: 0;
}

.footer-fiscal .piva-highlight {
    font-family: var(--cb-font-mono);
    color: #ffffff;
    font-weight: 500;
}

.footer-fiscal a {
    color: #d1d1db;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-fiscal a:hover {
    color: var(--cb-red);
}

.footer-links-col {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.footer-legal-links {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 0.82rem;
    color: #71717a;
}

.footer-legal-links a,
.footer-legal-links button.cookie-settings-trigger {
    color: #8e8e9c;
    text-decoration: none;
    background: transparent;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-legal-links a:hover,
.footer-legal-links button.cookie-settings-trigger:hover {
    color: var(--cb-red);
    text-decoration: underline;
}

.footer-legal-links .sep {
    color: rgba(255, 255, 255, 0.2);
    user-select: none;
}

@media (max-width: 900px) {
    .footer-top-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }
    .footer-geo {
        text-align: center;
    }
    .footer-bottom-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
    }
    .footer-info-col {
        align-items: center;
        text-align: center;
    }
    .footer-links-col {
        justify-content: center;
        width: 100%;
    }
    .footer-legal-links {
        justify-content: center;
    }
}

/* ==========================================================================
   CHECKBOX PRIVACY NEL FORM DI CONTATTO
   ========================================================================== */

.form-group.privacy-consent-group {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.custom-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #a1a1aa;
    line-height: 1.45;
    user-select: none;
}

.custom-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-checkbox-box {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin-top: 2px;
    transition: all 0.2s ease;
    position: relative;
}

.custom-checkbox-label:hover .custom-checkbox-box {
    border-color: rgba(255, 255, 255, 0.4);
}

.custom-checkbox-label input[type="checkbox"]:checked ~ .custom-checkbox-box {
    background-color: var(--cb-red);
    border-color: var(--cb-red);
    box-shadow: 0 0 10px rgba(226, 6, 19, 0.4);
}

.custom-checkbox-label input[type="checkbox"]:checked ~ .custom-checkbox-box::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox-text a {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.custom-checkbox-text a:hover {
    color: var(--cb-red);
}

.custom-checkbox-text .required {
    color: var(--cb-red);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 640px) {
    .ab-cookie-banner {
        bottom: 12px;
        left: 12px;
        right: 12px;
        padding: 18px 16px;
    }

    .ab-cookie-actions {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .ab-cookie-btn {
        width: 100%;
    }

    .ab-cookie-modal {
        max-height: 95vh;
    }

    .ab-cookie-modal-header,
    .ab-cookie-modal-body,
    .ab-cookie-modal-footer {
        padding: 16px;
    }

    .ab-cookie-modal-footer {
        flex-direction: column-reverse;
        width: 100%;
    }

    .ab-cookie-modal-footer .ab-cookie-btn {
        width: 100%;
    }
}
