/* ===== CAROUSEL CLIENTI ===== */
/* ===== TITOLO CON LINEE DECORATIVE ===== */
.client-title-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 3rem;
}

/* ===== TITOLO STILE BOTTONE ===== */
.client-title-badge {
    display: inline-block;
    padding: 12px 30px;
    /* background-color: var(--bg-primary); */
    background-color: #ffffff;
    color: #000;
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    position: relative;
    letter-spacing: 0.5px;
}

.clients-section {
    overflow: hidden;
    position: relative;
}

.scroll-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.scroll-content {
    display: flex;
    animation: scroll 20s linear infinite;
    padding: 1rem;
    will-change: transform;
}

.client-card {
    flex: 0 0 300px !important;
    margin: 0 1rem !important;
    height: 180px !important;
    flex-shrink: 0 !important;
}

.client-card .card {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    border: 1px solid #e9ecef;
    background: #fff !important;
    border-radius: 8px;
}

.client-card .card-body {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-grow: 1 !important;
    padding: 2rem !important;
}

.client-card .card-body img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    filter: grayscale(100%) !important;
    -webkit-filter: grayscale(100%) !important;
    transition: filter 0.3s ease !important;
}

.client-card:hover .card-body img {
    filter: grayscale(0%) !important;
    -webkit-filter: grayscale(0%) !important;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-300px * var(--cards-count)));
    }
}

.scroll-content:hover {
    animation-play-state: paused;
}

/* ===== TO TOP BUTTON ===== */
#toTop {
    background-color: #e2241c;
    border-radius: 50%;
    bottom: 10px;
    color: transparent;
    display: none;
    font-size: 0;
    height: 60px;
    opacity: 0.7;
    overflow: hidden;
    position: fixed;
    right: 150px;
    text-decoration: none;
    width: 60px;
    z-index: 1000;
    transition: opacity 0.3s ease, bottom 0.3s ease;
    transform: translateY(5px);
}

#toTop:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    -webkit-transition: all 0.2s linear;
    transition: all 0.2s linear;
}

#toTopHover,
#toTop:hover {
    bottom: 3px;
    opacity: 1;
    transform: translateY(0);
}

#toTop:hover:after {
    filter: brightness(1.2);
}

#toTop:active,
#toTop:focus {
    outline: medium none;
}

/* ===================================================================
   LEGAL DOCUMENTS MODAL
   =================================================================== */
.legal-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.legal-modal.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.legal-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.legal-modal-container {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: var(--bg-primary, #fff);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 10001;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.legal-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
}

.legal-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary, #1a1a2e);
}

.legal-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary, #666);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.legal-modal-close:hover {
    background-color: var(--glass-bg, rgba(0, 0, 0, 0.05));
    color: var(--text-primary, #1a1a2e);
}

.legal-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    position: relative;
}

.legal-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.legal-modal-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--glass-border, rgba(0, 0, 0, 0.1));
    border-top-color: var(--accent-color, #ff0000);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.legal-modal-loading p {
    margin: 0;
    color: var(--text-secondary, #666);
    font-size: 14px;
}

.legal-modal-content {
    display: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary, #1a1a2e);
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}

.legal-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 32px;
    border-top: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
}

.legal-modal-footer .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.legal-modal-footer .btn-secondary {
    background-color: var(--glass-bg, rgba(0, 0, 0, 0.05));
    color: var(--text-primary, #1a1a2e);
}

.legal-modal-footer .btn-secondary:hover {
    background-color: var(--glass-border, rgba(0, 0, 0, 0.1));
}

.legal-modal-footer .btn-primary {
    background-color: var(--accent-color, #ff0000);
    color: #fff;
}

.legal-modal-footer .btn-primary:hover {
    background-color: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.legal-modal-footer .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Responsive */
@media (max-width: 768px) {
    .legal-modal-container {
        width: 95%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .legal-modal-header {
        padding: 16px 20px;
    }

    .legal-modal-header h2 {
        font-size: 20px;
    }

    .legal-modal-body {
        padding: 20px;
    }

    .legal-modal-content {
        font-size: 13px;
    }

    .legal-modal-footer {
        padding: 16px 20px;
        flex-direction: column;
    }

    .legal-modal-footer .btn {
        width: 100%;
    }
}
