/* ========================================
   Color Palette from Logo
   ======================================== */
:root {
    --primary-red: #A52A2A;
    --primary-green: #2E7D32;
    --light-green: #66BB6A;
    --dark-green: #1B5E20;
    --cream: #FAF9F6;
    --white: #FFFFFF;
    --gray-light: #F5F5F5;
    --gray-medium: #E0E0E0;
    --gray-dark: #757575;
    --text-dark: #333333;
    --text-light: #666666;

    /* Light Mode (default) */
    --bg-primary: #f1f8f4;
    /* Verde chiarissimo, quasi bianco */
    --bg-secondary: #e8f5e9;
    /* Verde pastello chiaro */
    --bg-tertiary: #c8e6c9;
    /* Verde chiaro medio */
    --bg-card: #FFFFFF;
    /* Sfondo card (bianco in chiaro, scuro in dark) */
    --text-primary: #1b5e20;
    /* Verde molto scuro per testo */
    --text-secondary: #2e7d32;
    /* Verde primario per testo secondario */
    --border-color: #a5d6a7;
    /* Verde chiaro per bordi */

    --font-heading: 'Alegreya', serif;
    --font-body: 'Montserrat', sans-serif;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* Dark Mode - Sistema */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #0d1f0f;
        /* Verde molto scuro, quasi nero */
        --bg-secondary: #162a18;
        /* Verde scuro medio */
        --bg-tertiary: #1f3621;
        /* Verde scuro più chiaro */
        --bg-card: #162a18;
        /* Sfondo card in dark mode */
        --text-primary: #e8f5e9;
        /* Verde chiarissimo per testo */
        --text-secondary: #a5d6a7;
        /* Verde chiaro per testo secondario */
        --border-color: #2d4a2f;
        /* Verde scuro per bordi */
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
        --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
        --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    }
}

/* Dark Mode - Manuale */
[data-theme="dark"] {
    --bg-primary: #0d1f0f;
    /* Verde molto scuro, quasi nero */
    --bg-secondary: #162a18;
    /* Verde scuro medio */
    --bg-tertiary: #1f3621;
    /* Verde scuro più chiaro */
    --bg-card: #162a18;
    /* Sfondo card in dark mode */
    --text-primary: #e8f5e9;
    /* Verde chiarissimo per testo */
    --text-secondary: #a5d6a7;
    /* Verde chiaro per testo secondario */
    --border-color: #2d4a2f;
    /* Verde scuro per bordi */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
}

/* ========================================
   Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    background: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 5rem 0;
    scroll-margin-top: 80px;
    position: relative;
    z-index: 1;
    background: var(--bg-primary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* ========================================
   Typography
   ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--primary-red);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* ========================================
   Navigation
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.logo img {
    height: 50px;
    width: auto;
    transition: var(--transition);
}

.logo img:hover {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-menu a {
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    position: relative;
    color: var(--text-primary);
}

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

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--primary-red);
    transition: var(--transition);
    border-radius: 2px;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    height: 100vh;
    position: relative;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: blur(4px);
    transform: scale(1.04);
}


.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(89, 89, 89, 0.169) 0%, rgba(75, 75, 75, 0.479) 100%);
    z-index: -1;
}

[data-theme="dark"] .hero-overlay {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.7) 100%);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .hero-overlay {
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.7) 100%);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 2rem;
}

.hero h1 {
    color: var(--white);
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

.hero p {
    font-size: 1.5rem;
    color: var(--cream);
    margin-bottom: 2rem;
    text-shadow: 0 4px 14px rgba(0, 0, 0, 0.65);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--white);
    border-radius: 15px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--white);
    border-radius: 2px;
    animation: scroll 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

@keyframes scroll {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(15px);
    }
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--primary-red);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(165, 42, 42, 0.3);
}

.btn-primary:hover {
    background: var(--white);
    color: var(--primary-red);
    border-color: var(--primary-red);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(165, 42, 42, 0.4);
}

/* ========================================
   Section Headers
   ======================================== */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    margin-bottom: 0.5rem;
}

.decorative-line {
    width: 80px;
    height: 4px;
    background: var(--primary-red);
    margin: 1rem auto 1.5rem;
    border-radius: 2px;
}

.section-header p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   About Section
   ======================================== */
.about {
    background: var(--bg-secondary);
}

.about-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h3 {
    color: var(--primary-green);
    margin-bottom: 1.5rem;
}

.about-text p {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

[data-theme="dark"] .stat-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .stat-item:hover {
    border-color: var(--primary-green);
    box-shadow: var(--shadow-md), 0 0 20px rgba(46, 125, 50, 0.15);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-red);
    font-family: var(--font-heading);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.about-image {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.about-image:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1;
    border-radius: 20px;
    transition: transform 0.5s ease;
}

.about-image:hover img {
    transform: scale(1.05);
}

[data-theme="dark"] .about-image {
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-color);
}

