:root {
    /* Colors */
    --c-bg: #F8F9FA;
    --c-text: #1A202C;
    --c-primary: #1C3D6A;
    /* Deep Blue from logo */
    --c-accent: #27A4B1;
    /* Teal from logo */
    --c-surface: #FFFFFF;
    --c-border: rgba(28, 61, 106, 0.1);

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'DM Sans', sans-serif;

    /* Spacing */
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 4rem;
    --space-2xl: 8rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 9999px;

    /* Shadows */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    --shadow-glass: 0 8px 32px 0 rgba(28, 61, 106, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: initial;
    /* Handled by Lenis */
}

body {
    font-family: var(--font-body);
    background-color: var(--c-bg);
    color: var(--c-text);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none;
    /* Hide default cursor for custom one */
}

/* Custom Cursor */
.cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background-color: var(--c-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 99999;
    transition: width 0.3s, height 0.3s, background-color 0.3s;
}

.cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(39, 164, 177, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 99998;
    transition: width 0.3s, height 0.3s, border-color 0.3s;
}

/* Cursor States */
body.hovering .cursor {
    width: 0;
    height: 0;
}

body.hovering .cursor-follower {
    width: 60px;
    height: 60px;
    background-color: rgba(39, 164, 177, 0.1);
    border-color: var(--c-accent);
    backdrop-filter: blur(2px);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    line-height: 1.1;
    font-weight: 700;
}

h1 {
    font-size: clamp(3rem, 5vw + 1rem, 5.5rem);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
}

h2 {
    font-size: clamp(2.5rem, 4vw, 4rem);
    letter-spacing: -0.01em;
    margin-bottom: var(--space-sm);
}

h3 {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

p {
    font-size: 1.125rem;
    color: rgba(26, 32, 44, 0.7);
}

.text-gradient {
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container .copyright {
    font-size: 1.0rem;
}

section,
.services,
.portfolio,
.pricing,
.cta {
    padding: 10rem 0 2rem;
    position: relative;
    width: 100%;
    display: block;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: var(--radius-pill);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: none;
    /* Let custom cursor handle it */
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background-color: var(--c-primary);
    color: white;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.btn-primary:hover::after {
    transform: translateX(100%);
}

.btn-outline {
    background-color: transparent;
    color: var(--c-primary);
    border: 1px solid var(--c-border);
}

.btn-outline.paypal {
    background-color: #eeeeee;
    color: var(--c-primary);
    border: 1px solid var(--c-border);
}

.btn-outline:hover,
.btn-outline-paypal:hover {
    border-color: var(--c-primary);
    background-color: rgba(28, 61, 106, 0.05);
}

.btn-full {
    width: 100%;
}

.btn-large {
    padding: 1.25rem 3rem;
    font-size: 1.125rem;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--space-md) 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(248, 249, 250, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--c-border);
    padding: var(--space-sm) 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: inline-block;
    text-decoration: none;
}

.logo-img {
    height: 80px;
    width: auto;
    object-fit: contain;
    display: block;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    list-style: none;
}

.nav-link {
    text-decoration: none;
    color: var(--c-text);
    font-weight: 500;
    font-family: var(--font-heading);
    transition: color 0.3s;
    font-size: 1.1rem;
    cursor: none;
    /* Uses custom cursor */
}

.nav-link:hover {
    color: var(--c-primary);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--space-2xl);
    position: relative;
    overflow: hidden;
}

.hero-bg-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    z-index: -1;
}

.blob-1 {
    top: -10%;
    right: -5%;
    width: 50vw;
    height: 50vw;
    background: var(--c-accent);
    opacity: 0.15;
}

.blob-2 {
    bottom: -20%;
    left: -10%;
    width: 40vw;
    height: 40vw;
    background: var(--c-primary);
    opacity: 0.1;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: center;
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

/* Hero Mockup (Abstract representation) */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    padding: var(--space-lg);
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: transform 0.5s ease;
}

.glass-card:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.mockup-header {
    display: flex;
    gap: 8px;
    margin-bottom: var(--space-lg);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red {
    background-color: #FF5F56;
}

.dot.yellow {
    background-color: #FFBD2E;
}

.dot.green {
    background-color: #27C93F;
}

.skeleton-line {
    height: 16px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
}

.skeleton-line.full {
    width: 100%;
}

.skeleton-line.short {
    width: 60%;
}

.skeleton-box {
    height: 200px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--radius-md);
    margin-top: var(--space-lg);
}

/* Services */
.section-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto var(--space-xl);
}

