/* ==========================================================================
   STYLE.CSS - Indice
   ==========================================================================
   1. VARIABILI E IMPOSTAZIONI GLOBALI
   2. RESET E STILI DI BASE
   3. LAYOUT CONTAINERS
   4. LAYOUT UTILITY WRAPPER (Griglia Principale)
   5. COMPONENTI
      - CTA Buttons
   6. SEZIONI SPECIFICHE
      - SIDEBAR (EX UTILITY SECTION)
      - NEWSLETTER
   7. UTILITIES (Classi di aiuto)
   8. ACCESSIBILITÀ
   9. RESPONSIVE DESIGN
   ========================================================================== */

/* ===================================== */
/* 1. VARIABILI E IMPOSTAZIONI GLOBALI   */
/* ===================================== */

:root {
    /* Colori Principali */
    --primary-color: #01173d;
    --primary-light: #1a2f5a;
    --primary-dark: #000b1f;
    --secondary-color: #e8491d;
    --secondary-light: #ff6b42;
    --secondary-dark: #c13e19;
    
    /* Palette Estesa */
    --accent-color: #8bae00;
    --accent-light: #a4c917;
    --accent-dark: #6d8a00;
    --text-color: #333333;
    --text-light: #666666;
    --text-dark: #1a1a1a;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --dark-gray: #6c757d;
    --white: #ffffff;
    --black: #000000;
    
    /* Ombre e Effetti */
    --shadow-light: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-medium: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-heavy: 0 8px 32px rgba(0,0,0,0.16);
    --border-radius: 8px;
    --border-radius-large: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Typography */
    --font-primary: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
}

/* ===================================== */
/* 2. RESET E STILI DI BASE              */
/* ===================================== */

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

*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-color);
    background: var(--light-gray);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--spacing-sm);
}

h1 { font-size: var(--font-size-3xl); }
h2 { 
    font-size: var(--font-size-2xl);
    margin-top: var(--spacing-lg);
}
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }

p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-color);
}

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

a:hover {
    color: var(--primary-light);
}

/* ===================================== */
/* 3. LAYOUT CONTAINERS                  */
/* ===================================== */

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.page-wrapper {
    position: relative;
    background-color: var(--light-gray);
}

.carousel-hero {
    position: sticky;
    top: 0;
    z-index: 1;
}

.home-body {
    position: relative;
    z-index: 2;
    background-color: var(--light-gray);
    padding: var(--spacing-xl) 0;
}

/* ===================================== */
/* 4. LAYOUT UTILITY WRAPPER             */
/* ===================================== */

.utility-wrapper {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 25px;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.sidebar {
    margin-top: 3rem;
}

/* Card Base Style per le sezioni principali e la sidebar */
.main-content > *,
.sidebar > * {
    background: var(--white);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    overflow: hidden;
}

.main-content > *:hover,
.sidebar > *:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}


/* ===================================== */
/* 5. COMPONENTI                         */
/* ===================================== */

/* ----- CTA Buttons ----- */
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: var(--white);
    text-decoration: none;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: var(--font-size-base);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    text-transform: none;
    letter-spacing: 0.3px;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
    transition: left 0.6s ease;
}

.cta-button:hover {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, #a83315 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    color: var(--white);
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-light);
}

/* ... (restanti stili per i pulsanti) ... */


/* ----- NEWSLETTER ----- */
.newsletter-section {
    background: linear-gradient(135deg, var(--white) 0%, #f8f9ff 100%);
    padding: var(--spacing-xl);
    margin: var(--spacing-lg) auto;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-medium);
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--medium-gray);
    max-width: 1300px;
    width: calc(100% - 50px);
}

/* ... (restanti stili newsletter) ... */


/* ===================================== */
/* 7. UTILITIES (Classi di aiuto)        */
/* ===================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.hidden { display: none; }
.visible { display: block; }


/* ===================================== */
/* 8. ACCESSIBILITÀ                      */
/* ===================================== */

button:focus,
input:focus,
a:focus,
.cta-button:focus {
    outline: 3px solid var(--secondary-light);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===================================== */
/* 9. RESPONSIVE DESIGN                  */
/* ===================================== */

/* Tablet (fino a 1024px) */
@media (max-width: 1024px) {
    :root {
        --font-size-3xl: 1.75rem;
        --font-size-2xl: 1.375rem;
    }
}

/* Layout Desktop (da 992px in su) */
@media (min-width: 992px) {
    .utility-wrapper {
        display: grid;
        grid-template-columns: 1fr 340px;
        gap: 2.5rem;
        align-items: flex-start;
    }

    .sidebar {
        margin-top: 0;
        top: calc(var(--header-height, 75px) + 2rem);
    }
}


/* Mobile Large (fino a 800px) */
@media (max-width: 800px) {
    .newsletter-section {
        padding: var(--spacing-lg);
        margin: var(--spacing-md) auto;
    }
    
    .newsletter-form {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .newsletter-form input[type="email"] {
        width: 100%;
    }
    
    .newsletter-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-button {
        width: 100%;
        max-width: 350px;
        justify-content: center;
    }
}

/* Mobile Small (fino a 480px) */
@media (max-width: 480px) {
    :root {
        --font-size-3xl: 1.6rem;
        --font-size-2xl: 1.25rem;
        --spacing-xl: 2.5rem;
    }
    
    .container {
        width: 95%;
        padding: 0;
    }
    
    .newsletter-section {
        padding: var(--spacing-lg) var(--spacing-md);
        width: calc(100% - 20px);
    }
    
    .newsletter-section h2 {
        font-size: var(--font-size-xl);
    }

    .newsletter-section p {
        font-size: var(--font-size-base);
    }
}
