/* === RESET & BASE === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1e293b;
    background: #fff;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --dark: #0f172a;
    --gray-900: #1e293b;
    --gray-700: #334155;
    --gray-500: #64748b;
    --gray-300: #cbd5e1;
    --gray-100: #f1f5f9;
    --white: #ffffff;
    --red: #dc2626;
    --orange: #ea580c;
    --teal: #0d9488;
    --green: #16a34a;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-lg: 0 4px 24px rgba(0,0,0,0.10);
    --container: 1140px;
}
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* === BUTTONS === */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 28px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.95rem;
    transition: all 0.25s; cursor: pointer; border: none;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,0.5); }
.btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,0.1); }

/* === HEADER === */
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; transition: all 0.3s; }
.header.scrolled { background: rgba(255,255,255,0.97); backdrop-filter: blur(12px); box-shadow: 0 1px 8px rgba(0,0,0,0.06); }
.navbar .container { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; color: var(--white); transition: color 0.3s; }
.header.scrolled .logo { color: var(--dark); }
.logo-img { width: 36px; height: 36px; border-radius: 8px; }
.logo-text { letter-spacing: -0.3px; }
.logo-text strong { font-weight: 700; }
.nav-menu { display: flex; gap: 32px; }
.nav-link { font-size: 0.9rem; font-weight: 500; color: rgba(255,255,255,0.85); transition: color 0.2s; }
.nav-link:hover { color: var(--white); }
.header.scrolled .nav-link { color: var(--gray-500); }
.header.scrolled .nav-link:hover { color: var(--primary); }
.nav-extras { display: flex; align-items: center; gap: 16px; }
.lang-switcher { display: flex; gap: 4px; }
.lang-btn { padding: 4px 10px; font-size: 0.75rem; font-weight: 600; border-radius: 6px; color: rgba(255,255,255,0.7); transition: all 0.2s; }
.lang-btn.active { background: rgba(255,255,255,0.2); color: var(--white); }
.lang-btn:hover { color: var(--white); }
.header.scrolled .lang-btn { color: var(--gray-500); }
.header.scrolled .lang-btn.active { background: var(--primary-light); color: var(--primary); }
.header.scrolled .lang-btn:hover { color: var(--primary); }
.mobile-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.mobile-toggle span { display: block; width: 24px; height: 2px; background: var(--white); border-radius: 2px; transition: all 0.3s; }
.header.scrolled .mobile-toggle span { background: var(--dark); }
.mobile-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-toggle.open span:nth-child(2) { opacity: 0; }
.mobile-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* === HERO === */
.hero { position: relative; min-height: 60vh; display: flex; align-items: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background: linear-gradient(135deg, #0f172a 0%, #1e40af 50%, #2563eb 100%); z-index: 0; }
.hero .container { position: relative; z-index: 1; }
.hero-content { max-width: 700px; padding: 110px 0 48px; }
.hero-content h1 { font-size: clamp(2.2rem, 4.5vw, 3.25rem); font-weight: 700; color: var(--white); line-height: 1.2; letter-spacing: -0.5px; margin-bottom: 24px; }
.hero-content p { font-size: 1.1rem; color: rgba(255,255,255,0.75); line-height: 1.7; margin-bottom: 36px; max-width: 600px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.hero-badges { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-badge { display: inline-block; padding: 6px 16px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: 20px; font-size: 0.8rem; font-weight: 500; color: rgba(255,255,255,0.75); letter-spacing: 0.3px; }

/* === SECTION HEADERS === */
.section-header { text-align: center; margin-bottom: 56px; }
.section-tag { display: inline-block; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--primary); margin-bottom: 12px; }
.section-header h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 700; color: var(--dark); letter-spacing: -0.3px; }

/* === MODULES === */
.modules { padding: 100px 0; background: var(--gray-100); }

/* Hero card (emergenze) */
.module-hero-card {
    display: flex; gap: 32px; align-items: flex-start;
    background: var(--white); border-radius: var(--radius); padding: 40px 36px;
    box-shadow: var(--shadow-lg); margin-bottom: 32px;
    border-left: 5px solid var(--red);
}
.module-hero-icon {
    flex-shrink: 0; width: 64px; height: 64px;
    display: flex; align-items: center; justify-content: center;
    background: #fef2f2; color: var(--red); border-radius: 16px;
}
.module-hero-icon svg { width: 32px; height: 32px; }
.module-hero-text h3 { font-size: 1.35rem; font-weight: 700; color: var(--dark); margin-bottom: 12px; }
.module-hero-text p { font-size: 0.95rem; color: var(--gray-700); line-height: 1.7; margin-bottom: 12px; }
.module-hero-text .module-sub { color: var(--gray-500); font-size: 0.9rem; padding-top: 12px; border-top: 1px solid var(--gray-100); margin-bottom: 0; }

.modules-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.module-card { background: var(--white); border-radius: var(--radius); padding: 36px 28px; box-shadow: var(--shadow); transition: all 0.3s; }
.module-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.module-icon { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 12px; margin-bottom: 20px; }
.module-icon svg { width: 24px; height: 24px; }
.icon-presenze { background: var(--primary-light); color: var(--primary); }
.icon-emergenze { background: #fef2f2; color: var(--red); }
.icon-mensa { background: #f0fdf4; color: var(--green); }
.icon-rapportini { background: #fff7ed; color: var(--orange); }
.icon-asili { background: #f0fdfa; color: var(--teal); }
.icon-admin { background: #f5f3ff; color: #7c3aed; }
.module-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 10px; color: var(--dark); }
.module-card p { font-size: 0.9rem; color: var(--gray-500); line-height: 1.65; }

/* === NORMATIVA === */
.normativa-section { padding: 100px 0; background: var(--white); }
.normativa-content { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.normativa-text .section-tag { margin-bottom: 12px; }
.normativa-text h2 { font-size: 2rem; font-weight: 700; color: var(--dark); margin-bottom: 24px; }
.normativa-text p { color: var(--gray-700); line-height: 1.7; margin-bottom: 16px; }
.normativa-highlight { background: var(--primary-light); color: var(--primary-dark); padding: 16px 20px; border-radius: var(--radius-sm); border-left: 4px solid var(--primary); font-weight: 500; margin-top: 8px; }
.normativa-images { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.normativa-img { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.normativa-img img { width: 100%; height: 280px; object-fit: cover; }

/* === APP SECTION === */
/* === B2B SECTION === */
.b2b-section { padding: 100px 0; background: var(--gray-100); }
.b2b-intro { text-align: center; max-width: 780px; margin: -24px auto 48px; font-size: 1.05rem; color: var(--gray-700); line-height: 1.7; }
.b2b-intro strong { color: var(--primary); }
.b2b-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 40px; }
.b2b-step { background: var(--white); border-radius: var(--radius); padding: 32px 24px; box-shadow: var(--shadow); text-align: center; position: relative; }
.step-number { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: var(--primary); color: var(--white); border-radius: 50%; font-weight: 700; font-size: 1.2rem; margin-bottom: 16px; }
.b2b-step h3 { font-size: 0.95rem; font-weight: 600; color: var(--dark); margin-bottom: 10px; }
.b2b-step p { font-size: 0.85rem; color: var(--gray-500); line-height: 1.6; }
.b2b-note { background: var(--primary-light); border-left: 4px solid var(--primary); border-radius: var(--radius-sm); padding: 20px 24px; text-align: center; }
.b2b-note p { color: var(--primary-dark); font-weight: 500; font-size: 0.9rem; margin: 0; }

/* === APP SECTION === */
.app-section { padding: 100px 0; background: var(--white); }
.app-content { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.app-text .section-tag { margin-bottom: 12px; }
.app-text h2 { font-size: 2rem; font-weight: 700; color: var(--dark); margin-bottom: 16px; }
.app-text p { color: var(--gray-500); line-height: 1.7; margin-bottom: 28px; }
.app-features { list-style: none; margin-bottom: 32px; }
.app-features li { position: relative; padding-left: 28px; margin-bottom: 12px; color: var(--gray-700); font-size: 0.95rem; }
.app-features li::before { content: ''; position: absolute; left: 0; top: 8px; width: 16px; height: 16px; background: var(--primary-light); border-radius: 50%; border: 3px solid var(--primary); }
.store-badges { display: flex; gap: 12px; flex-wrap: wrap; }
.store-badge { display: inline-flex; align-items: center; gap: 10px; padding: 12px 24px; background: var(--dark); color: var(--white); border-radius: var(--radius-sm); font-weight: 600; font-size: 0.9rem; transition: all 0.25s; }
.store-badge:hover { background: var(--gray-700); transform: translateY(-1px); }
.store-badge svg { width: 22px; height: 22px; }
.app-how-title { font-size: 0.95rem; font-weight: 600; color: var(--dark); margin-bottom: 12px; }
.app-how-steps { margin-bottom: 28px; padding-left: 20px; }
.app-how-steps li { position: relative; margin-bottom: 10px; color: var(--gray-700); font-size: 0.9rem; line-height: 1.5; padding-left: 8px; }
.app-how-steps li::marker { color: var(--primary); font-weight: 700; }
.app-text p strong { color: var(--dark); }
.app-visual { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.app-image { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.app-image img { width: 100%; max-width: 480px; }
.app-enterprise-note { background: #fef3c7; border-left: 4px solid #f59e0b; border-radius: var(--radius-sm); padding: 16px 20px; max-width: 480px; }
.app-enterprise-note p { font-size: 0.82rem; color: #92400e; line-height: 1.5; margin: 0; font-weight: 500; }

/* === CONTACT === */
.contact-section { padding: 100px 0; background: var(--white); }

/* Form contatti */
.contact-form-wrap { max-width: 800px; margin: 0 auto 64px; }
.contact-form .form-row { display: flex; gap: 16px; margin-bottom: 0; }
.contact-form .form-group { margin-bottom: 16px; flex: 1; }
.contact-form .form-group.half { flex: 1; }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
    width: 100%; padding: 14px 16px;
    border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
    font-family: inherit; font-size: 0.95rem;
    transition: border-color 0.2s; outline: none; background: var(--gray-100);
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--primary); background: var(--white); }
.form-checkboxes { margin-bottom: 16px; }
.form-checkboxes label { display: block; font-size: 0.85rem; color: var(--gray-700); margin-bottom: 8px; cursor: pointer; }
.form-checkboxes input[type="checkbox"] { margin-right: 8px; }
.form-privacy-note { font-size: 0.85rem; color: var(--gray-500); margin-bottom: 20px; }
.form-privacy-note a { color: var(--primary); text-decoration: underline; }
.form-submit { text-align: center; }
.form-submit .btn { padding: 14px 48px; }

/* Info contatto */
.contact-info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.contact-block { background: var(--gray-100); border-radius: var(--radius); padding: 28px 24px; display: flex; flex-direction: column; }
.contact-block h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--primary); margin-bottom: 12px; font-weight: 600; }
.contact-block p { font-size: 0.9rem; color: var(--gray-700); margin-bottom: 4px; line-height: 1.5; }
.contact-block .contact-email { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--gray-300); }
.contact-block a { color: var(--primary); }
.contact-block a:hover { text-decoration: underline; }

/* === FOOTER === */
.footer { background: var(--dark); color: rgba(255,255,255,0.7); padding: 64px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-brand { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; color: var(--white); margin-bottom: 16px; }
.footer-brand .logo-img { width: 36px; height: 36px; border-radius: 8px; }
.footer-brand .logo-text { color: var(--white); }
.footer-desc { font-size: 0.85rem; line-height: 1.6; color: rgba(255,255,255,0.5); }
.footer-col h4 { color: var(--white); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
.footer-col ul li { font-size: 0.85rem; margin-bottom: 8px; }
.footer-col ul li a { transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--white); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 24px 0; font-size: 0.8rem; color: rgba(255,255,255,0.4); }
.footer-legal { color: rgba(255,255,255,0.35); }
.footer-legal-links { display: flex; gap: 20px; }
.footer-legal-links a { transition: color 0.2s; }
.footer-legal-links a:hover { color: rgba(255,255,255,0.7); }

/* === COOKIE === */
.cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
    background: var(--dark); color: rgba(255,255,255,0.8);
    padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
    font-size: 0.85rem; box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
}
.cookie-banner a { color: var(--primary-light); text-decoration: underline; }
.btn-cookie-close { background: var(--primary); color: var(--white); border: none; padding: 8px 24px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 0.85rem; white-space: nowrap; }

/* === HEADER SOLID (pagine interne) === */
.header--solid { background: var(--white); box-shadow: 0 1px 8px rgba(0,0,0,0.06); }
.header--solid .logo { color: var(--dark); }
.header--solid .nav-link { color: var(--gray-500); }
.header--solid .nav-link:hover, .header--solid .nav-link.active { color: var(--primary); }
.header--solid .lang-btn { color: var(--gray-500); }
.header--solid .lang-btn.active { background: var(--primary-light); color: var(--primary); }
.header--solid .lang-btn:hover { color: var(--primary); }
.header--solid .mobile-toggle span { background: var(--dark); }

/* === PAGE HERO (pagine dedicate) === */
.page-hero { padding: 120px 0 60px; color: var(--white); }
.page-hero h1 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); font-weight: 700; margin-bottom: 16px; max-width: 700px; }
.page-hero p { font-size: 1.05rem; line-height: 1.7; max-width: 650px; opacity: 0.85; }
.page-hero--red { background: linear-gradient(135deg, #7f1d1d 0%, #dc2626 100%); }
.page-hero--green { background: linear-gradient(135deg, #14532d 0%, #16a34a 100%); }
.page-hero--orange { background: linear-gradient(135deg, #7c2d12 0%, #ea580c 100%); }

/* === PAGE SECTIONS === */
.page-section { padding: 64px 0; }
.page-section--alt { background: var(--gray-100); }
.page-section h2 { font-size: 1.5rem; font-weight: 700; color: var(--dark); margin-bottom: 20px; }
.page-section p { color: var(--gray-700); line-height: 1.7; margin-bottom: 14px; max-width: 780px; }
.section-intro { font-size: 1.05rem; margin-bottom: 28px; }

.callout { padding: 20px 24px; border-radius: var(--radius-sm); margin: 20px 0; }
.callout--warning { background: #fef3c7; border-left: 4px solid #f59e0b; }
.callout--warning p { color: #92400e; font-weight: 500; margin: 0; }

.feature-list { list-style: none; max-width: 780px; }
.feature-list li { position: relative; padding: 14px 0 14px 32px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); line-height: 1.6; font-size: 0.95rem; }
.feature-list li:last-child { border-bottom: none; }
.feature-list li::before { content: ''; position: absolute; left: 0; top: 20px; width: 16px; height: 16px; background: var(--primary-light); border-radius: 50%; border: 3px solid var(--primary); }

/* Deploy grid (emergenze) */
.deploy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 28px; }
.deploy-card { background: var(--gray-100); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.deploy-card img { width: 100%; height: 220px; object-fit: cover; }
.deploy-card p { padding: 16px 20px; font-size: 0.9rem; color: var(--gray-700); line-height: 1.5; }

/* Page CTA */
.page-cta { padding: 48px 0 80px; text-align: center; }

/* === LEGAL PAGES === */
.page-hero--dark { background: linear-gradient(135deg, var(--dark) 0%, var(--gray-700) 100%); }
.legal-content { max-width: 780px; }
.legal-content h2 { font-size: 1.2rem; font-weight: 600; color: var(--dark); margin: 32px 0 12px; padding-top: 16px; border-top: 1px solid var(--gray-100); }
.legal-content h2:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.legal-content h3 { font-size: 1rem; font-weight: 600; color: var(--gray-700); margin: 16px 0 8px; }
.legal-content p { color: var(--gray-700); line-height: 1.7; margin-bottom: 12px; }
.legal-content ul { padding-left: 20px; margin-bottom: 16px; }
.legal-content ul li { color: var(--gray-700); line-height: 1.7; margin-bottom: 8px; list-style: disc; }
.legal-content a { color: var(--primary); }
.legal-content a:hover { text-decoration: underline; }
.cookie-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 0.9rem; }
.cookie-table th { background: var(--gray-100); color: var(--dark); font-weight: 600; text-align: left; padding: 10px 14px; border: 1px solid var(--gray-300); }
.cookie-table td { padding: 10px 14px; border: 1px solid var(--gray-300); color: var(--gray-700); }
.cookie-table code { background: var(--gray-100); padding: 2px 6px; border-radius: 4px; font-size: 0.85rem; }

/* === SCROLL REVEAL === */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.modules-grid .module-card:nth-child(2) { transition-delay: 0.1s; }
.modules-grid .module-card:nth-child(3) { transition-delay: 0.2s; }
.modules-grid .module-card:nth-child(4) { transition-delay: 0.3s; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .modules-grid { grid-template-columns: repeat(2, 1fr); }
    .module-hero-card { flex-direction: column; gap: 20px; }
    .normativa-content { grid-template-columns: 1fr; }
    .normativa-images { grid-template-columns: 1fr 1fr; }
    .b2b-steps { grid-template-columns: repeat(2, 1fr); }
    .contact-info-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .mobile-toggle { display: flex; }
    .nav-menu {
        position: fixed; top: 72px; left: 0; right: 0;
        background: var(--white); flex-direction: column; gap: 0;
        padding: 16px 0; box-shadow: var(--shadow-lg);
        transform: translateY(-120%); opacity: 0; transition: all 0.3s; z-index: 999;
    }
    .nav-menu.open { transform: translateY(0); opacity: 1; }
    .nav-menu .nav-link { display: block; padding: 14px 24px; color: var(--gray-700); }
    .nav-menu .nav-link:hover { background: var(--gray-100); color: var(--primary); }
    .hero-content { padding: 100px 0 60px; }
    .hero-content h1 { font-size: 2rem; }
    .modules-grid { grid-template-columns: 1fr; }
    .module-hero-card { padding: 28px 24px; }
    .app-content { grid-template-columns: 1fr; text-align: center; }
    .app-features li { text-align: left; }
    .store-badges { justify-content: center; }
    .normativa-images { grid-template-columns: 1fr; }
    .b2b-steps { grid-template-columns: 1fr; }
    .contact-form .form-row { flex-direction: column; gap: 0; }
    .contact-info-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .cookie-banner { flex-direction: column; text-align: center; }
    .deploy-grid { grid-template-columns: 1fr; }
    .page-hero { padding: 100px 0 48px; }
}