[data-theme="dark"] .about-image:hover {
    box-shadow: var(--shadow-lg), 0 0 30px rgba(46, 125, 50, 0.2);
}

/* ========================================
   Services Section
   ======================================== */
.services {
    background: var(--bg-primary);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 2px solid var(--border-color);
}

.service-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-green);
}

[data-theme="dark"] .service-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
}

[data-theme="dark"] .service-card:hover {
    border-color: var(--primary-green);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(46, 125, 50, 0.2);
}

.service-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--white);
    transition: var(--transition);
}

.service-card:hover .service-icon {
    transform: rotateY(360deg);
    background: linear-gradient(135deg, var(--primary-red), #8B3A3A);
}

.service-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.service-card h3 {
    color: var(--primary-red);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.service-card p {
    font-size: 0.95rem;
    line-height: 1.7;
    text-align: left;
}

/* ========================================
   Gallery Section - Horizontal Carousel
   ======================================== */
.gallery {
    background: var(--bg-tertiary);
}

.gallery-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gallery-arrow {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--primary-green);
    background: var(--bg-primary);
    color: var(--primary-green);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.gallery-arrow:hover {
    background: var(--primary-green);
    color: var(--white);
    transform: scale(1.1);
}

.gallery-arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.gallery-arrow svg {
    width: 24px;
    height: 24px;
}

.gallery-carousel {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    min-height: 280px;
    padding: 0.75rem 1.25rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* room so item shadows don’t get cut at edges */
}

.gallery-track {
    display: flex;
    flex-direction: row;
}

/* Each column: 1 image on mobile, 2 stacked on medium/large */
.gallery-column {
    flex: 0 0 calc(100% / var(--gallery-num-columns, 1));
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(var(--gallery-rows, 1), 1fr);
    gap: 1.5rem;
    padding: 0 0.75rem;
    /* same as row gap (1.5rem between columns) */
    min-width: 0;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    aspect-ratio: 4/3;
    transition: var(--transition);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover {
    box-shadow: var(--shadow-md);
}

.gallery-item:hover img {
    transform: scale(1.08);
}


[data-theme="dark"] .gallery-item {
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .gallery-item:hover {
    box-shadow: var(--shadow-md), 0 0 20px rgba(46, 125, 50, 0.15);
}

[data-theme="dark"] .gallery-arrow {
    background: var(--bg-secondary);
    border-color: var(--primary-green);
    color: var(--primary-green);
}

[data-theme="dark"] .gallery-arrow:hover:not(:disabled) {
    background: var(--primary-green);
    color: var(--white);
}

.gallery-empty {
    width: 100%;
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

@media (max-width: 640px) {
    .gallery-carousel {
        min-height: auto;
    }

    .gallery-arrow {
        display: none;
    }
}

/* ========================================
   Contact Section
   ======================================== */
.contact {
    background: var(--bg-secondary);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
}

.contact-info h3 {
    color: var(--primary-green);
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.info-item svg {
    width: 30px;
    height: 30px;
    color: var(--primary-red);
    flex-shrink: 0;
}

.info-item strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    font-size: 1.1rem;
}

.info-item p {
    margin: 0;
    font-size: 0.95rem;
}

/* ========================================
   Contact Form
   ======================================== */
.contact-form {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group textarea:focus {
    border-color: var(--light-green);
    box-shadow: 0 0 0 3px rgba(102, 187, 106, 0.2), 0 0 20px rgba(102, 187, 106, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
    transform: scale(1.2);
}

.contact-form button {
    width: 100%;
    margin-top: 1rem;
    border: none;
    font-family: var(--font-body);
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    display: none;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    color: var(--white);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-logo img {
    height: 60px;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1);
}

.footer-logo p {
    color: var(--cream);
    font-size: 0.95rem;
}

.footer-links h4,
.footer-contact h4 {
    color: var(--white);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

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

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

.footer-links a {
    color: var(--cream);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--white);
    padding-left: 5px;
}

.footer-contact p {
    color: var(--cream);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-bottom p {
    color: var(--cream);
    font-size: 0.9rem;
}

.footer-bottom a {
    color: var(--cream);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer-bottom a:hover {
    opacity: 0.9;
}

/* ========================================
   Privacy modal & links
   ======================================== */
.privacy-link {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.privacy-link:hover {
    color: var(--primary-green);
}

.privacy-link.inline {
    font-weight: 500;
}

.footer-links .privacy-link,
.footer-bottom .privacy-link {
    color: var(--cream);
}

.footer-links .privacy-link:hover,
.footer-bottom .privacy-link:hover {
    opacity: 0.9;
}

.privacy-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.privacy-modal[hidden] {
    display: none;
}

.privacy-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.privacy-modal-content {
    position: relative;
    max-width: 560px;
    max-height: 85vh;
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.privacy-modal-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    padding: 1.25rem 3rem 1rem 1.25rem;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.privacy-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.privacy-modal-close:hover {
    background: var(--bg-tertiary);
}

.privacy-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    font-size: 0.95rem;
}

.privacy-modal-body h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin: 1.25rem 0 0.5rem;
    color: var(--text-secondary);
}

.privacy-modal-body h3:first-of-type {
    margin-top: 0;
}

.privacy-modal-body p {
    margin: 0 0 0.75rem;
}

.privacy-modal-body a {
    color: var(--primary-green);
    text-decoration: underline;
}

[data-theme="dark"] .privacy-modal-body a {
    color: var(--light-green);
}

.privacy-updated {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ========================================
   Animations
   ======================================== */
.fade-in {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
}

.fade-in.delay-1 {
    animation-delay: 0.3s;
}

.fade-in.delay-2 {
    animation-delay: 0.6s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.delay-1 {
    transition-delay: 0.2s;
}

.reveal.delay-2 {
    transition-delay: 0.4s;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Dark Mode Toggle (FAB)
   ======================================== */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-green), var(--light-green));
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--white);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 8px 40px rgba(46, 125, 50, 0.4);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle svg {
    width: 28px;
    height: 28px;
    transition: all 0.3s ease;
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .sun-icon {
        display: block;
    }

    :root:not([data-theme="light"]) .theme-toggle .moon-icon {
        display: none;
    }
}

[data-theme="dark"] .theme-toggle {
    background: linear-gradient(135deg, var(--primary-red), #8B3A3A);
}

[data-theme="dark"] .theme-toggle:hover {
    box-shadow: 0 8px 40px rgba(46, 125, 50, 0.4);
}

/* ========================================
   Dark Mode - Sistema (overrides senza data-theme)
   ======================================== */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .stat-item {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
    }

    :root:not([data-theme="light"]) .stat-item:hover {
        border-color: var(--primary-green);
        box-shadow: var(--shadow-md), 0 0 20px rgba(46, 125, 50, 0.15);
    }

    :root:not([data-theme="light"]) .about-image {
        box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-color);
    }

    :root:not([data-theme="light"]) .about-image:hover {
        box-shadow: var(--shadow-lg), 0 0 30px rgba(46, 125, 50, 0.2);
    }

    :root:not([data-theme="light"]) .service-card:hover {
        border-color: var(--primary-green);
        box-shadow: var(--shadow-lg), 0 0 30px rgba(46, 125, 50, 0.2);
    }

    :root:not([data-theme="light"]) .gallery-item:hover {
        box-shadow: var(--shadow-md), 0 0 20px rgba(46, 125, 50, 0.15);
    }

    :root:not([data-theme="light"]) .gallery-arrow {
        background: var(--bg-secondary);
        border-color: var(--primary-green);
        color: var(--primary-green);
    }

    :root:not([data-theme="light"]) .gallery-arrow:hover:not(:disabled) {
        background: var(--primary-green);
        color: var(--white);
    }

    :root:not([data-theme="light"]) .form-group input:focus,
    :root:not([data-theme="light"]) .form-group textarea:focus {
        border-color: var(--light-green);
        box-shadow: 0 0 0 3px rgba(102, 187, 106, 0.2), 0 0 20px rgba(102, 187, 106, 0.1);
    }

    :root:not([data-theme="light"]) .privacy-modal-body a {
        color: var(--light-green);
    }

    :root:not([data-theme="light"]) .theme-toggle {
        background: linear-gradient(135deg, var(--primary-red), #8B3A3A);
    }

    :root:not([data-theme="light"]) .theme-toggle:hover {
        box-shadow: 0 8px 40px rgba(46, 125, 50, 0.4);
    }
}

/* Animazione rotazione per il cambio tema */
.theme-toggle.rotating {
    animation: toggleRotate 0.5s ease-in-out;
}

@keyframes toggleRotate {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.1);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 968px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--bg-primary);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
        gap: 1.5rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .about-image {
        order: -1;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }


    .contact-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    section {
        padding: 3rem 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .section-header {
        margin-bottom: 2.5rem;
    }

    .btn {
        padding: 0.8rem 2rem;
        font-size: 0.9rem;
    }

    .contact-form {
        padding: 1.5rem;
    }

    /* FAB più piccolo su mobile */
    .theme-toggle {
        width: 50px;
        height: 50px;
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .theme-toggle svg {
        width: 24px;
        height: 24px;
    }
}