/* =========================================
   1. IMPORT E IMPOSTAZIONI BASE
   ========================================= */

/* Contenuto principale con Roboto */
body {
    font-family: 'Roboto', sans-serif;
    color: #212529; /* Colore testo base scuro */
}

/* Elementi con Lexend Deca (Titoli e UI) */
.navbar-brand,
.nav-link,
.dropdown-item,
.btn,
h1, h2, h3, h4, h5, h6,
.display-1, .display-2, .display-3, .display-4,
.lead,
.card-title,
.fw-bold,
.footer-text {
    font-family: 'Lexend Deca', sans-serif;
}

/* Smooth scroll per le ancore */
html {
    scroll-behavior: smooth;
}

/* =========================================
   2. VARIABILI COLORI BRAND (DAL LOGO)
   ========================================= */
:root {
    /* Arancione scuro "Gerardi" e icona sinistra */
    --brand-orange: #c85c2e; 
    --brand-orange-hover: #a6461f; 
    
    /* Grigio medio icona centrale */
    --brand-gray: #aab0b5;   
    --brand-gray-hover: #8c9296; 
}

/* =========================================
   3. OVERRIDE BOOTSTRAP: CLASS WARNING
   (Sostituisce il giallo con l'Arancione Brand)
   ========================================= */

/* Testo Arancione */
.text-warning {
    color: var(--brand-orange) !important;
}
a.text-warning:hover {
    color: var(--brand-orange-hover) !important;
}

/* Sfondi Arancioni (es. Badge) */
.bg-warning {
    background-color: var(--brand-orange) !important;
    color: #ffffff !important;
}

/* Bordi Arancioni */
.border-warning {
    border-color: var(--brand-orange) !important;
}

/* Bottoni Warning (es. Richiedi Consulenza) */
.btn-warning {
    background-color: var(--brand-orange) !important;
    border-color: var(--brand-orange) !important;
    color: #ffffff !important; /* Testo bianco per leggibilità */
    font-weight: 600;
}

.btn-warning:hover,
.btn-warning:active,
.btn-warning:focus {
    background-color: var(--brand-orange-hover) !important;
    border-color: var(--brand-orange-hover) !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.25rem rgba(200, 92, 46, 0.5) !important;
}

/* Bottoni Outline Warning */
.btn-outline-warning {
    color: var(--brand-orange) !important;
    border-color: var(--brand-orange) !important;
}
.btn-outline-warning:hover {
    background-color: var(--brand-orange) !important;
    color: #ffffff !important;
}

/* Input form focus (bordo arancione quando clicchi) */
.form-control:focus {
    border-color: var(--brand-orange) !important;
    box-shadow: 0 0 0 0.25rem rgba(200, 92, 46, 0.25) !important;
}

/* Checkbox quando selezionata */
.form-check-input:checked {
    background-color: var(--brand-orange) !important;
    border-color: var(--brand-orange) !important;
}

/* =========================================
   4. OVERRIDE BOOTSTRAP: CLASS SECONDARY
   (Sostituisce il grigio default con Grigio Brand)
   ========================================= */

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

.bg-secondary {
    background-color: var(--brand-gray) !important;
    color: #ffffff !important;
}

.border-secondary {
    border-color: var(--brand-gray) !important;
}

.btn-secondary {
    background-color: var(--brand-gray) !important;
    border-color: var(--brand-gray) !important;
    color: #ffffff !important;
}

.btn-secondary:hover,
.btn-secondary:active,
.btn-secondary:focus {
    background-color: var(--brand-gray-hover) !important;
    border-color: var(--brand-gray-hover) !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.25rem rgba(170, 176, 181, 0.5) !important;
}

/* =========================================
   5. EFFETTI E COMPONENTI SPECIFICI
   ========================================= */

/* Effetti hover card */
.hover-shadow {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-shadow:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(200, 92, 46, 0.15); /* Ombra aranciata leggera */
}

/* Navbar scroll transition */
.navbar {
    transition: background-color 0.3s ease, padding 0.3s ease;
}

