/* ======================== COLORI ======================== */
:root {
    --blue: #1c498a;
    --orange: #e04e22;
    --dark: #2d3748;
    --light: #718096;
    --white: #ffffff;
    --bg: #f7fafc;
}

/* ======================== RESET E BASE ======================== */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; }
html { scroll-behavior: smooth; }
body { color: var(--dark); background: var(--bg); overflow-x: hidden; line-height: 1.6; }
a { text-decoration: none; color: inherit; }

/* ======================== HEADER ======================== */
header {
    background: var(--white);
    border-bottom: 5px solid var(--orange);
    position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.nav-container {
    max-width: 1300px; margin: 0 auto; padding: 10px 20px;
    display: flex; justify-content: space-between; align-items: center; position: relative;
}
.logo img { height: 90px; display: block; }

.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { font-weight: 700; color: var(--blue); text-transform: uppercase; transition: 0.3s; }
.nav-links a:hover { color: var(--orange); }

/* MENU A TENDINA */
.dropdown { position: relative; display: inline-block; }
.drop-content {
    display: none; position: absolute; background: var(--white);
    min-width: 230px; box-shadow: 0 8px 20px rgba(0,0,0,0.1); z-index: 1001;
    border-radius: 5px; top: 100%; left: 0; overflow: hidden; border-top: 3px solid var(--orange);
}
.drop-content a {
    color: var(--dark); padding: 15px; display: block; font-size: 1rem;
    text-transform: none; border-bottom: 1px solid #eee; font-weight: 600;
}
.drop-content a:hover { background: var(--bg); color: var(--orange); }
.dropdown:hover .drop-content,
.dropdown.open .drop-content { display: block; }

/* MENU MOBILE */
.hamburger { display: none; font-size: 2rem; color: var(--blue); cursor: pointer; }

/* EFFETTO VELO */
.veil { position: relative; overflow: hidden; }
.veil::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.15); transition: transform 0.4s; z-index: 5; pointer-events: none;
}
.veil:hover::after { transform: translateY(-100%); }
@media (hover: none) {
    .veil::after { display: none; }
}

/* BOTTONI */
.btn-area { background: var(--blue); color: var(--white) !important; padding: 0.8rem 1.5rem; border-radius: 5px; }
.btn-primary {
    background: var(--orange); color: var(--white); padding: 1.2rem 3rem; font-size: 1.1rem;
    border-radius: 5px; font-weight: 700; display: inline-block; border: none; cursor: pointer;
    text-transform: uppercase; margin-top: 20px; box-shadow: 0 6px 15px rgba(224,78,34,0.3);
}

/* ======================== HOMEPAGE ======================== */