/* Services Accordion Layout */
.services-accordion {
    display: flex;
    gap: var(--space-md);
    min-height: 220px;
    /* Altezza ridotta come richiesto */
    width: 100%;
}

.service-item {
    flex: 1;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    position: relative;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.service-item:hover {
    border-color: var(--c-accent);
}

.service-item.active {
    flex: 2.5;
    background: var(--c-surface);
    border: 2px solid var(--c-accent);
    /* Bordo evidenziato */
    box-shadow: var(--shadow-glass);
}

.service-number {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 900;
    line-height: 1;
    opacity: 0.05;
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--c-text);
    transition: all 0.4s ease;
}

.service-item.active .service-number {
    color: var(--c-accent);
    /* Numero colorato nell'attivo */
    opacity: 0.15;
    top: 1.5rem;
    right: 1.5rem;
}

.service-main {
    position: relative;
    z-index: 2;
}

.service-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: rgba(28, 61, 106, 0.05);
    color: var(--c-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: var(--space-lg);
    transition: all 0.4s ease;
}

.service-item.active .service-icon {
    background: var(--c-accent);
    /* Icona colorata nell'attivo */
    color: white;
}

.service-item h3 {
    font-size: 1.4rem;
    color: var(--c-primary);
    transition: all 0.4s ease;
    max-width: 200px;
}

.service-item.active h3 {
    color: var(--c-primary);
    font-size: 1.8rem;
    max-width: 100%;
}

.service-details {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.5s ease;
    z-index: 2;
}

.service-item.active .service-details {
    max-height: 200px;
    opacity: 1;
    margin-top: var(--space-md);
}

.service-details p {
    color: var(--c-text);
    font-size: 1rem;
    line-height: 1.5;
}

/* Mobile & Tablet view: Slider */
@media (max-width: 992px) {
    .services-accordion {
        flex-direction: column;
        min-height: auto;
        gap: var(--space-md);
    }

    .service-item {
        flex: none !important;
        height: auto;
        padding: var(--space-lg);
    }

    .service-item.active {
        background: var(--c-surface);
        border-color: var(--c-accent);
    }

    .service-item.active h3 {
        color: var(--c-primary);
        font-size: 1.4rem;
    }

    .service-item.active .service-details p {
        color: var(--c-text);
    }

    .service-item.active .service-icon {
        background: var(--c-accent);
        color: white;
    }

    .service-item.active .service-number {
        color: var(--c-accent);
    }

    .service-details {
        max-height: none;
        opacity: 1;
        margin-top: var(--space-sm);
    }
}

/* Portfolio */
.portfolio-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: var(--space-xl);
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    color: var(--c-text);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn:hover {
    border-color: var(--c-primary);
    color: var(--c-primary);
    background: rgba(28, 61, 106, 0.05);
}

.filter-btn.active {
    background: var(--c-primary);
    color: white;
    border-color: var(--c-primary);
    box-shadow: 0 4px 15px rgba(28, 61, 106, 0.2);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-lg);
}

@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

/* Portfolio Empty State */
.portfolio-empty {
    display: none;
    text-align: center;
    padding: var(--space-xl) 0;
    color: var(--c-text-light);
    animation: fadeIn 0.5s ease forwards;
}

