@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Quicksand:wght@500;600;700&display=swap');

:root {
    --primary-color: #55b2d8;
    /* Soft blue */
    --secondary-color: #ff9f43;
    /* Warm orange */
    --accent-color: #ff5285;
    /* Bright pink */
    --success-color: #10ac84;
    /* Leaf green */
    --warning-color: #feca57;
    /* Sun yellow */
    --bg-light: #f7fbfd;
    /* Very light blue/white */
    --text-main: #34495e;
    --text-muted: #7f8c8d;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-pill: 50px;
}

body {
    font-family: 'Nunito', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.6;
}

html,
body {
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
}

/* Typography Enhancements */
.display-4 {
    font-weight: 800;
    color: var(--primary-color);
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.05);
}

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

/* Helper Colors */
.text-primary-custom {
    color: var(--primary-color) !important;
}

.text-secondary-custom {
    color: var(--secondary-color) !important;
}

.text-accent-custom {
    color: var(--accent-color) !important;
}

.text-success-custom {
    color: var(--success-color) !important;
}

.text-warning-custom {
    color: var(--warning-color) !important;
}

/* Background Helpers */
.bg-primary-custom {
    background-color: var(--primary-color) !important;
    color: white;
}

.bg-secondary-custom {
    background-color: var(--secondary-color) !important;
    color: white;
}

.bg-accent-custom {
    background-color: var(--accent-color) !important;
    color: white;
}

.bg-success-custom {
    background-color: var(--success-color) !important;
    color: white;
}

.bg-warning-custom {
    background-color: var(--warning-color) !important;
    color: var(--text-main);
}

.bg-light-blue {
    background-color: #e3f2fd !important;
}

.bg-light-pink {
    background-color: #fce4ec !important;
}

.bg-light-yellow {
    background-color: #fff9c4 !important;
}

.bg-light-green {
    background-color: #e8f5e9 !important;
}

/* Navbar */
.navbar {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-size: 1.5rem;
    color: var(--primary-color) !important;
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-link {
    font-weight: 600;
    color: var(--text-main) !important;
    margin: 0 5px;
    padding: 8px 16px !important;
    border-radius: var(--radius-pill);
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--primary-color);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(85, 178, 216, 0.3);
}

/* Navbar Dropdown */
.nav-dropdown-menu {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.12);
    padding: 0.5rem;
    min-width: 200px;
    margin-top: 0.5rem !important;
}

.nav-dropdown-menu .dropdown-item {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    color: var(--text-main);
    border-radius: var(--radius-pill);
    padding: 8px 16px;
    transition: all 0.25s ease;
}

.nav-dropdown-menu .dropdown-item:hover,
.nav-dropdown-menu .dropdown-item:focus {
    background-color: var(--primary-color);
    color: white;
    transform: translateX(4px);
}

.nav-dropdown-menu .dropdown-item.active {
    background-color: var(--primary-color);
    color: white;
}

.nav-dropdown-divider {
    border-color: rgba(85, 178, 216, 0.2);
    margin: 0.3rem 0.5rem;
}

.navbar .nav-link.dropdown-toggle::after {
    transition: transform 0.3s ease;
}

.navbar .nav-item.dropdown.show .nav-link.dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-item.active, .dropdown-item:active {
    background-color: var(--primary-color) !important;
    color: white !important;
}

/* Home Carousel Customization */
.home-carousel-inner {
    height: 650px;
}

.custom-carousel-control {
    width: 10%;
}

.carousel-nav-icon {
    width: 50px;
    height: 50px;
}

.carousel-nav-icon:hover {
    transform: scale(1.1);
}

/* Hero Section */
.hero-section {
    position: relative;
    padding: 100px 0;
    overflow: hidden;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 60%;
    height: 150%;
    background: var(--warning-color);
    opacity: 0.1;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    animation: blob-float 10s ease-in-out infinite alternate;
    z-index: 0;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-image-wrap {
    position: relative;
}

.hero-image-wrap img {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 8px solid white;
    width: 100%;
    height: auto;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes blob-float {
    0% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
        transform: rotate(0deg);
    }

    100% {
        border-radius: 60% 40% 30% 70% / 50% 40% 50% 60%;
        transform: rotate(10deg) scale(1.05);
    }
}

/* Buttons */
.btn {
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-family: 'Quicksand', sans-serif;
    padding: 10px 24px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(85, 178, 216, 0.4);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #3ca2c8;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(85, 178, 216, 0.5);
}

.btn-secondary {
    background-color: var(--secondary-color);
    box-shadow: 0 4px 15px rgba(255, 159, 67, 0.4);
    color: white;
}

.btn-secondary:hover {
    background-color: #f38f32;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 159, 67, 0.5);
    color: white;
}

.btn-accent {
    background-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(255, 82, 133, 0.4);
    color: white;
}

.btn-accent:hover {
    background-color: #e54271;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 82, 133, 0.5);
}

/* Cards (Glassmorphism & Playful) */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    padding: 2rem;
    transition: all 0.3s ease;
    height: 100%;
}