.navbar.scrolled {
    background-color: rgba(33, 37, 41, 0.98) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* SVG Styles */
.footer-text { 
    font-weight: 700; 
    font-size: 24px; 
    fill: #ffffff; 
}

/* Se vuoi mantenere il blu per "Associati" nel footer */
.footer-blue { fill: #0d6efd; }


/* Impedisce alla navbar fissa di coprire i titoli delle sezioni */
section[id] {
    scroll-margin-top: 100px; /* Regola questo valore in base all'altezza della navbar */
}

/* Se usi ancore su div specifici fuori dalle section */
[id] {
    scroll-margin-top: 100px;
}

#consulenza, #servizi, #team, #contatti {
    scroll-margin-top: 100px; /* Altezza navbar + respiro */
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand-orange) !important;
    box-shadow: 0 0 0 0.25rem rgba(200, 92, 46, 0.25) !important;
    outline: none;
}

/* =========================================
   6. NUOVE REGOLE PER HERO SECTION (aggiunte)
   ========================================= */
.hero-section {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    color: #fff;
    overflow: hidden;
}
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(20deg, rgba(0,0,0,0.85) 0%, rgba(0, 0, 0, 0.616) 20%, rgba(0,0,0,0.2) 90%);
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
}
.hero-title span {
    color: var(--brand-orange, #c85c2e);
}
.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0.9;
}
.hero-form-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    overflow: hidden;
}
.hero-form-header {
    background: var(--brand-orange, #c85c2e);
    color: #fff;
    padding: 15px 20px;
    text-align: center;
}
.hero-form-header h3 {
    margin: 0;
    font-weight: 700;
    font-size: 1.2rem;
}
.form-control, .form-select {
    border: 1px solid #ddd;
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-orange, #c85c2e);
    box-shadow: 0 0 0 0.25rem rgba(200, 92, 46, 0.25);
}
.btn-hero {
    background-color: var(--brand-orange, #c85c2e);
    border: none;
    color: white;
    font-weight: 600;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.btn-hero:hover {
    background-color: #a8461e;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(200, 92, 46, 0.4);
}
@media (max-width: 991px) {
    .hero-section {
        background-position: top center;
        min-height: auto;
        padding: 80px 0;
    }
    .hero-overlay {
        background: rgba(0,0,0,0.8);
    }
    .hero-form-wrapper {
        margin-top: 2rem;
    }
}

/* =========================================
11. OTTIMIZZAZIONE RESPONSIVE HERO (MOBILE)
========================================= */
@media (max-width: 767.98px) {
    /* Titolo principale: più compatto e senza a capo forzati */
    .hero-section h1.display-3 {
        font-size: 1.45rem !important;
        line-height: 1.2;
        margin-bottom: 0.8rem;
    }
    .hero-section h1.display-3 br {
        display: none; /* Unisce le righe su schermi piccoli per risparmiare spazio */
    }

    /* Sottotitolo */
    .hero-subtitle {
        font-size: 0.95rem !important;
        line-height: 1.5;
        margin-bottom: 1.25rem;
        padding-right: 0 !important;
    }

    /* Indicatori di fiducia (100%, 360°, 1:1) */
    .hero-section .d-flex.align-items-center.mt-5 {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.8rem !important;
        margin-top: 1.2rem !important;
    }
    .hero-section .d-flex.align-items-center.mt-5 h3 {
        font-size: 1.0rem !important;
    }
    .hero-section .d-flex.align-items-center.mt-5 small {
        font-size: 0.65rem !important;
    }
    .hero-section .vr {
        display: none; /* Rimuove i separatori verticali su mobile per evitare ingombro */
    }

    /* Bottoni CTA: leggermente più compatti ma ancora comodi al tocco (min 44px area) */
    .hero-section .btn-lg {
        padding: 0.4rem 1.0rem !important;
        font-size: 0.80rem !important;
        line-height: 1.4;
    }
    .hero-section .d-flex.flex-wrap.gap-3 {
        gap: 0.75rem !important;
    }

    /* Card laterale "Il Nostro Metodo" */
    .hero-section .col-lg-3.ms-lg-auto {
        margin-left: 0 !important;
    }
    .hero-section .card {
        margin-top: 1.5rem !important;
        border-radius: 1rem !important;
    }
    .hero-section .card-body {
        padding: 1.2rem !important;
    }
    .hero-section .card h5 {
        font-size: 1rem !important;
    }
    .hero-section .card .fw-medium.text-secondary {
        font-size: 0.85rem !important;
    }
}

/* =========================================
   7. TEAM SECTION (ex team-section.php)
   ========================================= */
.team-section {
    position: relative;
    overflow: hidden;
}
.team-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(200, 92, 46, 0.08) 0%, transparent 50%);
    pointer-events: none;
}
.team-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}
.team-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-orange, #c85c2e), #e67e55);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}
.team-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(200, 92, 46, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
.team-card:hover::after {
    transform: scaleX(1);
}
.team-avatar {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 3px solid rgba(200, 92, 46, 0.4);
    padding: 3px;
    margin: 0 auto 1.2rem;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--brand-orange, #c85c2e), #8b3a1f);
}
.team-card:hover .team-avatar {
    border-color: var(--brand-orange, #c85c2e);
    box-shadow: 0 0 25px rgba(200, 92, 46, 0.3);
}
.team-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.team-card:hover .team-avatar img {
    transform: scale(1.05);
}
.team-role {
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.4rem;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.team-name {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
    line-height: 1.3;
}
.team-bio {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1.2rem;
    flex-grow: 1;
}
.team-btn {
    border: 1px solid rgba(200, 92, 46, 0.5);
    color: var(--brand-orange, #c85c2e);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    background: transparent;
    border-radius: 30px;
    padding: 6px 18px;
    text-decoration: none;
    display: inline-block;
}
.team-btn:hover {
    background: var(--brand-orange, #c85c2e);
    color: #ffffff;
    border-color: var(--brand-orange, #c85c2e);
    box-shadow: 0 5px 15px rgba(200, 92, 46, 0.3);
}
.section-title-decor {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-orange, #c85c2e), #e67e55);
    margin: 1rem auto;
    border-radius: 2px;
}
@media (max-width: 1199px) {
    .team-avatar { width: 140px; height: 140px; }
}
@media (max-width: 991px) {
    .team-avatar { width: 130px; height: 130px; }
}

/* =========================================
   8. SERVIZI SECTION (ex servizi-section.php)
   ========================================= */

.servizi-section {
    background-color: #e7e7e7;
    position: relative;
}
.servizi-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(#c85c2e 0.5px, transparent 0.5px);
    background-size: 20px 20px;
    opacity: 0.05;
    pointer-events: none;
}
.service-card {
    border: none;
    border-radius: 20px;
    background: #ffffff !important;
    position: relative;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    overflow: hidden;
}
.service-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #c85c2e, #f0986e, #c85c2e);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}
.service-card:hover::before {
    opacity: 1;
}
.service-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 40px -12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(200, 92, 46, 0.2);
}
.service-icon-wrapper {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--brand-orange, #c85c2e); /* Arancione vivido */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: all 0.4s ease;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.02);
}
/* Icona bianca per contrasto */
.service-icon-wrapper .icon {
    color: #ffffff !important;
    font-size: 2.5rem;
}
.service-card:hover .service-icon-wrapper {
    background: #1a1a1a; /* Sfondo footer (es. scuro) – adattalo al tuo footer */
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.35);
    transform: scale(1.02);
}
.service-card h3 {
    font-weight: 700;
    color: #121417;
    margin-bottom: 1rem;
    font-size: 1.35rem;
    letter-spacing: -0.2px;
}
.service-list li {
    color: #4a5568;
    font-size: 0.95rem;
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    font-weight: 450;
}
.service-list li .icon {
    margin-right: 8px;
    flex-shrink: 0;
}
.btn-service {
    border: 2px solid var(--brand-orange, #c85c2e);
    background: transparent;
    color: var(--brand-orange, #c85c2e);
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}
.btn-service:hover {
    background-color: var(--brand-orange, #c85c2e);
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(200, 92, 46, 0.25);
    transform: translateY(-2px);
    border-color: var(--brand-orange, #c85c2e);
}
.section-title-decor {
    width: 70px;
    height: 4px;
    background: linear-gradient(90deg, #c85c2e, #e07a4a);
    margin: 1rem auto;
    border-radius: 4px;
}
.service-list {
    padding-left: 0.25rem;
    margin-top: 1rem;
}
.service-card .card-body {
    padding: 1.5rem 0.75rem;
}
@media (min-width: 768px) {
    .service-card .card-body {
        padding: 1.8rem 1rem;
    }
}

/* =========================================
   9. CONTATTI SECTION (ex contatti-section.php)
   ========================================= */

.contact-section-wrapper {
    background-color: #e7e7e7;
    overflow: hidden;
}
.gerardi-icon-circle {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand-orange, #c85c2e);
    color: #ffffff;
    flex-shrink: 0;
    transition: all 0.3s ease;
}
.contact-item:hover .gerardi-icon-circle {
    background: #1a1a1a;
    color: #ffffff;
}
.gerardi-accent-box {
    background-color: #f8f9fa;
    border-left: 4px solid #c85c2e;
}
.gerardi-btn-submit {
    background-color: #c85c2e;
    border-color: #c85c2e;
    color: #ffffff;
    transition: all 0.3s ease;
}
.gerardi-btn-submit:hover {
    background-color: #a8461e;
    border-color: #a8461e;
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(200, 92, 46, 0.3);
}
.form-control-custom {
    padding: 0.8rem 1rem;
    font-size: 1rem;
    background-color: #f8f9fa !important;
    border: 1px solid transparent !important;
    transition: all 0.3s ease;
}
.form-control-custom:focus {
    background-color: #ffffff !important;
    border-color: #c85c2e !important;
    box-shadow: 0 0 0 0.2rem rgba(200, 92, 46, 0.15);
}
.form-select-custom {
    padding: 0.8rem 1rem;
    font-size: 1rem;
    background-color: #f8f9fa !important;
    border: 1px solid transparent !important;
}

.modal-body,
.modal-body * {
    font-size: 0.85rem !important;
}

@media (max-width: 991.98px) {
    .navbar-brand img {
        height: 60px !important;
    }
}

/* =========================================
   13. BORDE LEGGERO PER CAMPI INPUT, TEXTAREA E SELECT
   ========================================= */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
textarea,
select,
.form-control,
.form-select,
.form-control-custom,
.form-select-custom {
    border: 1px solid #cacaca !important;
    background-color: #aaaaaa;
    border-radius: 8px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Focus: mantiene il tuo stile brand arancione */
input:focus,
textarea:focus,
select:focus,
.form-control:focus,
.form-select:focus,
.form-control-custom:focus,
.form-select-custom:focus {
    border-color: var(--brand-orange) !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 0.2rem rgba(200, 92, 46, 0.15) !important;
}

/* =========================================
OTTIMIZZAZIONE MOBILE CONTATTI (COLONNA SX)
========================================== */
@media (max-width: 767.98px) {
    /* Titolo */
    #contatti .col-lg-5 h2.display-5 {
        font-size: 1.6rem !important;
        margin-bottom: 1rem !important;
    }
    /* Testo introduttivo */
    #contatti .col-lg-5 p.lead {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
        margin-bottom: 1.5rem !important;
    }
    /* Riduci spaziatura tra i contatti */
    #contatti .col-lg-5 .d-flex.flex-column.gap-4 {
        gap: 0.75rem !important;
        margin-bottom: 1.5rem !important;
    }
    /* Icone cerchio */
    #contatti .gerardi-icon-circle {
        width: 38px !important;
        height: 38px !important;
    }
    /* Testo etichette e recapiti */
    #contatti .contact-item p.small,
    #contatti .contact-item a.fs-5,
    #contatti .contact-item span.fs-5 {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
    }
    /* Box orari */
    #contatti .gerardi-accent-box {
        padding: 1rem !important;
        margin-top: 1.5rem !important;
    }
    #contatti .gerardi-accent-box p {
        font-size: 0.8rem !important;
    }
}

/* =========================================
   10. SPAZIO DINAMICO SOTTO LA NAVBAR
   ========================================= */
.navbar-spacer {
    margin-top: 85px;   /* desktop */
}

@media (max-width: 991.98px) {
    .navbar-spacer {
        margin-top: 60px !important;
    }
}
/* =========================================
12. OTTIMIZZAZIONI MOBILE E COMPONENTI AGGIUNTIVE
========================================= */

/* SERVIZI: Ridimensionamento testo e titolo da mobile (le card restano invariate) */
@media (max-width: 767.98px) {
    .servizi-section h2.display-4 {
        font-size: 1.75rem !important;
    }
    .servizi-section p.lead {
        font-size: 1rem !important;
        line-height: 1.5;
    }
    .servizi-section .service-card .h5 {
        font-size: 1.1rem !important;
    }
    .servizi-section .service-list li {
        font-size: 0.85rem !important;
    }
}

/* TEAM: Bottone "Contattaci" più grande */
.team-btn {
    padding: 10px 28px !important;
    font-size: 0.95rem !important;
    letter-spacing: 0.6px !important;
}

/* CONTATTI: Bottone invio ridimensionato (era troppo grande) */
.gerardi-btn-submit {
    padding: 0.7rem 1.5rem !important;
    font-size: 1rem !important;
    line-height: 1.4;
}
@media (max-width: 767.98px) {
    .gerardi-btn-submit {
        padding: 0.6rem 1rem !important;
        font-size: 0.95rem !important;
    }
}