.portfolio-empty i {
    font-size: 4rem;
    color: var(--c-primary);
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.portfolio-empty h3 {
    font-size: 1.5rem;
    color: var(--c-primary);
    margin-bottom: 0.5rem;
}

.portfolio-empty p {
    font-size: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.portfolio-card {
    text-decoration: none;
    color: var(--c-text);
    display: block;
    transition: transform 0.4s ease;
}

.portfolio-card:hover {
    transform: translateY(-5px);
}

.portfolio-img {
    height: 240px;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--c-border);
}

.portfolio-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.portfolio-card:hover .portfolio-img img {
    transform: scale(1.05);
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: rgba(28, 61, 106, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.portfolio-overlay span {
    color: white;
    font-family: var(--font-heading);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.portfolio-card:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-card:hover .portfolio-overlay span {
    transform: translateY(0);
}

.portfolio-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}

.portfolio-card:hover .portfolio-info h3 {
    color: var(--c-primary);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: rgba(39, 164, 177, 0.1);
    color: var(--c-accent);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Pricing */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    align-items: stretch;
}

.pricing-card {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-border);
    padding: var(--space-xl) var(--space-lg);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.4s ease;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.pricing-card.popular {
    border: 2px solid var(--c-primary);
    transform: scale(1.05);
    box-shadow: var(--shadow-glass);
    z-index: 2;
}

.pricing-card.popular:hover {
    transform: scale(1.05) translateY(-5px);
}

.popular-badge {
    position: absolute;
    top: 0;
    right: 20px;
    background: var(--c-accent);
    color: white;
    padding: 4px 16px;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pricing-header {
    text-align: center;
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--c-border);
    margin-bottom: var(--space-lg);
}

.pricing-header h3 {
    font-size: 2rem;
    color: var(--c-primary);
}

.popular .pricing-header h3 {
    color: var(--c-text);
}

.price {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: var(--space-sm) 0;
}

.currency {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.amount {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    font-family: var(--font-heading);
}

.billing {
    font-size: 0.875rem;
    color: rgba(26, 32, 44, 0.5);
}

.features {
    list-style: none;
    flex-grow: 1;
}

.features li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.features i {
    color: var(--c-accent);
    font-size: 1.25rem;
    margin-top: 2px;
}

.features .service-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 4px;
    cursor: help;
    transition: color 0.3s;
    font-size: inherit;
    font-family: inherit;
    font-weight: inherit;
}

.features .service-link:hover {
    color: var(--c-primary);
}

.pricing-footer {
    margin-top: var(--space-lg);
}

.pricing-disclaimer {
    text-align: center;
    margin-top: var(--space-xl);
    color: rgba(26, 32, 44, 0.6);
}

.pricing-disclaimer p {
    font-size: 1.0rem;
}

/* CTA Section */
.cta {
    padding: var(--space-2xl) 0;
}

.cta-box {
    background: var(--c-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.cta-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(39, 164, 177, 0.2) 0%, transparent 60%);
    z-index: 0;
}

.cta-box>* {
    position: relative;
    z-index: 1;
}

.cta-box h2 {
    color: white;
}

.cta-box p {
    color: rgba(255, 255, 255, 0.8);
    max-width: 680px;
    margin: 0 auto var(--space-lg);
}

/* Footer */
footer {
    background: white;
    border-top: 1px solid var(--c-border);
    padding-top: var(--space-2xl);
}

.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.footer-brand p {
    margin-top: var(--space-md);
    max-width: 300px;
}

.footer-socials {
    display: flex;
    gap: 1rem;
    margin-top: var(--space-lg);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--c-surface);
    color: var(--c-primary);
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--c-border);
}

.social-link:hover {
    background: var(--c-primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(28, 61, 106, 0.15);
}

@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand p {
        margin: var(--space-md) auto 0;
    }

    .footer-socials {
        justify-content: center;
        margin-bottom: var(--space-lg);
    }

    .footer-contact p {
        justify-content: center;
    }
}

.footer-links h4,
.footer-contact h4 {
    font-family: var(--font-heading);
    margin-bottom: var(--space-md);
    font-size: 1.25rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    text-decoration: none;
    color: rgba(26, 32, 44, 0.7);
    transition: color 0.3s;
    font-size: 0.95rem;
    /* Dimensione uniforme */
}

.footer-links a:hover {
    color: var(--c-primary);
}

.footer-contact p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    /* Dimensione uniforme */
    color: rgba(26, 32, 44, 0.7);
}

