/* --- ROOT VARIABLES --- */
:root {
    --brand: #d12323;
    --brand-dark: #b01c1c;
    --brand-light: rgba(209, 35, 35, 0.1);
    --logo-red: #d12323;
    --navy: #1e293b;
    --navy-dark: #0f172a;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-600: #4b5563;
    --gray-800: #1f2937;
    --white: #ffffff;
    --font-sans: 'Inter', sans-serif;
    --font-heading: 'Montserrat', sans-serif;
}

/* --- RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-sans); color: var(--gray-800); background-color: var(--gray-50); line-height: 1.6; overflow-x: hidden; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 800; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* --- LAYOUT UTILITIES --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; width: 100%; position: relative; }
.section { padding: 80px 0; }
.grid { display: grid; gap: 30px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* --- BUTTONS --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 28px; border-radius: 6px; font-weight: bold; font-family: var(--font-sans); cursor: pointer; border: none; font-size: 1rem; transition: all 0.3s ease; }
.btn-brand { background-color: var(--brand); color: var(--white); }
.btn-brand:hover { background-color: var(--brand-dark); color: var(--white); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.btn-navy { background-color: #e5e7eb; color: var(--navy-dark); }
.btn-navy:hover { background-color: #d1d5db; color: var(--navy-dark); }
.btn-outline { background-color: transparent; border: 2px solid var(--white); color: var(--white); }
.btn-outline:hover { background-color: rgba(255,255,255,0.1); }

/* --- NAVBAR --- */
.navbar { position: fixed; top: 0; width: 100%; z-index: 1000; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(5px); box-shadow: 0 2px 10px rgba(0,0,0,0.05); padding: 15px 0; transition: 0.3s; }
.logo { display: flex; align-items: center; gap: 12px; font-family: var(--font-heading); color: var(--navy-dark); }
.logo-text { display: flex; flex-direction: column; justify-content: center; }
.logo-title { font-size: 1.8rem; font-weight: 800; letter-spacing: 1px; line-height: 1; color: #000; }
.logo-subtitle { font-size: 0.65rem; font-weight: 700; letter-spacing: 4.6px; margin-right: -4.6px; color: var(--gray-600); margin-top: 4px; line-height: 1; color: var(--brand); }
.logo svg, .logo img { transition: transform 0.3s ease; }
.logo:hover svg, .logo:hover img { transform: scale(1.05); }
.navbar .logo-text { flex-direction: row; align-items: center; gap: 6px; }
.navbar .logo-title { font-size: 1.6rem; letter-spacing: 0; }
.navbar .logo-subtitle { font-size: 1.6rem; font-weight: 500; letter-spacing: 0; margin: 0; }
.nav-links { display: flex; align-items: center; gap: 30px; font-weight: 600; color: var(--gray-600); }
.nav-links a:hover { color: var(--brand); }
.nav-cta { background: #d12323; color: var(--white); padding: 10px 20px; border-radius: 6px; font-weight: 700; }
.nav-cta:hover { background: #b01c1c; color: var(--white); }
.mobile-toggle { display: none; font-size: 1.5rem; color: var(--gray-600); cursor: pointer; background: none; border: none; }
.mobile-menu { display: none; background: var(--white); border-top: 1px solid var(--gray-100); padding: 10px 20px; flex-direction: column; gap: 15px; }
.mobile-menu.open { display: flex; }
.mobile-menu a { display: block; padding: 10px 0; font-weight: 600; color: var(--gray-800); border-bottom: 1px solid var(--gray-100); }

/* --- HERO CON SLIDESHOW --- */
.hero { height: 100vh; min-height: 600px; display: flex; align-items: center; position: relative; overflow: hidden; background-color: var(--navy-dark); }
.hero-slideshow { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }
.slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.5s ease-in-out; }
.slide.active { opacity: 1; }
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(90deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.7) 50%, rgba(15, 23, 42, 0.2) 100%); z-index: 1; }
.hero-content { position: relative; z-index: 10; color: var(--white); margin-top: 60px; max-width: 700px; }
.hero-tag { display: inline-block; padding: 6px 16px; background: var(--brand-light); color: var(--brand); border: 1px solid rgba(209, 35, 35, 0.3); border-radius: 30px; font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 20px; }
.hero h1 { font-size: 4.5rem; line-height: 1.1; margin-bottom: 25px; }
.hero h1 span { color: var(--brand); }
.hero p { font-size: 1.25rem; color: var(--gray-300); margin-bottom: 40px; }
.hero-buttons { display: flex; gap: 15px; }
.hero-floating-box { position: absolute; right: 20px; bottom: 80px; background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.2); padding: 20px 25px; border-radius: 16px; border-left: 5px solid var(--brand); z-index: 10; color: white; box-shadow: 0 20px 40px rgba(0,0,0,0.3); animation: float 6s ease-in-out infinite; display: flex; align-items: center; gap: 20px; }
.hero-floating-box i { font-size: 2.5rem; color: var(--brand); }
.hero-floating-box strong { display: block; font-size: 1.2rem; font-family: var(--font-heading); margin-bottom: 2px; }
.hero-floating-box span { font-size: 0.9rem; color: var(--gray-300); }

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0); }
}

