/* --- style.css - Foglio di Stile Centralizzato --- */
:root {
    --dark: #0d1117;
    --dark-soft: #13171c;
    --navy: #1f3147;
    --orange: #f39c12;
    --orange-deep: #d35400;
    --blue: #3498db;
    --radius: 14px;
    --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif; }
h1, h2, h3, h4, .logo, .btn-home, .btn-submit { font-family: 'Poppins', 'Segoe UI', Tahoma, sans-serif; }

html { scroll-behavior: smooth; }

/* Impedisce scorrimenti anomali della pagina intera */
body { display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; width: 100%; max-width: 100vw; }

/* Colori di Sfondo Specifici per Pagina */
.page-aziende { background-color: #ecf0f1; color: #2c3e50; }
.page-privati { background-color: #fdfbf7; color: #333; }
.page-chisiamo { background-color: #f8f9fa; color: #333; }
.page-contatti { background-color: #ecf0f1; color: #333; }

/* Animazioni */
@keyframes fadeUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.anim { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.anim.in-view { opacity: 1; transform: translateY(0); }
.d-1 { transition-delay: 0.08s; } .d-2 { transition-delay: 0.16s; } .d-3 { transition-delay: 0.24s; } .d-4 { transition-delay: 0.32s; } .d-5 { transition-delay: 0.4s; } .d-6 { transition-delay: 0.48s; }

/* --- Header & Menù Mobile --- */
header { background-color: var(--dark); padding: 14px 50px; display: flex; justify-content: space-between; align-items: center; z-index: 1000; position: sticky; top: 0; box-shadow: 0 2px 16px rgba(0,0,0,0.35); }
header a.logo { color: white; text-decoration: none; font-weight: bold; font-size: 24px; display: flex; align-items: center; }
nav { display: flex; align-items: center; }
nav a { margin-left: 26px; color: #cfd6dd; text-decoration: none; font-size: 15px; transition: 0.25s; font-weight: 500; position: relative; padding-bottom: 4px; }
nav a::after { content: ''; position: absolute; left: 0; bottom: 0; width: 0; height: 2px; background: var(--orange); transition: width 0.25s ease; }
nav a:hover { color: #fff; }
nav a:hover::after { width: 100%; }
.menu-toggle { display: none; color: white; font-size: 28px; cursor: pointer; border: none; background: transparent; }

/* --- Bandierine Lingua --- */
.lang-switch { display: flex; align-items: center; gap: 12px; margin-left: 20px; }
.lang-switch img { width: 26px; height: 18px; border-radius: 3px; transition: 0.3s; border: 1px solid #444; object-fit: cover; }
.active-lang { opacity: 1; box-shadow: 0 0 6px #f39c12; border-color: #f39c12 !important; }
.inactive-lang { opacity: 0.4; filter: grayscale(100%); }
.inactive-lang:hover { opacity: 1; filter: grayscale(0%); }

/* --- Intro Homepage (H1 SEO + tagline) --- */
.home-intro { background: var(--dark); color: #fff; text-align: center; padding: 46px 20px 40px; }
.home-intro h1 { font-size: 30px; margin-bottom: 10px; }
.home-intro p { color: #b8c0c9; font-size: 16px; max-width: 560px; margin: 0 auto; }

/* --- Homepage Bivio --- */
.split-container { display: flex; flex: 1; flex-wrap: wrap; }
.split-half { flex: 1; min-width: 300px; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 60px 40px; text-align: center; transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); background-size: cover; background-position: center; position: relative; }
.split-half h2 { font-size: 42px; margin-bottom: 15px; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); opacity: 0; animation: fadeUp 0.8s ease forwards 0.2s; }
.split-half p { font-size: 18px; margin-bottom: 30px; max-width: 400px; line-height: 1.5; text-shadow: 1px 1px 3px rgba(0,0,0,0.5); opacity: 0; animation: fadeUp 0.8s ease forwards 0.4s; }
.btn-home { padding: 15px 32px; font-size: 17px; text-decoration: none; font-weight: 700; border-radius: 50px; transition: all 0.3s ease; opacity: 0; animation: fadeUp 0.8s ease forwards 0.6s; display: inline-block; letter-spacing: 0.3px; }

.b2b-side { background-image: linear-gradient(rgba(31, 49, 71, 0.85), rgba(31, 49, 71, 0.85)), url('https://images.unsplash.com/photo-1756723902363-25de2ac0ffae?q=80&w=1000&auto=format&fit=crop'); color: white; border-right: 2px solid #111; }
.b2b-side .btn-home { background-color: #3498db; color: white; border: 2px solid #3498db; box-shadow: 0 4px 15px rgba(52,152,219,0.4); }
.b2b-side .btn-home:hover { background-color: transparent; color: #3498db; transform: translateY(-3px); box-shadow: 0 6px 20px rgba(52,152,219,0.6); }

.b2c-side { background-image: linear-gradient(rgba(211, 84, 0, 0.8), rgba(211, 84, 0, 0.8)), url('stampante.png'); color: white; }
.b2c-side .btn-home { background-color: white; color: #d35400; border: 2px solid white; box-shadow: 0 4px 15px rgba(255,255,255,0.3); }
.b2c-side .btn-home:hover { background-color: transparent; color: white; transform: translateY(-3px); box-shadow: 0 6px 20px rgba(255,255,255,0.5); }
.split-half:hover { flex: 1.2; filter: brightness(1.1); z-index: 5; }

/* --- Pagine Interne (Aziende, Privati, Contatti, Chi Siamo) --- */
.hero { color: white; padding: 80px 20px; text-align: center; }
.hero h1 { font-size: 44px; margin-bottom: 20px; }
.hero-b2b { background: linear-gradient(135deg, rgba(31,49,71,0.92), rgba(44,62,80,0.92)), url('https://images.unsplash.com/photo-1703720675167-2fba006efb82?q=80&w=1400&auto=format&fit=crop') center/cover; }
.hero-b2c { background: linear-gradient(135deg, rgba(211,84,0,0.88), rgba(230,126,34,0.88)), url('https://images.unsplash.com/photo-1644936580583-91eb0c32c3db?q=80&w=1400&auto=format&fit=crop') center/cover; }
.content { max-width: 1100px; margin: 50px auto; padding: 0 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; width: 100%; }
.card { background: white; padding: 30px; border-radius: var(--radius); box-shadow: 0 10px 20px rgba(0,0,0,0.05); transition: transform 0.25s ease, box-shadow 0.25s ease; }
.card:hover { transform: translateY(-6px); box-shadow: 0 16px 30px rgba(0,0,0,0.09); }
.card-b2b { border-top: 4px solid #3498db; } .card-b2b h3 { color: #3498db; margin-bottom: 15px; font-size: 22px; }
.card-b2c { border-top: 4px solid #e67e22; } .card-b2c h3 { color: #d35400; margin-bottom: 15px; font-size: 22px; }

/* --- Griglie dei materiali --- */
.materials-section { max-width: 1100px; margin: 0 auto 60px auto; padding: 0 20px; width: 100%; }
.materials-section h2 { text-align: center; font-size: 32px; margin-bottom: 40px; }
.page-aziende .materials-section h2 { color: #1f3147; }
.page-privati .materials-section h2 { color: #d35400; }
.mat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; width: 100%; }
.mat-card { background: #fff; border: 2px solid transparent; padding: 20px; border-radius: var(--radius-sm); box-shadow: 0 4px 10px rgba(0,0,0,0.05); cursor: pointer; transition: 0.3s; text-align: center; }
.page-aziende .mat-card:hover { border-color: #3498db; transform: translateY(-5px); box-shadow: 0 8px 20px rgba(52,152,219,0.2); }
.page-privati .mat-card:hover { border-color: #e67e22; transform: translateY(-5px); box-shadow: 0 8px 20px rgba(230,126,34,0.2); }
.mat-card h4 { font-size: 18px; margin-bottom: 10px; }
.page-aziende .mat-card h4 { color: #2c3e50; }
.page-privati .mat-card h4 { color: #d35400; }
.mat-card p { font-size: 13px; color: #7f8c8d; }
.mat-card .click-info { display: inline-block; margin-top: 15px; font-size: 12px; font-weight: bold; text-transform: uppercase; }
.page-aziende .mat-card .click-info { color: #3498db; }
.page-privati .mat-card .click-info { color: #e67e22; }

/* --- Timeline di Produzione (Stile Tech/3DRap) --- */
.process-section { max-width: 1100px; margin: 60px auto; padding: 40px 20px; text-align: center; width: 100%; }
.process-section h2 { color: #1f3147; font-size: 32px; margin-bottom: 40px; }
.page-aziende .process-section h2, .page-vantaggi .process-section h2 { color: #1f3147; }
.page-privati .process-section h2 { color: #d35400; }

.timeline-container { display: flex; justify-content: space-between; align-items: flex-start; position: relative; gap: 15px; flex-wrap: wrap; }
.timeline-step { flex: 1; min-width: 200px; background: #13171c; padding: 30px 20px; border-radius: 10px; border: 1px solid #2c3e50; position: relative; z-index: 2; transition: 0.3s; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.timeline-step:hover { border-color: #f39c12; transform: translateY(-5px); box-shadow: 0 10px 25px rgba(243, 156, 18, 0.2); }

.step-number { font-size: 48px; font-weight: 900; color: transparent; -webkit-text-stroke: 2px #34495e; margin-bottom: 15px; transition: 0.3s; }
.timeline-step:hover .step-number { -webkit-text-stroke: 2px #f39c12; color: rgba(243, 156, 18, 0.1); }

.step-title { color: #fff; font-size: 20px; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }
.step-desc { color: #95a5a6; font-size: 14px; line-height: 1.5; }

@media (min-width: 769px) {
    .timeline-step:not(:last-child)::after {
        content: '➔';
        position: absolute;
        right: -25px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 24px;
        color: #f39c12;
        z-index: 1;
    }
}

/* --- Griglia Portfolio Fotografie --- */
.portfolio-section { max-width: 1100px; margin: 0 auto 60px auto; padding: 0 20px; width: 100%; }
.portfolio-section h2 { text-align: center; font-size: 32px; margin-bottom: 40px; }
.page-aziende .portfolio-section h2 { color: #1f3147; }
.page-privati .portfolio-section h2 { color: #d35400; }
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; width: 100%; }
.portfolio-item { border-radius: var(--radius); overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.1); height: 220px; position: relative; }
.portfolio-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.portfolio-item:hover img { transform: scale(1.05); }
.portfolio-overlay { position: absolute; bottom: 0; left: 0; right: 0; color: white; padding: 15px; transform: translateY(100%); transition: transform 0.3s; text-align: center; }
.page-aziende .portfolio-overlay { background: rgba(31, 49, 71, 0.9); }
.page-privati .portfolio-overlay { background: rgba(211, 84, 0, 0.9); }
.portfolio-item:hover .portfolio-overlay { transform: translateY(0); }
.portfolio-overlay h4 { margin-bottom: 5px; font-size: 18px; }
.page-aziende .portfolio-overlay h4 { color: #3498db; }
.portfolio-overlay p { font-size: 13px; color: #ddd; }

/* Modulo Contatti & Upload File */
.contact-wrapper { max-width: 1000px; margin: 60px auto; display: flex; flex-wrap: wrap; gap: 30px; padding: 0 20px; flex: 1; }
.contact-info { flex: 1; min-width: 300px; background: #2c3e50; color: white; padding: 40px; border-radius: var(--radius); }
.contact-form { flex: 1.5; min-width: 300px; background: white; padding: 40px; border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: bold; color: #555; font-size: 14px; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 12px 15px; border: 1px solid #ddd; border-radius: var(--radius-sm); font-size: 16px; outline: none; transition: 0.25s; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(243,156,18,0.12); }
.file-upload-box { border: 2px dashed #bdc3c7; padding: 20px; border-radius: var(--radius-sm); text-align: center; background: #f8f9fa; }
.btn-submit { display: inline-block; padding: 15px 30px; background: var(--navy); color: white; border: none; border-radius: 50px; font-size: 16px; font-weight: bold; cursor: pointer; width: 100%; margin-top: 10px; transition: 0.25s; letter-spacing: 0.3px; }
.btn-submit:hover { background: var(--orange); transform: translateY(-2px); }

/* Footer */
footer { background-color: #111; color: #aaa; text-align: center; padding: 15px; margin-top: auto; }

/* --- Pulsante WhatsApp Fluttuante --- */
.whatsapp-float { position: fixed; width: 60px; height: 60px; bottom: 20px; right: 20px; background-color: #25d366; color: #FFF; border-radius: 50px; text-align: center; font-size: 35px; box-shadow: 2px 2px 10px rgba(0,0,0,0.3); z-index: 100; display: flex; align-items: center; justify-content: center; text-decoration: none; transition: transform 0.3s ease; }
.whatsapp-float:hover { transform: scale(1.1); }

/* --- Riprova Sociale (Marchi) in Chi Siamo --- */
.brands-section { text-align: center; margin-top: 50px; padding-top: 30px; border-top: 1px solid #ddd; }
.brands-section h3 { color: #7f8c8d; font-size: 16px; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 1px; }
.brand-logos { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; align-items: center; }
.brand-logos span { font-size: 15px; font-weight: 700; color: #556677; text-transform: uppercase; letter-spacing: 1.5px; padding: 8px 18px; border: 1px solid #e2e6ea; border-radius: 50px; }

/* --- Responsive per Cellulari (Menù Hamburger e Fix Griglie) --- */
@media (max-width: 768px) {
    header { padding: 15px 20px; }
    .menu-toggle { display: block; }
    nav { position: absolute; top: 100%; left: 0; width: 100%; background: #222; flex-direction: column; align-items: stretch; display: none; padding: 10px 0; border-top: 1px solid #333; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
    nav.active { display: flex; }
    nav a { margin: 0; padding: 15px 20px; width: 100%; border-bottom: 1px solid #333; text-align: left; }
    
    .lang-switch { margin: 15px 20px; padding-bottom: 10px; }
    
    .split-half { min-width: 100%; padding: 40px 20px; min-height: 50vh; }
    
    /* FIX DEFINITIVO PER I BOX SERVIZI E PORTFOLIO (FORZA 1 COLONNA) */
    .content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    /* Rimuove padding in eccesso che spinge fuori dallo schermo */
    .content, .materials-section, .portfolio-section, .process-section {
        padding: 0 15px;
    }
}