.footer-contact-link {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

.footer-contact-link:hover {
    color: var(--c-primary);
}

.footer-contact i {
    color: var(--c-accent);
}

.footer-legal {
    border-top: 1px solid var(--c-border);
    padding: var(--space-sm) 0;
}

.footer-legal .container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    font-size: 0.8rem;
    color: rgba(26, 32, 44, 0.6);
}

.footer-legal a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-legal a:hover {
    color: var(--c-primary);
}

.footer-legal .separator {
    color: rgba(26, 32, 44, 0.3);
}

.footer-bottom {
    border-top: 1px solid var(--c-border);
    padding: var(--space-md) 0;
    text-align: center;
    font-size: 0.875rem;
    color: rgba(26, 32, 44, 0.5);
}

/* Responsive */
@media (max-width: 1024px) {
    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }

    .pricing-card.popular {
        transform: scale(1);
    }

    .pricing-card.popular:hover {
        transform: translateY(-5px);
    }
}

@media (max-width: 768px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-visual {
        display: none;
    }

    .nav-menu {
        display: none;
        /* Hide on mobile for simplicity */
    }

    .btn-nav {
        display: none;
    }

    .footer-container {
        grid-template-columns: 1fr;
    }

    .cursor,
    .cursor-follower {
        display: none;
    }

    body {
        cursor: auto;
    }

    .btn {
        cursor: pointer;
    }
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--c-primary);
    cursor: pointer;
    transition: color 0.3s;
}

.mobile-menu-toggle:hover {
    color: var(--c-accent);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-container {
    text-align: center;
    width: 100%;
    padding: var(--space-xl);
    transform: translateY(30px);
    transition: transform 0.4s ease;
}

.mobile-menu-overlay.active .mobile-menu-container {
    transform: translateY(0);
}

.mobile-menu-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: none;
    border: none;
    font-size: 2.5rem;
    color: var(--c-text);
    cursor: pointer;
    transition: color 0.3s;
}

.mobile-menu-close:hover {
    color: var(--c-primary);
}

.mobile-nav-menu {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-xl) 0;
}

.mobile-nav-menu li {
    margin-bottom: var(--space-lg);
}

.mobile-nav-link {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--c-text);
    text-decoration: none;
    transition: color 0.3s;
}

.mobile-nav-link:hover {
    color: var(--c-primary);
}

.mobile-nav-actions {
    display: flex;
    justify-content: center;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 32, 44, 0.85);
    /* Leggermente più scuro per compensare il minor blur */
    backdrop-filter: blur(4px);
    /* Ridotto da 8px a 4px per massimizzare le performance */
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, visibility;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    background: var(--c-surface);
    width: 90%;
    max-width: 800px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translate3d(0, 30px, 0);
    /* Forza accelerazione hardware */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-glass);
    will-change: transform;
}

.modal.active .modal-dialog {
    transform: translate3d(0, 0, 0);
}

#pageModal .modal-dialog {
    height: 85vh;
    /* Altezza fissa ottimizzata */
    max-height: 90vh;
}

.form-modal .modal-dialog {
    height: auto;
    max-height: 90vh;
}

.modal-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--c-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--c-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--c-primary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Evita doppia barra negli iframe */
#pageModal .modal-body {
    overflow-y: hidden;
}

.modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Forms */
.form-body {
    padding: var(--space-xl);
    overflow-y: auto;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.form-row {
    display: flex;
    gap: var(--space-md);
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--c-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--c-text);
    background: #F8F9FA;
    transition: all 0.3s;
    outline: none;
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%231C3D6A%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--c-primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(28, 61, 106, 0.1);
}