/* --- STATS --- */
.stats-bar { background: #ffffff; padding: 50px 0; border-bottom: 1px solid #e5e7eb; margin-top: -5px; position: relative; z-index: 20; }
.stat-item { text-align: center; border-right: 1px solid #e5e7eb; }
.stat-item:last-child { border-right: none; }
.stat-number { font-family: var(--font-heading); font-size: 2.5rem; font-weight: 800; color: var(--brand); margin-bottom: 5px; }
.stat-label { color: var(--gray-600); font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

/* --- SECTION TITLES --- */
.section-header { margin-bottom: 50px; }
.subtitle { display: flex; align-items: center; gap: 12px; color: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 15px; }
.subtitle::before, .subtitle.center::after { content: ''; display: block; width: 40px; height: 4px; background: var(--brand); }
.subtitle.center { justify-content: center; }
.title { font-size: 2.5rem; color: var(--navy-dark); margin-bottom: 20px; }

/* --- CHI SIAMO --- */
.about-section { background: var(--white); }
.about-image-wrapper { position: relative; }
.about-image-bg { position: absolute; top: -15px; left: -15px; right: 15px; bottom: 15px; background: var(--brand-light); border-radius: 12px; transform: rotate(3deg); z-index: 0; }
.about-image { position: relative; z-index: 1; border-radius: 12px; height: 720px; object-fit: cover; }
.about-badge { position: absolute; bottom: -30px; right: -30px; background: var(--navy-dark); color: var(--white); padding: 25px; border-radius: 12px; display: flex; align-items: center; gap: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); z-index: 2; border-bottom: 3px solid var(--brand); }
.about-badge i { font-size: 2.5rem; color: var(--brand); }
.about-text p { font-size: 1.1rem; color: var(--gray-600); margin-bottom: 20px; }
.about-list { margin: 30px 0; }
.about-list li { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--navy-dark); margin-bottom: 15px; font-size: 1.05rem; }
.about-list i { color: var(--brand); font-size: 1.2rem; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; color: var(--navy-dark); font-weight: 700; border-bottom: 2px solid var(--brand); padding-bottom: 2px; }
.link-arrow:hover { color: var(--brand); }

/* --- CERTIFICAZIONI --- */
.cert-section { background: #ffffff; padding: 60px 0; border-top: 1px solid #e5e7eb; position: relative; }
.cert-container { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 40px; }
.cert-box { text-align: center; color: var(--navy-dark); max-width: 450px; }
.cert-logo { display: block; height: 180px; width: auto; max-width: 100%; margin: 0 auto 20px; object-fit: contain; }
.cert-icon { font-size: 3.5rem; color: var(--brand); margin-bottom: 20px; }
.cert-title-text { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 700; margin-bottom: 10px; color: var(--navy-dark); }
.cert-desc { text-wrap: balance; color: var(--gray-600); font-size: 0.95rem; line-height: 1.5; }

/* --- SERVIZI --- */
.service-card { background: var(--white); padding: 40px; border-radius: 12px; border: 1px solid var(--gray-100); box-shadow: 0 4px 6px rgba(0,0,0,0.02); position: relative; overflow: hidden; transition: 0.3s; }
.service-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0,0,0,0.08); }
.service-icon-bg { position: absolute; top: 0; right: 0; width: 100px; height: 100px; background: var(--brand-light); border-bottom-left-radius: 100%; transition: 0.5s; z-index: 0; }
.service-card:hover .service-icon-bg { transform: scale(1.5); }
.service-icon { position: relative; z-index: 1; width: 60px; height: 60px; background: transparent; border: 1px solid #e5e7eb; color: var(--brand); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; margin-bottom: 25px; }
.service-card h3 { position: relative; z-index: 1; font-size: 1.5rem; color: var(--navy-dark); margin-bottom: 15px; }
.service-details { position: relative; z-index: 1; margin-top: 15px; }
.service-details li { margin-bottom: 8px; color: var(--gray-600); display: flex; align-items: flex-start; gap: 8px; }
.service-details li i { color: var(--brand); margin-top: 5px; font-size: 0.8rem; }

/* --- PROGETTI --- */
.projects-section { background: var(--white); }
.project-card { position: relative; height: 320px; border-radius: 12px; overflow: hidden; }
.project-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s; }
.project-card:hover img { transform: scale(1.1); }
.project-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, rgba(15,23,42,0.9), transparent); display: flex; flex-direction: column; justify-content: flex-end; padding: 25px; opacity: 0; transition: 0.4s; }
.project-card:hover .project-overlay { opacity: 1; }
.project-tag { color: var(--brand); font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
.project-title { color: var(--white); font-size: 1.3rem; }

/* --- CTA BANNER --- */
.cta-banner { background: #d12323; padding: 60px 0; text-align: center; }
.cta-banner h2 { color: var(--white); font-size: 2.2rem; margin-bottom: 15px; font-family: var(--font-heading); }
.cta-banner p { color: rgba(255, 255, 255, 0.9); font-size: 1.1rem; max-width: 600px; margin: 0 auto 30px; }

/* --- CONTATTI --- */
.contact-info-item { display: flex; gap: 20px; margin-bottom: 30px; }
.contact-icon { width: 50px; height: 50px; background: var(--white); border: 1px solid var(--gray-100); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--brand); font-size: 1.2rem; flex-shrink: 0; }
.contact-info-text h4 { color: var(--navy-dark); font-size: 1.1rem; margin-bottom: 5px; }
.contact-info-text p { color: var(--gray-600); }
.contact-form { background: var(--white); padding: 40px; border-radius: 16px; border: 1px solid var(--gray-100); box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--gray-800); margin-bottom: 8px; }
.form-control { width: 100%; padding: 14px 16px; background: var(--gray-50); border: 1px solid var(--gray-300); border-radius: 8px; font-family: var(--font-sans); font-size: 1rem; color: var(--gray-800); transition: 0.3s; }
.form-control:focus { outline: none; border-color: var(--brand); background: var(--white); box-shadow: 0 0 0 3px var(--brand-light); }
textarea.form-control { resize: vertical; min-height: 120px; }
.form-disclaimer { font-size: 0.8rem; color: var(--gray-400); text-align: center; margin-top: 15px; }

