/* =================================================================== */
/*  1. CSS Variables & Global Styles
/* =================================================================== */

:root {
    /* Color Palette (Triad) */
    --primary-color: #6C9A8B;   /* Muted Teal */
    --secondary-color: #A86C9A; /* Muted Purple */
    --accent-color: #8B6C9A;    /* A softer purple for accents */
    
    /* Neumorphism Base */
    --bg-color: #E0E5EC;
    --shadow-light: rgba(255, 255, 255, 0.9);
    --shadow-dark: rgba(163, 177, 198, 0.7);

    /* Typography */
    --text-color: #333745;
    --text-color-light: #FFFFFF;
    --text-color-secondary: #5a6175;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Work Sans', sans-serif;

    /* Neumorphic Shadows */
    --shadow-neumorphic: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
    --shadow-neumorphic-inset: inset 8px 8px 16px var(--shadow-dark), inset -8px -8px 16px var(--shadow-light);
    --shadow-neumorphic-pressed: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
    
    /* Gradients */
    --gradient-bg: linear-gradient(145deg, #f0f5f9, #c8d0e7);
    --gradient-dynamic: linear-gradient(135deg, var(--primary-color), var(--secondary-color));

    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
    background-color: var(--bg-color);
    font-family: var(--font-body);
    color: var(--text-color);
    line-height: 1.7;
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-color);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.section-title-light {
    color: var(--text-color-light);
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

p {
    color: var(--text-color-secondary);
    font-weight: 400;
}

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

a:hover {
    color: var(--secondary-color);
}

/* =================================================================== */
/*  2. Global Component Styles
/* =================================================================== */

/* --- Buttons --- */
.btn, button, input[type='submit'] {
    border-radius: 12px;
    padding: 12px 28px;
    font-weight: 500;
    border: none;
    box-shadow: var(--shadow-neumorphic);
    transition: var(--transition-smooth);
    background: var(--bg-color);
    color: var(--text-color);
}

.btn:hover, button:hover, input[type='submit']:hover {
    transform: translateY(-2px);
    box-shadow: 10px 10px 20px var(--shadow-dark), -10px -10px 20px var(--shadow-light);
    color: var(--primary-color);
}

.btn:active, button:active, input[type='submit']:active {
    box-shadow: var(--shadow-neumorphic-pressed);
    transform: translateY(1px);
}

.btn-primary {
    background: var(--gradient-dynamic);
    color: var(--text-color-light);
}

.btn-primary:hover {
    color: var(--text-color-light);
    opacity: 0.9;
}

/* --- Cards --- */
.card.neumorphic-card {
    border-radius: 20px;
    border: none;
    background: var(--bg-color);
    box-shadow: var(--shadow-neumorphic);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.card.neumorphic-card:hover {
    transform: translateY(-5px);
    box-shadow: 12px 12px 24px var(--shadow-dark), -12px -12px 24px var(--shadow-light);
}

.card-image {
    width: 100%;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-image img {
    border-radius: 15px;
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin: 0 auto;
}

.card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- Forms --- */
.neumorphic-input {
    border-radius: 12px;
    border: none;
    padding: 12px 20px;
    background: var(--bg-color);
    box-shadow: var(--shadow-neumorphic-inset);
    transition: var(--transition-smooth);
    color: var(--text-color);
}

.neumorphic-input:focus {
    outline: none;
    box-shadow: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light), 0 0 0 2px var(--primary-color);
}

/* =================================================================== */
/*  3. Section Specific Styles
/* =================================================================== */

/* --- Header --- */
.header {
    background: rgba(224, 229, 236, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.navbar-brand {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    margin: 0 0.5rem;
    transition: var(--transition-smooth);
}

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

/* --- Hero Section --- */
.hero-section {
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-color-light);
}

.hero-title {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

/* --- Parallax Sections --- */
.parallax-section {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    padding: 6rem 0;
}

/* --- Background Gradients --- */
.bg-light-gradient {
    background: var(--gradient-bg);
}

/* --- Vision Section --- */
.neumorphic-progress {
    height: 1.5rem;
    border-radius: 1rem;
    background: var(--bg-color);
    box-shadow: var(--shadow-neumorphic-inset);
    padding: 4px;
}

.progress-bar {
    border-radius: 0.8rem;
    background: var(--gradient-dynamic);
}

/* --- Contact Section --- */
#contatti .neumorphic-card {
    background: var(--bg-color);
}

/* --- Footer --- */
.footer {
    background: #d1d9e6;
    padding-top: 3rem;
    padding-bottom: 1rem;
}

.footer h5 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.footer p {
    color: var(--text-color-secondary);
}

.footer .list-unstyled li a {
    color: var(--text-color-secondary);
    padding: 0.2rem 0;
    display: inline-block;
}

.footer .list-unstyled li a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* --- Modal --- */
.modal-content.neumorphic-modal {
    border-radius: 20px;
    border: none;
    background: var(--bg-color);
    box-shadow: var(--shadow-neumorphic);
}

.modal-header, .modal-footer {
    border: none;
}

/* =================================================================== */
/*  4. Page Specific Styles
/* =================================================================== */

/* --- Success Page --- */
.success-page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    background: var(--gradient-bg);
}

.success-card {
    max-width: 600px;
    width: 100%;
    padding: 3rem;
    border-radius: 25px;
    background-color: var(--bg-color);
    box-shadow: var(--shadow-neumorphic);
}

/* --- Privacy & Terms Pages --- */
.legal-page-container, .about-page-container, .contacts-page-container {
    padding-top: 120px;
    padding-bottom: 60px;
}

.legal-page-container .content-wrapper,
.about-page-container .content-wrapper,
.contacts-page-container .content-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

/* =================================================================== */
/*  5. Media Queries
/* =================================================================== */
@media (max-width: 991.98px) {
    .navbar-nav {
        background: var(--bg-color);
        border-radius: 12px;
        margin-top: 1rem;
        padding: 1rem;
        box-shadow: var(--shadow-neumorphic);
    }
}

@media (max-width: 767.98px) {
    .section-title, .section-title-light {
        font-size: 2rem;
    }

    .hero-section {
        background-attachment: scroll; /* Disable parallax on mobile for performance */
    }

    .parallax-section {
        background-attachment: scroll;
    }
}