.form-group input:valid:not(:placeholder-shown),
.form-group textarea:valid:not(:placeholder-shown) {
    border-color: #27C93F;
}

.form-group input:invalid:not(:placeholder-shown),
.form-group textarea:invalid:not(:placeholder-shown) {
    border-color: #FF5F56;
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    pointer-events: none;
}

.success-message {
    text-align: center;
    padding: var(--space-xl) 0;
}

.success-message i {
    font-size: 4rem;
    color: #27C93F;
    margin-bottom: var(--space-md);
}

.success-message h4 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--c-primary);
    margin-bottom: var(--space-sm);
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: var(--space-md);
    }

    .modal-dialog {
        width: 96%;
    }

    .form-body {
        padding: var(--space-lg) var(--space-md);
    }

    .modal-header {
        padding: var(--space-md);
    }
}

.footer-logo-img {
    height: 100px;
}

.footer-contact-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-contact-link:hover {
    color: var(--c-primary);
}

/* Tooltip */
.service-tooltip-box {
    position: absolute;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    box-shadow: var(--shadow-glass);
    max-width: 320px;
    width: max-content;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 15px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.service-tooltip-box::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 14px;
    height: 14px;
    background: var(--c-surface);
    border-right: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
}

.service-tooltip-box.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.tooltip-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--c-text);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.tooltip-close:hover {
    color: var(--c-primary);
}

.tooltip-content {
    margin: 0;
    font-size: 0.95rem;
    color: var(--c-text);
    padding-right: 20px;
    line-height: 1.5;
}

/* GDPR Banner */
.gdpr-banner {
    position: fixed;
    bottom: var(--space-md);
    left: 50%;
    width: 90%;
    max-width: 1100px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 9999;
    transform: translate(-50%, calc(100% + var(--space-md) + 20px));
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.gdpr-banner.show {
    transform: translate(-50%, 0);
}

.gdpr-content {
    flex: 1;
    margin-right: var(--space-lg);
}

.gdpr-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--c-text);
}

.gdpr-content a {
    color: var(--c-primary);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.gdpr-actions {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .gdpr-banner {
        width: 94%;
        flex-direction: column;
        text-align: center;
        gap: var(--space-md);
        padding: var(--space-lg) var(--space-md);
    }

    .gdpr-content {
        margin-right: 0;
    }

    .gdpr-actions {
        width: 100%;
        justify-content: center;
    }
}

/* Form Checkbox */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--c-primary);
    cursor: pointer;
}

.form-checkbox label {
    font-size: 0.85rem;
    color: var(--c-text);
    margin: 0;
    cursor: pointer;
}

.form-checkbox label a {
    color: var(--c-primary);
    text-decoration: underline;
}

#pageModal {
    z-index: 1010;
    /* Ensures legal modal opens above form modal */
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    right: 15px;
    bottom: 15px;
    width: 56px;
    height: 56px;
    background: var(--c-accent);
    /* Colore in linea con il brand */
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 4px 15px rgba(39, 164, 177, 0.3);
    /* Ombra basata sul colore d'accento */
    z-index: 999;
    transition: all 0.3s ease;
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(39, 164, 177, 0.5);
    color: white;
}

@media (max-width: 768px) {
    .whatsapp-float {
        width: 48px;
        height: 48px;
        font-size: 28px;
    }
}

.wa-tooltip {
    position: absolute;
    right: 70px;
    background: var(--c-surface);
    color: var(--c-text);
    padding: 8px 15px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    border: 1px solid var(--c-border);
}

.wa-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid var(--c-surface);
}

.whatsapp-float:hover .wa-tooltip {
    opacity: 1;
    visibility: visible;
    right: 75px;
}