/* HERO SLIDER */
.hero { position: relative; height: 75vh; display: flex; align-items: center; background: #fff; }
.hero-slider, .slide, .hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.slide { object-fit: cover; object-position: right center; opacity: 0; transition: opacity 2s; z-index: 1; }
.slide.active { opacity: 1; }
.hero-overlay { background: linear-gradient(to right, #fff 0, rgba(255,255,255,0.9) 45%, transparent 80%); z-index: 2; }

.hero-content { position: relative; z-index: 3; max-width: 1300px; margin: 0 auto; width: 100%; padding: 0 20px; }
.hero-text { max-width: 650px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); color: var(--blue); text-transform: uppercase; line-height: 1.1; margin-bottom: 20px; }
.hero p { font-size: 1.3rem; font-weight: 500; margin-bottom: 30px; }

/* SEZIONI */
section { padding: 80px 20px; max-width: 1300px; margin: 0 auto; }
.section-title { text-align: center; font-size: 2.8rem; color: var(--blue); margin-bottom: 50px; text-transform: uppercase; }
.section-title--left { text-align: left; margin-bottom: 40px; }

/* CHI SIAMO */
.about-layout { display: flex; align-items: stretch; gap: 60px; }
.about-text { flex: 1.2; font-size: 1.1rem; color: var(--light); }
.about-text p { margin-bottom: 15px; line-height: 1.8; }
.about-box {
    flex: 0.8; background: var(--blue); color: var(--white); padding: 50px;
    border-radius: 10px; border-bottom: 8px solid var(--orange); box-shadow: 0 15px 30px rgba(28,73,138,0.15);
    display: flex; flex-direction: column; justify-content: center;
}
.about-box h3 { color: var(--orange); font-size: 2.2rem; margin-bottom: 15px; }

/* SERVIZI */
.bg-gray { background: var(--bg); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 40px; }
.card {
    display: block; background: var(--white); padding: 50px 40px; border-radius: 10px;
    border-bottom: 5px solid var(--blue); text-align: center; transition: 0.4s;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05); cursor: pointer;
}
.card:hover { transform: translateY(-10px); border-bottom: 5px solid var(--orange); }
.card h3 { color: var(--blue); margin-bottom: 15px; text-transform: uppercase; font-size: 1.4rem; position: relative; z-index: 2; }
.card p { color: var(--light); position: relative; z-index: 2; }

/* ======================== PAGINE INTERNE ======================== */

/* HERO PAGINE INTERNE */
.page-hero {
    background: linear-gradient(rgba(28,73,138,0.7), rgba(28,73,138,0.85)), url('/images/sfondo-servizi.jpg') center/cover;
    padding: 120px 20px; text-align: center; border-bottom: 8px solid var(--orange);
}
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 3.5rem); color: var(--white); text-transform: uppercase; margin-bottom: 15px; }
.page-hero p { font-size: 1.3rem; color: #e2e8f0; max-width: 800px; margin: 0 auto; }

/* CONTENUTO PAGINE SERVIZI */
.page-content {
    max-width: 900px; margin: 0 auto; padding: 80px 20px; background: var(--white);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); border-radius: 10px; margin-top: -30px;
    position: relative; z-index: 10; margin-bottom: 80px;
}
.page-content h2 { color: var(--orange); margin: 40px 0 20px; font-size: 1.8rem; }
.page-content p { font-size: 1.15rem; color: var(--dark); margin-bottom: 20px; line-height: 1.8; }
.page-content ul { margin: 20px 0 30px 40px; font-size: 1.15rem; color: var(--dark); line-height: 1.8; }
.page-content li { margin-bottom: 12px; }

/* ======================== NEWS ======================== */

.news-container { max-width: 1300px; margin: 60px auto 80px; padding: 0 20px; position: relative; z-index: 10; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 40px; }

.news-card {
    background: var(--white); border-radius: 8px; box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    overflow: hidden; transition: transform 0.3s ease; border-bottom: 4px solid var(--blue);
    display: flex; flex-direction: column;
}
.news-card:hover { transform: translateY(-5px); border-bottom: 4px solid var(--orange); }

.news-date {
    background: var(--orange); color: white; padding: 8px 20px;
    font-weight: bold; font-size: 0.95rem; display: inline-block; border-radius: 0 0 8px 0;
}
.news-content { padding: 30px; flex: 1; display: flex; flex-direction: column; }
.news-title { color: var(--blue); font-size: 1.5rem; margin-bottom: 15px; font-weight: 700; line-height: 1.3; }
.news-excerpt { color: var(--light); font-size: 1.05rem; margin-bottom: 25px; line-height: 1.6; flex: 1; }
.news-link { color: var(--orange); font-weight: 700; text-transform: uppercase; font-size: 0.95rem; transition: 0.3s; }
.news-link:hover { color: var(--blue); }

/* ======================== TEAM ======================== */

.team-container { max-width: 1300px; margin: 40px auto 80px; padding: 0 20px; position: relative; z-index: 10; }
.team-category {
    text-align: center; color: var(--orange); font-size: 2rem; margin: 60px 0 30px;
    text-transform: uppercase; font-weight: bold; border-bottom: 2px solid #e2e8f0; padding-bottom: 10px;
}
.team-category--first { margin-top: 0; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }

