/* ===== ROOT VARIABLES ===== */
:root {
    --primary-color: #0066cc;
    --secondary-color: #004499;
    --accent-color: #ff6600;
    --text-dark: #333333;
    --text-light: #666666;
    --bg-light: #ECECEC;
    --bg-dark: #1a1a1a;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-color);
}

img {
    max-width: 100%;
    height: auto;
}
.row p:not(.section-subtitle) {text-align:justify;}
.bg-light{background-color:var(--bg-light)!important;}

#mainSiteMenuNavTop{box-shadow:2px 2px 6px rgba(0,0,0,.3)}
.navbar-brand{height:32px;width:32px;text-decoration:none;border:0;margin:0;padding:0;margin-right:32px;}
.navbar-brand>img{position:absolute;width:64px;height:64px;border-radius:50%;background-color:#ECECEC;box-shadow:2px 2px 6px rgba(0,0,0,.3)}

/* ===== HERO SECTION ===== */
.hero-section {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section .carousel-inner::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
	background-size: cover;
	z-index:1;
	pointer-events: none;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-stats {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
}

.carousel-fullheight {
  --carousel-height: 400px;   /* fallback */
  height: var(--carousel-height);
}

.carousel-fullheight .carousel-inner,
.carousel-fullheight .carousel-item,
.carousel-fullheight img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.carousel-fullheight .carousel-caption {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  bottom: auto;          /* togliamo il bottom default */
}
.carousel-fullheight .carousel-caption h5 {
	/* MIN: 0.9 rem — IDEALE: 1.1 vw + 0.8 rem — MAX: 1.5 rem */
	font-size: clamp(0.9rem, 0.8rem + 1.5vw, 2rem);
}

/* ===== SECTIONS ===== */
.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 3rem;
}

/* ===== FEATURE BOXES ===== */
.feature-box {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
}
.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}
.feature-box i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}
.feature-box p {text-align:justify;}

/* ================================================= */
/* 4. TIMELINE VERTICALE INTEGRATA (SOLO DESKTOP) */
/* ================================================= */



/* Adattamento degli stili forniti per renderli meno invasivi */
.timeline-speaker {
	padding: 1em;
	border-radius: 10px;
	height: 100%; /* Occupa l'altezza della colonna adiacente */
	text-align: left; /* Il testo della fase deve essere a sinistra */
	color:inherit;
}
#timeline-steps .container {width: 80%;max-width: 1200px;}
.timeline-speaker .progress-indicator {width:100%;list-style:none;padding:0;}
.timeline-speaker .progress-indicator > li {
	height: 120px;
	position:relative;
	padding-left: 10px;
	cursor: pointer;
	transition: var(--bs-primary); 0.3s, color 0.3s;
}
.timeline-speaker .progress-indicator > li::before {
	content: '';position:absolute;
	top:0;left:4px;width:2px;height:100%;background-color:var(--bs-gray-500);z-index: 1;
}
.timeline-speaker .stacked-text {
	position:relative;top:20px;left:15px;display:block;
	font-size:1.1rem;font-weight: 600;z-index: 2;padding-left:.5em;
	overflow:hidden;text-overflow:clip;height:55px;
}
.timeline-speaker .stacked-text::after{content:"";position:absolute;height:0;width:0;
	border-right:25px solid transparent;
	border-left:25px solid transparent;
	border-top:25px solid transparent;
	border-bottom:25px solid transparent;
	top:2px;right:0px;
}
.timeline-speaker .subdued {
	font-size: 0.8rem;
	display: block;
	opacity: 0.7;
	font-weight: 400;
}

.timeline-speaker .bubble {
position: absolute;left:-10px;top:30px;width: 30px;height: 30px;
background-color: var(--bs-gray-500);
border-radius:50%;z-index: 10;box-shadow: 0 0 0 2px #FFF;transition: background-color 0.3s;
}
.timeline-speaker .bubble::after{content:attr(data-num);position:absolute;
	font-size:1.2em;font-weight:bold;top:-1px;left:0;border-radius:50%;
	width:30px;height:30px;line-height:30px;text-align:center;background:transparent;z-index:4}

.timeline-speaker .active-step .stacked-text{color:var(--bs-primary)}
.timeline-speaker .active-step .stacked-text::after{border-right-color:var(--bs-gray-200)}
.timeline-speaker .active-step .bubble{color:var(--bg-light);background-color:var(--bs-primary)}

.timeline-content-display{background-color:var(--bs-gray-200);border-radius:5px;}
.timeline-detail {padding: 20px;margin-bottom: 20px;}

.image-fix-bg[data-img]{
	background-repeat:no-repeat;background-origin:center center;background-size:cover;
	min-height: 250px;background-attachment: fixed; border-radius:4px;
}


/* ===== SERVICE CARDS ===== */
.service-card {
    text-align: center;
    padding: 2.5rem 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.service-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

/* ===== TEAM MEMBERS ===== */
.team-member {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.team-member:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.member-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 1rem;
    background: var(--bg-light);
}

.member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.role {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.description {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ===== CONTACT FORM ===== */
.contact-form .form-control {
    border: 2px solid var(--border-color);
    border-radius: 5px;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.contact-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

.contact-info .info-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.contact-info .info-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-right: 1rem;
    width: 30px;
}

/* ===== MODAL ===== */
/* Sfondo scurissimo per dare risalto */
#imageModal .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.9);
}

/* Rimuove i bordi e lo sfondo bianco della modale */
.custom-modal-content {
    background: transparent !important;
    border: none !important;
}

/* Forza l'immagine a non superare mai le dimensioni dello schermo */
.img-fullscreen {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain; /* Mantiene le proporzioni */
    box-shadow: 0 0 20px rgba(0,0,0,0.5); /* Ombra leggera per staccare dal fondo */
    border-radius: 4px; /* Un minimo di arrotondamento la rende più moderna */
}

/* Pulsante di chiusura personalizzato (X in alto a destra) */
.btn-close-custom {
    position: fixed;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    transition: 0.3s;
    z-index: 1060;
}

.btn-close-custom:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* ===== FOOTER ===== */
footer {
    background: var(--bg-dark) !important;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-left: 0.5rem;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .hero-section {
        text-align: center;
        padding: 100px 0 50px;
    }
    
    .hero-stats {
        margin-top: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .navbar-nav {
        text-align: center;
        padding: 1rem 0;
    }
    
    .navbar-nav .nav-link::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .btn-primary {
        padding: 0.5rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .feature-box,
    .service-card {
        padding: 1.5rem;
    }
}

/* ===== CROSS-BROWSER COMPATIBILITY ===== */
/* IE11 Support */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .hero-section {
        background: #667eea;
    }
    
    .feature-box,
    .service-card,
    .team-member {
        border: 1px solid var(--border-color);
    }
}

/* Safari specific fixes */
@supports (-webkit-appearance: none) {
    .hero-stats {
        -webkit-backdrop-filter: blur(10px);
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar,
    footer,
    .btn,
    .social-links {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .hero-section {
        background: none !important;
        color: black !important;
    }
}