/* ====================================================================
   Site chrome (header di navigazione + footer) della schermata di login,
   copiato da hompage.css del sito principale per coerenza visiva.
   Si applica SOLO a #login-section: dopo l'accesso l'app usa la propria
   sidebar/bottom-nav (vedi css/styles.css e css/area-soci-mobile.css).
   I link puntano al dominio principale (aiaticino.ch) con URL assoluti,
   dato che questa pagina vive su un sottodominio separato.
   ==================================================================== */

/* Header */
#site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: var(--transition);
}

#site-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

#site-header .nav-container {
    max-width: clamp(320px, 90vw, 1200px);
    margin: 0 auto;
    padding: clamp(0.8rem, 2vw, 1rem) clamp(1rem, 3vw, 1.5rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    gap: 1rem;
}

#site-header .logo {
    height: clamp(35px, 8vw, 45px);
    transition: var(--transition);
}

#site-header .nav-menu {
    display: flex;
    gap: clamp(1rem, 3vw, 2rem);
    list-style: none;
}

#site-header .nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

#site-header .nav-link:hover {
    color: var(--primary);
}

#site-header .nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

#site-header .nav-link:hover::after {
    width: 100%;
}

#site-header .mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    color: var(--text-dark);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
}

#site-header .mobile-menu-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

#site-header .cta-nav {
    background: var(--gradient);
    color: white;
    padding: clamp(0.6rem, 1.5vw, 0.75rem) clamp(1rem, 2.5vw, 1.5rem);
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow);
    white-space: nowrap;
    font-size: clamp(0.85rem, 1.8vw, 1rem);
}

#site-header .cta-nav:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Login section: spazio per l'header fisso sopra */
#login-section {
    padding-top: calc(1.5rem + 72px);
}

/* Footer */
#site-footer {
    background: var(--text-dark);
    color: white;
    padding: clamp(2rem, 5vw, 3rem) clamp(1rem, 3vw, 1.5rem) clamp(1rem, 2vw, 1rem);
}

#site-footer .footer-content {
    max-width: clamp(320px, 90vw, 1200px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(220px, 40vw, 250px), 1fr));
    gap: clamp(1.5rem, 4vw, 2rem);
}

#site-footer .footer-section h3 {
    margin-bottom: clamp(0.8rem, 2vw, 1rem);
    color: var(--accent);
    font-size: clamp(1.1rem, 2.5vw, 1.2rem);
}

#site-footer .footer-section a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: var(--transition);
    font-size: clamp(0.9rem, 2vw, 1rem);
}

#site-footer .footer-section a:hover {
    opacity: 1;
    color: var(--accent);
}

#site-footer .footer-contact {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#site-footer .whatsapp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
    margin-top: 0.25rem;
    background: rgba(37, 211, 102, 0.14);
    border: 1px solid rgba(37, 211, 102, 0.4);
    color: #5EE39A !important;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-weight: 500;
    font-size: 0.9rem;
    opacity: 1 !important;
    transition: var(--transition);
}

#site-footer .whatsapp-badge:hover {
    background: rgba(37, 211, 102, 0.24);
    border-color: rgba(37, 211, 102, 0.5);
    color: #5EE39A !important;
}

#site-footer .whatsapp-badge i {
    font-size: 1em;
}

#site-footer .footer-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#site-footer .footer-link-button {
    background: none;
    border: none;
    color: white;
    opacity: 0.8;
    cursor: pointer;
    text-align: left;
    font-size: clamp(0.9rem, 2vw, 1rem);
    padding: 0;
    transition: var(--transition);
}

#site-footer .footer-link-button:hover {
    opacity: 1;
    color: var(--accent);
}

#site-footer .footer-meta {
    margin-top: 1rem;
    font-size: 0.9rem;
}

#site-footer .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: clamp(1.5rem, 4vw, 2rem);
    padding-top: clamp(0.8rem, 2vw, 1rem);
    text-align: center;
    opacity: 0.6;
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 41, 59, 0.98);
    color: white;
    padding: clamp(1rem, 3vw, 1.5rem);
    z-index: 10000;
    backdrop-filter: blur(15px);
    border-top: 2px solid #097bc0;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-content {
    max-width: clamp(320px, 90vw, 1200px);
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: clamp(1rem, 3vw, 2rem);
}

.cookie-message {
    flex: 1;
    min-width: 0;
}