.glass-card:hover {
    box-shadow: 0 15px 35px rgba(31, 38, 135, 0.15);
    background: rgba(255, 255, 255, 0.9);
}

/* Decorative Utils (Extracted from inline styles) */
.decor-circle-lg-tr {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -50px;
}

.decor-circle-lg-tl {
    width: 200px;
    height: 200px;
    top: -60px;
    left: -50px;
}

.decor-circle-md-br {
    width: 250px;
    height: 250px;
    bottom: -50px;
    right: -50px;
}

.decor-circle-md-bl {
    width: 250px;
    height: 250px;
    bottom: -80px;
    left: -50px;
}

.decor-circle-sm-tl {
    width: 100px;
    height: 100px;
    top: -20px;
    left: -20px;
    z-index: -1;
}

.decor-circle-xs-br {
    width: 60px;
    height: 60px;
    bottom: -30px;
    right: 20px;
    z-index: -1;
}

.decor-circle-servizi {
    width: 200px;
    height: 200px;
    bottom: -50px;
    right: 10%;
}

/* Storia Timeline */
.timeline-center-line {
    width: 4px;
    height: 100%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    opacity: 0.5;
}

.timeline-icon-node {
    width: 50px;
    height: 50px;
    z-index: 2;
}

/* Feature Icons */
.feature-icon-lg {
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
}

.feature-icon-md {
    width: 60px;
    height: 60px;
    font-size: 1.6rem;
}

/* Utilities */
.btn-iscrizione {
    min-height: 60px;
    font-size: 1.15rem;
}

.hero-image-border {
    border: 10px solid white;
}

.glass-no-border {
    border: none !important;
}

.mx-w-800 {
    max-width: 800px;
}

.doc-card {
    border-radius: 16px;
}

.doc-box-lh {
    line-height: 1.4;
    color: #2d3436;
}

.contact-method-card {
    border: 1px solid var(--glass-border);
}

.map-wrapper {
    height: 250px;
    border: 5px solid white;
}

.feature-icon-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.feature-icon-wrap::after {
    content: '';
    position: absolute;
    top: -5px;
    right: -5px;
    bottom: -5px;
    left: -5px;
    border-radius: 50%;
    z-index: -1;
    opacity: 0.5;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.2;
    }

    100% {
        transform: scale(0.95);
        opacity: 0.5;
    }
}

.card-title {
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Forms */
.form-control,
.form-select {
    border-radius: var(--radius-md);
    padding: 12px 20px;
    border: 2px solid #e1e8ed;
    background-color: #fdfdfd;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(85, 178, 216, 0.15);
    background-color: #fff;
}

/* Document Icons */
.doc-item {
    border-radius: var(--radius-md);
    background: white;
    border-left: 5px solid var(--primary-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.doc-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.doc-icon {
    font-size: 2.5rem;
}

.doc-pdf {
    color: #e74c3c;
    border-left-color: #e74c3c;
}

.doc-word {
    color: #2980b9;
    border-left-color: #2980b9;
}

/* Timeline for Notizie */
.timeline {
    position: relative;
    padding-left: 3rem;
    border-left: 3px solid #e1e8ed;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -3.5rem;
    top: 0.5rem;
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(85, 178, 216, 0.3);
}

.timeline-date {
    display: inline-block;
    padding: 5px 15px;
    background-color: var(--warning-color);
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

/* Waves Divider */
.custom-shape-divider-bottom {
    position: relative;
    width: 100%;
    line-height: 0;
    direction: ltr;
}

.custom-shape-divider-bottom svg {
    display: block;
    width: calc(100% + 1.3px);
    height: 80px;
}

.shape-fill {
    fill: var(--bg-light);
}

.shape-fill-white {
    fill: #ffffff;
}

/* Footer Section */
footer {
    background-color: #2d3436;
    /* Dark slate */
    color: #dfe6e9;
    padding-top: 5rem;
    padding-bottom: 2rem;
    position: relative;
}

footer h5 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

footer a {
    color: #b2bec3;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--warning-color);
}

.social-icon {
    display: inline-flex;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background-color: var(--primary-color);
    color: white !important;
    transform: translateY(-3px);
}

/* Utilities */
.rounded-4 {
    border-radius: var(--radius-md) !important;
}

.rounded-5 {
    border-radius: var(--radius-lg) !important;
}

/* Responsive Adjustments */
@media (max-width: 991px) {
    .navbar-collapse {
        background: var(--glass-bg);
        border-radius: var(--radius-md);
        padding: 1rem;
        margin-top: 1rem;
    }

    .hero-section {
        text-align: center;
        padding: 60px 0;
    }

    .hero-image-wrap {
        margin-top: 3rem;
    }

    .display-4 {
        font-size: 2.5rem;
    }
}

@media (max-width: 767px) {
    .home-carousel-inner {
        height: auto;
        aspect-ratio: 1 / 1;
        min-height: 350px;
        max-height: 500px;
    }

    .custom-carousel-control {
        width: 15%;
    }

    .carousel-nav-icon {
        width: 40px;
        height: 40px;
    }

    .carousel-nav-icon .bi {
        font-size: 1.5rem !important;
        /* Make icon slightly smaller */
    }
}