/* GDPR Manage Icon */
.gdpr-manage {
    position: fixed;
    bottom: 15px;
    left: 15px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.gdpr-manage.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.gdpr-manage button {
    width: 3.5rem;
    height: 3.5rem;
    background: var(--c-surface);
    color: var(--c-primary);
    border-radius: 50%;
    border: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(8px);
}

@media (max-width: 768px) {
    .gdpr-manage button {
        width: 3.0rem;
        height: 3.0rem;
        font-size: 1.2rem;
    }
}

.gdpr-manage button:hover {
    transform: scale(1.1);
    background: var(--c-primary);
    color: white;
    border-color: var(--c-primary);
}

/* Settings Widget Position Adjustment (Navbar) */
.settings-widget {
    position: relative;
    z-index: 1000;
    margin-left: 1rem;
}

/* Nascondiamo su mobile nel menu principale, lo gestiremo diversamente se serve */
@media (max-width: 992px) {
    .navbar .settings-widget {
        display: none;
    }
}

.settings-toggle {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--c-primary);
    color: white;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.settings-toggle:hover {
    transform: rotate(45deg) scale(1.1);
}

.settings-panel {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 280px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    padding: var(--space-md);
    border: 1px solid var(--c-border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.settings-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.settings-panel::after {
    content: '';
    position: absolute;
    top: -8px;
    right: 12px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--c-border);
}

.settings-header h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.settings-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--c-text);
    cursor: pointer;
    padding: 0.2rem;
    display: flex;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.setting-info {
    flex: 1;
}

.setting-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--c-text);
}

.setting-desc {
    font-size: 0.75rem;
    color: rgba(26, 32, 44, 0.6);
    margin: 0.2rem 0 0;
    line-height: 1.3;
}

/* Toggle Switch Styling */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

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

.slider-round {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider-round:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider-round {
    background-color: var(--c-primary);
}

input:checked+.slider-round:before {
    transform: translateX(18px);
}

/* Custom Cursor Disable Logic */
body.no-custom-cursor {
    cursor: default !important;
}

body.no-custom-cursor a,
body.no-custom-cursor button,
body.no-custom-cursor .magnetic,
body.no-custom-cursor .form-trigger,
body.no-custom-cursor .modal-trigger {
    cursor: pointer !important;
}

body.no-custom-cursor .cursor,
body.no-custom-cursor .cursor-follower {
    display: none !important;
}

/* --- Color Themes --- */

/* 1. High Contrast (Accessibilità) */
body.theme-high-contrast {
    --c-bg: #FFFFFF;
    --c-text: #000000;
    --c-primary: #0F2544;
    --c-accent: #00E5FF;
    --c-surface: #F8F9FA;
    --c-border: rgba(0, 0, 0, 0.2);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

/* 2. Sophisticated Tech (Eleganza) */
body.theme-sophisticated {
    --c-bg: #F7F8FA;
    --c-text: #2D334A;
    --c-primary: #2D334A;
    --c-accent: #C5A48A;
    --c-surface: #EDF2F7;
    --c-border: rgba(45, 51, 74, 0.1);
    --shadow-glass: 0 8px 32px 0 rgba(45, 51, 74, 0.05);
}

/* 3. Vibrant Modern (Dinamismo) */
body.theme-vibrant {
    --c-bg: #E0F2FE;
    --c-text: #1C3D6A;
    --c-primary: #1C3D6A;
    --c-accent: #FF6B6B;
    --c-surface: #FFFFFF;
    --c-border: rgba(28, 61, 106, 0.1);
    --shadow-glass: 0 8px 32px 0 rgba(28, 61, 106, 0.08);
}

/* Palette UI Elements */
.setting-divider {
    height: 1px;
    background: var(--c-border);
    margin: var(--space-md) 0;
}

.setting-item-column {
    display: flex;
    flex-direction: column;
}

.palette-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.palette-btn {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    background: linear-gradient(135deg, var(--p-color) 50%, var(--p-accent) 50%);
    transition: all 0.3s ease;
    padding: 0;
}

.palette-btn:hover {
    transform: scale(1.1);
}

.palette-btn.active {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(28, 61, 106, 0.2);
}

.palette-btn::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    border: 2px solid white;
    opacity: 0;
    transition: opacity 0.3s;
}

.palette-btn.active::after {
    opacity: 1;
}