.cookie-title {
    color: #4fc3f7;
    margin: 0 0 0.5rem 0;
    font-size: clamp(1rem, 2.2vw, 1.1rem);
    font-weight: 600;
}

.cookie-message p {
    margin: 0;
    font-size: clamp(0.85rem, 1.8vw, 0.95rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.cookie-message a {
    color: #4fc3f7;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.cookie-message a:hover {
    color: #097bc0;
}

.cookie-actions {
    display: flex;
    gap: clamp(0.5rem, 1.2vw, 0.7rem);
    flex-shrink: 0;
}

.cookie-btn {
    padding: clamp(0.6rem, 1.5vw, 0.8rem) clamp(0.8rem, 2vw, 1rem);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    font-size: clamp(0.8rem, 1.6vw, 0.85rem);
    border: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.cookie-accept {
    background: #097bc0;
    color: white;
}

.cookie-accept:hover {
    background: #0a5a8a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(9, 123, 192, 0.4);
}

.cookie-decline {
    background: #64748b;
    color: white;
}

.cookie-decline:hover {
    background: #475569;
    transform: translateY(-2px);
}

.cookie-settings {
    background: transparent;
    color: white;
    border: 1px solid #64748b;
}

.cookie-settings:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #4fc3f7;
    color: #4fc3f7;
}

.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    padding: clamp(1rem, 3vw, 2rem);
    backdrop-filter: blur(5px);
}

.cookie-modal.show {
    display: flex;
}

.cookie-modal-content {
    background: white;
    border-radius: 16px;
    padding: 0;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.cookie-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(1.5rem, 3vw, 2rem);
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.cookie-modal-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: clamp(1.2rem, 2.5vw, 1.4rem);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    padding: 0.5rem;
    border-radius: 6px;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

.cookie-categories {
    padding: clamp(1rem, 2.5vw, 1.5rem);
    max-height: 50vh;
    overflow-y: auto;
}

.cookie-category {
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
    padding: clamp(1rem, 2.5vw, 1.2rem);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: border-color 0.3s ease;
}

.cookie-category:hover {
    border-color: #097bc0;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.category-header h4 {
    margin: 0;
    color: #1e293b;
    font-size: clamp(1rem, 2.2vw, 1.1rem);
}

.category-description {
    margin: 0 0 0.8rem 0;
    color: #64748b;
    font-size: clamp(0.85rem, 1.8vw, 0.9rem);
    line-height: 1.5;
}

.cookie-details {
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
}

.cookie-details small {
    color: #94a3b8;
    font-size: clamp(0.75rem, 1.6vw, 0.8rem);
}

.cookie-toggle {
    position: relative;
    display: inline-block;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    background-color: #cbd5e1;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input:checked + .toggle-slider {
    background-color: #097bc0;
}

.cookie-toggle input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.cookie-toggle input:disabled + .toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #10b981;
}

.cookie-modal-footer {
    padding: clamp(1rem, 2.5vw, 1.5rem);
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.cookie-save {
    background: #097bc0;
    color: white;
}

/* Responsive: header e cookie banner sotto i 768px */
@media (max-width: 768px) {
    #site-header .mobile-menu-btn {
        display: block;
        order: 2;
    }

    #site-header .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        gap: 0;
        padding: 1.5rem;
        border-top: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        z-index: 1002;
    }

    #site-header .nav-menu.active {
        display: flex;
    }

    #site-header .nav-menu li {
        width: 100%;
    }

    #site-header .nav-link {
        display: block;
        padding: 1rem 0;
        border-bottom: 1px solid var(--border);
        width: 100%;
    }

    #site-header .nav-link:last-child {
        border-bottom: none;
    }

    #site-header .nav-container .cta-nav {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        order: 2;
        background: none;
        box-shadow: none;
        color: var(--secondary);
        padding: 0.5rem;
        border-radius: 8px;
        font-size: 0;
    }

    #site-header .nav-container .cta-nav i {
        font-size: clamp(1.2rem, 4vw, 1.5rem);
    }

    #site-header .nav-container > :first-child {
        margin-right: auto;
    }

    .cookie-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: left;
    }

    .cookie-actions {
        justify-content: stretch;
        flex-wrap: wrap;
    }

    .cookie-btn {
        flex: 1;
        min-width: 0;
        justify-content: center;
    }

    .cookie-modal-footer {
        flex-direction: column;
    }

    .cookie-modal-footer .cookie-btn {
        width: 100%;
        justify-content: center;
    }
}
