/* ==========================================================================
   STILE PERSONALIZZATO COORDINATO - PORTALE ISTITUZIONALE
   Colori: Blu Notte (#1b365d) e Giallo Oro (#f1c40f)
   ========================================================================== */

/* --- 1. VARIABILI E COLORI BASE --- */
:root {
    /* I colori del design istituzionale (Header e accenti) */
    --primary-dark: #1b365d; /* Blu Notte Scuro */
    --accent-gold: #f1c40f;  /* Giallo Oro */
    --gold-hover: #d4ac0d;   /* Un oro leggermente più scuro per l'hover */
    
    /* Sovrascriviamo il colore primario di Bootstrap per i componenti standard */
    --bs-primary: #1b365d; 
    --bs-primary-rgb: 27, 54, 93;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #fcfcfc;
    color: #333;
}

/* Link generici nel testo */
a {
    color: var(--primary-dark);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--accent-gold);
}

/* ==========================================================================
   2. HEADER / NAVBAR ISTITUZIONALE (Invariato, già coordinato)
   ========================================================================== */
.custom-navbar {
    background-color: var(--primary-dark) !important;
    padding-top: 10px;
    padding-bottom: 10px;
}

.header-logo-img {
    max-height: 60px;
    width: auto;
    display: block;
    margin: 5px 0;
    transition: all 0.3s ease;
}

.custom-navbar .nav-link {
    color: #ffffff !important;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    font-weight: 500;
    padding: 0.5rem 1.1rem !important;
    transition: color 0.3s;
}

.custom-navbar .nav-link:hover,
.custom-navbar .nav-link.active-gold {
    color: var(--accent-gold) !important;
}

.dropdown-menu-custom {
    background-color: var(--primary-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-menu-custom .dropdown-item {
    color: #ffffff;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.dropdown-menu-custom .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent-gold);
}

.social-nav a {
    color: #ffffff;
    font-size: 1.2rem;
    margin-left: 15px;
}

.social-nav a:hover {
    color: var(--accent-gold);
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ==========================================================================
   3. PULSANTI PERSONALIZZATI COORDINATI (La vera novità!)
   ========================================================================== */
/* Pulsante Principale (Giallo Oro con testo Blu Notte) */
.btn-primary {
    background-color: var(--accent-gold) !important;
    border-color: var(--accent-gold) !important;
    color: var(--primary-dark) !important;
    transition: all 0.3s ease;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--gold-hover) !important;
    border-color: var(--gold-hover) !important;
    color: var(--primary-dark) !important;
    box-shadow: 0 5px 15px rgba(241, 196, 15, 0.3) !important;
}

/* Pulsante Outline Light (Usato nella Hero con fondo scuro) */
.btn-outline-light:hover {
    background-color: var(--accent-gold) !important;
    border-color: var(--accent-gold) !important;
    color: var(--primary-dark) !important;
}

/* Pulsante Outline Primary (Usato nelle card bianche) */
.btn-outline-primary {
    color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}
.btn-outline-primary:hover {
    background-color: var(--primary-dark) !important;
    color: #ffffff !important;
}

/* Pulsante Fluttuante Sportello (Ora coordinato Giallo Oro) */
.btn-floating {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1040;
    border-radius: 50px;
    padding: 15px 25px;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: pulse-gold 2s infinite;
    background-color: var(--accent-gold);
    border-color: var(--accent-gold);
    color: var(--primary-dark);
}

.btn-floating:hover {
    background-color: var(--gold-hover);
    border-color: var(--gold-hover);
    color: var(--primary-dark);
}

/* Animazione del pulsante coordinata sull'oro */
@keyframes pulse-gold {
    0% { box-shadow: 0 0 0 0 rgba(241, 196, 15, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(241, 196, 15, 0); }
    100% { box-shadow: 0 0 0 0 rgba(241, 196, 15, 0); }
}

/* ==========================================================================
   4. COMPONENTI E FASCE (Home Page)
   ========================================================================== */
.hero-parallax-slide {
    height: 85vh;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Cambiamo il gradiente della Hero per usare il Blu Notte invece del nero */
.hero-parallax-slide::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Gradiente semi-trasparente basato sul Blu Notte dell'header */
    background: linear-gradient(rgba(27, 54, 93, 0.1), rgba(27, 54, 93, 0.7)); 
}

.inter-parallax {
    height: 50vh;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    width: 100%;
}

/* Card delle Priorità */
.service-card {
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    border-radius: 10px;
    background-color: #ffffff;
    border-bottom: 4px solid var(--accent-gold) !important; /* Accento Oro */
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 1rem 3rem rgba(27, 54, 93, 0.1) !important; /* Ombra bluastra */
}

/* Colore delle icone nelle card bianche */
.icon-box i {
    color: var(--primary-dark);
    transition: transform 0.3s ease;
}

.service-card:hover .icon-box i {
    transform: scale(1.1);
    color: var(--accent-gold); /* L'icona diventa oro al passaggio del mouse */
}

/* ==========================================================================
   5. TIMELINE VERTICALE (Pagina Risultati)
   ========================================================================== */
.custom-timeline {
    position: relative;
    padding-left: 50px;
    margin: 0 auto;
    max-width: 800px;
}

.custom-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #e9ecef;
    border-radius: 4px;
}

.timeline-step {
    position: relative;
    margin-bottom: 50px;
}

.timeline-step:last-child {
    margin-bottom: 0;
}

.timeline-icon {
    position: absolute;
    left: -50px;
    top: 0;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 0 0 5px #ffffff, 0 5px 15px rgba(0,0,0,0.1);
    z-index: 1;
}

.timeline-content {
    background: #ffffff;
    padding: 20px 25px;
    border-radius: 8px;
    border-left: 5px solid transparent;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.timeline-content:hover {
    transform: translateX(5px);
}

/* Colori Bordi Timeline Coordinati */
.timeline-step:nth-child(1) .timeline-content { border-left-color: #dc3545; } /* Problema (Rosso) */
.timeline-step:nth-child(2) .timeline-content { border-left-color: var(--primary-dark); } /* Azione (Blu Notte) */
.timeline-step:nth-child(3) .timeline-content { border-left-color: #198754; } /* Approvazione (Verde) */
.timeline-step:nth-child(4) .timeline-content { border-left-color: var(--accent-gold); } /* Lavori in corso (Oro) */


/* ==========================================================================
   6. OTTIMIZZAZIONI MOBILE E RESPONSIVE
   ========================================================================== */
@media (max-width: 991px) {
    .header-logo-img { max-height: 45px; }
    .custom-navbar .nav-link { padding: 10px 0 !important; }
}

@media (max-width: 768px) {
    .hero-parallax-slide, 
    .inter-parallax { 
        background-attachment: scroll; 
    }
    
    .btn-floating { 
        bottom: 20px; 
        right: 20px; 
        padding: 12px 20px; 
        font-size: 1rem; 
    }
    
    .custom-timeline { padding-left: 40px; }
    .custom-timeline::before { left: 10px; }
    .timeline-icon { left: -40px; width: 35px; height: 35px; font-size: 1rem; }
}