/* --- COOKIE BANNER --- */
.cookie-banner { position: fixed; bottom: 20px; left: 20px; right: 20px; max-width: 600px; background: var(--white); border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.15); z-index: 9999; border: 1px solid var(--gray-200); padding: 25px; font-family: var(--font-sans); }
@media (min-width: 768px) { .cookie-banner { left: 50%; right: auto; transform: translateX(-50%); } }
.cookie-banner h4 { color: var(--navy-dark); margin-top: 0; margin-bottom: 10px; font-size: 1.2rem; }
.cookie-banner p { color: var(--gray-600); font-size: 0.9rem; margin-bottom: 20px; line-height: 1.5; }
.cookie-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-buttons .btn { padding: 12px 20px; font-size: 0.9rem; flex: 1; text-align: center; }

/* --- FOOTER --- */
.footer { background: #f3f4f6; color: var(--navy-dark); padding: 80px 0 30px; border-top: 1px solid #e5e7eb; }
.footer p { color: var(--gray-600); }
.footer-logo { display: flex; align-items: center; gap: 12px; font-family: var(--font-heading); margin-bottom: 20px; }
.footer-logo .logo-title { color: var(--navy-dark); font-size: 2rem; font-weight: 800; letter-spacing: 1px; line-height: 1; }
.footer-logo .logo-subtitle { color: var(--gray-600); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.5px; margin-right: 0; margin-top: 4px; line-height: 1; }
.social-links { display: flex; gap: 10px; margin-top: 20px; }
.social-links a { width: 40px; height: 40px; background: #e5e7eb; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--gray-600); }
.social-links a:hover { background: var(--brand); color: var(--white); }
.footer h4 { border-left: 2px solid var(--brand); padding-left: 10px; margin-bottom: 25px; font-size: 1.1rem; }
.footer-links li { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; color: var(--gray-600); }
.footer-links i { color: var(--brand); font-size: 0.8rem; }
.footer-links a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid #d1d5db; padding-top: 20px; margin-top: 40px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; font-size: 0.9rem; color: var(--gray-600); }

/* --- PRIVACY PAGE --- */
.hero-compact { background: var(--navy-dark); padding: 150px 0 80px; text-align: center; color: var(--white); }
.hero-compact h1 { color: var(--white); font-size: 3rem; margin: 0 0 10px; }
.hero-compact p { color: var(--brand); font-weight: bold; font-size: 1.2rem; letter-spacing: 1px; }

.policy-content { background: var(--white); padding: 60px; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.05); margin: -40px auto 80px; max-width: 900px; position: relative; z-index: 10; }
.policy-content h1, .policy-content h2, .policy-content h3,
.policy-content h4, .policy-content h5, .policy-content h6 { font-family: var(--font-heading); font-weight: 800; color: var(--navy-dark); margin-top: 30px; margin-bottom: 15px; }
.policy-content p { color: var(--gray-600); margin-bottom: 15px; font-size: 1.05rem; }
.policy-content ul { margin-bottom: 20px; padding-left: 20px; }
.policy-content ul li { color: var(--gray-600); margin-bottom: 8px; list-style-type: disc; }
.policy-content ul li strong { color: var(--navy-dark); }
.policy-content a { color: var(--brand); text-decoration: underline; }

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 3.5rem; }
    .about-badge, .hero-floating-box { display: none; }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .mobile-toggle { display: block; }
    .hero h1 { font-size: 2.5rem; }
    .hero-buttons { flex-direction: column; }
    .hero-buttons .btn { width: 100%; }
    .stat-item { border-right: none; border-bottom: 1px solid #e5e7eb; padding: 20px 0; }
    .stat-item:last-child { border-bottom: none; }
    .stats-bar .grid { gap: 0; }
    .contact-info-item { flex-direction: column; gap: 10px; }
    .navbar .logo-title, .navbar .logo-subtitle { font-size: 1.15rem; }
    .navbar .logo svg, .navbar .logo img { height: 25px; width: auto; }
}