.team-card {
    background: var(--white); border-radius: 8px; box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    padding: 30px 20px; text-align: center; border-bottom: 4px solid var(--blue);
    cursor: pointer; transition: transform 0.3s ease, border-bottom 0.3s ease;
}
.team-card:hover { transform: translateY(-5px); border-bottom: 4px solid var(--orange); }
.team-name { color: var(--blue); font-size: 1.5rem; font-weight: 700; margin-bottom: 5px; }
.team-role { color: var(--light); font-size: 1rem; font-style: italic; font-weight: 600; }

.team-card::after {
    content: '+ Scopri di più';
    color: var(--orange); font-size: 0.85rem; font-weight: 700;
    display: block; margin-top: 12px; text-transform: uppercase;
    transition: opacity 0.3s;
}
.team-card.active::after { content: '− Chiudi'; }

.team-bio {
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height 0.4s ease, opacity 0.4s ease, margin-top 0.4s ease;
}
.team-card.active .team-bio { max-height: 500px; opacity: 1; margin-top: 20px; }
.bio-text {
    font-size: 0.95rem; color: var(--dark); border-top: 1px solid #eee;
    padding-top: 15px; text-align: left; line-height: 1.6;
}

/* ======================== FORM CONTATTI ======================== */

.form-box {
    max-width: 800px; margin: 0 auto; background: var(--white); padding: 50px;
    border-radius: 10px; border-top: 5px solid var(--orange); box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    margin-bottom: 80px;
}
.form-row { display: flex; gap: 20px; }
.form-group { flex: 1; margin-bottom: 20px; }
label { font-weight: 700; color: var(--blue); display: block; margin-bottom: 8px; }
.label-highlight { color: var(--orange); }
input, textarea { width: 100%; padding: 15px; border: 1px solid #cbd5e0; border-radius: 5px; font-family: inherit; }
textarea { height: 120px; resize: vertical; }
.form-btn {
    width: 100%; background: var(--blue); color: #fff; padding: 18px; border: none;
    border-radius: 5px; font-weight: 700; font-size: 1.2rem; cursor: pointer; text-transform: uppercase;
}

/* ======================== FOOTER ======================== */

footer { background: var(--dark); color: #fff; padding: 80px 20px 40px; border-top: 6px solid var(--orange); }
.footer-grid { max-width: 1300px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 50px; }
.footer-grid h4 { color: var(--orange); margin-bottom: 20px; text-transform: uppercase; font-size: 1.2rem; }
.footer-grid p { color: #e2e8f0; margin-bottom: 10px; }
.bottom { text-align: center; margin-top: 60px; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.1); color: #a0aec0; font-size: 0.9rem; }

/* ======================== RESPONSIVE ======================== */

@media (max-width: 1024px) {
    .nav-links { gap: 1.2rem; }
}
@media (max-width: 900px) {
    .about-layout { flex-direction: column; gap: 30px; }
    .form-row { flex-direction: column; gap: 0; }
}
@media (max-width: 768px) {
    .hamburger { display: block; }
    .nav-links {
        display: none; flex-direction: column; position: absolute; top: 100%; left: 0;
        width: 100%; background: #fff; padding: 20px 0; box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    }
    .nav-links.active { display: flex; }
    .logo img { height: 70px; }
    .about-box { padding: 30px; }
    .form-box { padding: 30px; }
    .page-content { padding: 30px; }
    .hero-overlay { background: linear-gradient(to right, #fff 0, rgba(255,255,255,0.9) 70%, transparent 100%); }
    .dropdown:hover .drop-content,
    .dropdown.open .drop-content {
        position: relative; box-shadow: none; border: none;
        border-left: 3px solid var(--orange); margin-left: 15px; margin-top: 10px;
    }
}
