/* ========================================================================= */
/* --- RESET & VARIABLES (LIGHT PREMIUM) --- */
/* ========================================================================= */
:root {
  --bg-color: #F8FAFC;
  --surface-color: #FFFFFF;
  --text-color: #0F172A;
  --secondary-text: #475569;
  --accent-color: #2563EB;
  --border-color: #E2E8F0;
  --font-main: 'Inter', sans-serif;
  --font-logo: 'PT Sans', sans-serif;
  --font-tech: 'JetBrains Mono', monospace;
  --font-hero: 'Clash Display', sans-serif;
  --container-width: 1400px;
  --mouse-x: -1000px;
  --mouse-y: -1000px;
  --header-height: 100px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { width: 100%; overflow-x: hidden; background-color: var(--bg-color); color: var(--text-color); font-family: var(--font-main); line-height: 1.5; cursor: default; }
body.is-loading { overflow: hidden; height: 100%; position: fixed; width: 100%; top: 0; left: 0; }
body.is-loading .modal-overlay { display: none; }

::-webkit-scrollbar { display: none; }
html { -ms-overflow-style: none; scrollbar-width: none; }
a { text-decoration: none; color: inherit; transition: color 0.3s; }
ul { list-style: none; }

/* ========================================================================= */
/* --- INTRO PRELOADER E LAYERS GLOBALI --- */
/* ========================================================================= */
#intro-preloader { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10000; display: flex; justify-content: center; align-items: center; overflow: hidden; }
.layer-blue { position: fixed; top: 50%; left: 50%; width: 250vmax; height: 250vmax; background-color: var(--accent-color); border-radius: 50%; transform: translate(-50%, -50%); z-index: 10001; will-change: width, height; }
.layer-white { position: fixed; top: 50%; left: 50%; width: 250vmax; height: 250vmax; background-color: #ffffff; border-radius: 50%; transform: translate(-50%, -50%); z-index: 10002; display: flex; justify-content: center; align-items: center; will-change: width, height; }
.layer-white.collapse, .layer-blue.collapse { transition: width 1s cubic-bezier(0.77, 0, 0.175, 1), height 1s cubic-bezier(0.77, 0, 0.175, 1); width: 0vw; height: 0vw; }

.intro-content { display: flex; align-items: baseline; gap: 20px; z-index: 10010; transition: opacity 0.3s ease, transform 0.3s ease; }
.intro-logo-text { font-family: var(--font-logo); font-size: clamp(1.8rem, 5vw, 3.5rem); font-weight: 700; color: #000; letter-spacing: -1px; }
.intro-counter { font-family: var(--font-tech); font-size: clamp(1rem, 3vw, 1.5rem); color: #000; font-weight: 600; }

.blueprint-grid { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; background-image: linear-gradient(to right, rgb(218, 228, 255) 1px, transparent 1px), linear-gradient(to bottom, rgb(218, 228, 255) 1px, transparent 1px); background-size: 100px 100px; -webkit-mask-image: radial-gradient(circle 400px at var(--mouse-x) var(--mouse-y), black 0%, transparent 100%); mask-image: radial-gradient(circle 300px at var(--mouse-x) var(--mouse-y), black 0%, transparent 100%); }
.container { width: 100%; max-width: var(--container-width); margin: 0 auto; height: 100%; position: relative; z-index: 1; }

/* ========================================================================= */
/* --- HEADER E NAVIGAZIONE --- */
/* ========================================================================= */
header { height: var(--header-height); position: fixed; width: 100%; top: 0; z-index: 9999; transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1); color: var(--text-color); }
header.header-hidden { transform: translateY(-100%); }
nav { display: flex; justify-content: space-between; align-items: center; height: 100%; position: relative; }

.logo-svg { height: 180px; width: auto; display: block; transition: color 0.3s ease; margin-left: -45px; }
.logo-footer { margin-bottom: -70px; margin-top: -70px; }

header.over-blue .logo { color: #FFFFFF; transition: color 0.3s ease; }
header.over-blue .nav-item a { color: #FFFFFF; transition: color 0.3s ease; }
header.over-blue .nav-item a span.hover-text { color: var(--text-color); }
header.over-blue .menu-toggle span { background-color: #FFFFFF; transition: background-color 0.3s ease; }
header.over-blue .nav-item.active-nav a { color: var(--text-color) !important; }

.logo { font-family: var(--font-logo); font-size: 2.2rem; font-weight: 700; letter-spacing: -1px; line-height: 1; text-transform: uppercase; opacity: 0; position: relative; z-index: 1001; }
.nav-links { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 50px; opacity: 0; z-index: 1001; }
.nav-item { position: relative; height: 24px; overflow: hidden; cursor: pointer; }
.nav-item a { display: block; font-size: 0.90rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1); }
.nav-item a span { display: block; height: 24px; line-height: 24px; }
.nav-item a span.hover-text { color: var(--accent-color); }
.nav-item:hover a { transform: translateY(-24px); }
.nav-item.active-nav a { transform: translateY(0) !important; cursor: default; }

.lang-switch-container { margin-left: 20px; }
.lang-switch-btn { display: flex; align-items: center; gap: 6px; font-family: var(--font-tech); font-size: 0.85rem; font-weight: 700; padding: 6px 14px; border: 1px solid var(--border-color); border-radius: 50px; color: var(--text-color); transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); }
.lang-switch-btn:hover { background-color: rgba(37, 99, 235, 0.08); backdrop-filter: blur(8px); border-color: rgba(37, 99, 235, 0.3); color: var(--accent-color); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(37, 99, 235, 0.06); }
header.over-blue .lang-switch-btn { color: #ffffff; border-color: rgba(255, 255, 255, 0.3); background-color: transparent; }
header.over-blue .lang-switch-btn:hover { background-color: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.5); color: #ffffff; }
.desktop-spacer { width: 60px; display: block; }

/* MOBILE MENU */
.menu-toggle { display: none; flex-direction: column; justify-content: space-between; width: 30px; height: 14px; cursor: pointer; z-index: 2002; }
.menu-toggle span { display: block; width: 100%; height: 2px; background-color: var(--text-color); transition: all 0.3s ease; }
/* FIX CROCE: Abbiamo aggiunto !important per assicurarci che diventi sempre scura, battendo l'header bianco */
.menu-toggle.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); background-color: var(--text-color) !important; }
.menu-toggle.active span:nth-child(2) { opacity: 0; transform: translateX(-10px); }
.menu-toggle.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); background-color: var(--text-color) !important; }
/* SETUP BASE RIPPLES (Ritardi per quando si CHIUDE il menu) */
.menu-ripple { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; clip-path: circle(0% at 100% 0%); pointer-events: none; transition: clip-path 0.7s cubic-bezier(0.8, 0, 0.2, 1); }
.ripple-black-menu { background-color: var(--text-color); z-index: 1998; transition-delay: 0.2s; }
.ripple-blue-menu { background-color: var(--accent-color); z-index: 1999; transition-delay: 0.1s; }
.mobile-menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background-color: var(--bg-color); z-index: 2000; display: flex; flex-direction: column; justify-content: center; align-items: center; clip-path: circle(0% at 100% 0%); transition: clip-path 0.7s cubic-bezier(0.8, 0, 0.2, 1); transition-delay: 0s; pointer-events: none; }
/* FIX CERCHI: Ripristinati i ritardi sfalsati per quando si APRE il menu */
.ripple-black-menu.active { clip-path: circle(150% at 100% 0%); transition-delay: 0s; }
.ripple-blue-menu.active { clip-path: circle(150% at 100% 0%); transition-delay: 0.1s; }
.mobile-menu-overlay.active { clip-path: circle(150% at 100% 0%); transition-delay: 0.2s; pointer-events: all; }
.mobile-nav-list { text-align: center; }
.mobile-nav-item { margin: 25px 0; overflow: hidden; }
.mobile-nav-link { display: block; font-size: 2.5rem; font-weight: 800; color: var(--text-color); text-transform: uppercase; letter-spacing: -1px; transform: translateY(100%); opacity: 0; transition: transform 0.5s ease, opacity 0.5s ease; }
.mobile-menu-overlay.active .mobile-nav-item:nth-child(1) .mobile-nav-link { transition-delay: 0.4s; transform: translateY(0); opacity: 1; }
.mobile-menu-overlay.active .mobile-nav-item:nth-child(2) .mobile-nav-link { transition-delay: 0.5s; transform: translateY(0); opacity: 1; }
.mobile-menu-overlay.active .mobile-nav-item:nth-child(3) .mobile-nav-link { transition-delay: 0.6s; transform: translateY(0); opacity: 1; }
.mobile-menu-overlay.active .mobile-nav-item:nth-child(4) .mobile-nav-link { transition-delay: 0.7s; transform: translateY(0); opacity: 1; }
.mobile-menu-overlay.active .mobile-nav-item:nth-child(5) .mobile-nav-link { transition-delay: 0.8s; transform: translateY(0); opacity: 1; }

/* ========================================================================= */
/* --- HERO SECTION & TESTI --- */
/* ========================================================================= */
.hero { height: 100vh; width: 100%; position: fixed; top: 0; left: 0; z-index: 1; }
.hero-bg-blue { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--accent-color); z-index: 0; }
.hero-content-mask { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--bg-color); z-index: 1; display: flex; align-items: center; padding-top: 180px; will-change: clip-path; justify-content: center; }

.hero-wrapper { display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%; text-align: center; will-change: transform, opacity; transform-origin: center center; }
.hero-text-block { width: 100%; display: flex; flex-direction: column; align-items: center; }

h1 { font-family: var(--font-hero); font-size: clamp(4rem, 9vw, 12rem); line-height: 0.95; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 1.5rem; display: flex; flex-direction: column; transform: scaleY(1.15); transform-origin: left bottom; }
.line-mask { display: block; overflow: hidden; padding-bottom: 0.15em; margin-bottom: -0.15em; }
.rise-text { display: inline-block; color: var(--text-color); transform: translateY(115%); opacity: 0; }
p.hero-subtitle { font-family: var(--font-main); font-size: 1.25rem; color: var(--secondary-text); font-weight: 500; opacity: 0; margin-bottom: 2rem; }

/* ANIMAZIONI */
body.start-animations .logo { animation: dropStraight 0.2s ease-out forwards; }
body.start-animations .nav-links { animation: fadeDownCenter 0.2s ease-out forwards; }
body.start-animations .rise-text { animation: riseUp 1.3s cubic-bezier(0.165, 0.84, 0.44, 1) forwards; }
body.start-animations .delay-1 { animation-delay: 1.1s; }
body.start-animations .delay-2 { animation-delay: 1.4s; }
body.start-animations p.hero-subtitle { animation: fadeIn 1s ease-out 1.9s forwards; }

@keyframes dropStraight { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeDownCenter { from { opacity: 0; transform: translateY(-20px) translateX(-50%); } to { opacity: 1; transform: translateY(0) translateX(-50%); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes riseUp { 0% { transform: translateY(115%); opacity: 1; } 100% { transform: translateY(0); opacity: 1; } }

.content-scroller { position: relative; z-index: 20; margin-top: 100vh; background-color: var(--bg-color); box-shadow: 0 -20px 40px rgba(0, 0, 0, 0.04); }
.premium-separator { width: 100%; height: 1px; background: linear-gradient(90deg, transparent, rgba(37,99,235,0.3), rgba(37,99,235,0.8), rgba(37,99,235,0.3), transparent); position: relative; z-index: 10; }

/* ========================================================================= */
/* --- VETRINA PIANI (LAYOUT A COLONNA STATICO) --- */
/* ========================================================================= */
.projects-section { background-color: var(--bg-color); position: relative; z-index: 5; padding-top: 80px; padding-bottom: 80px; }

/* Blocco principale in colonna */
.tier-section {
  display: flex; flex-direction: column; align-items: center; gap: 40px; margin-bottom: 120px;
  opacity: 0; transform: translateY(40px); transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1); scroll-margin-top: 100px;
}
.tier-section.revealed { opacity: 1; transform: translateY(0); }

/* Sezione Testuale in alto */
.tier-info { width: 100%; max-width: 800px; text-align: center; margin-bottom: 20px; }
.project-category { font-family: var(--font-tech); font-size: 1.1rem; color: var(--accent-color); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 15px; display: block; font-weight: 700; }
.project-title { font-size: clamp(1.8rem, 2.5vw, 2.5rem); font-weight: 800; color: var(--text-color); line-height: 1.15; margin-bottom: 20px; letter-spacing: -1px; }
.desc-text { font-size: 1.05rem; color: var(--secondary-text); line-height: 1.6; font-weight: 400;}

/* Galleria Slider orizzontale per i Template (Tutto centrato) */
.tier-gallery-master { width: 100%; max-width: 1200px; display: flex; flex-direction: column; }
.tier-gallery-wrapper { position: relative; width: 100%; overflow: hidden; border: 1px solid; border-radius: 20px; border-color: var(--accent-color); padding: 20px;}

/* ========================================================== */
/* --- FIX DEFINITIVO: SCORRIMENTO LINEARE SBLOCCATO --- */
/* ========================================================== */

.horizontal-templates-gallery {
  overflow-y: hidden !important; /* Taglia via lo scorrimento verticale interno... */
  overscroll-behavior-y: auto !important; /* ...ma LASCIA PASSARE lo scroll alla pagina intera! */
  touch-action: pan-y; /* Fa capire subito a smartphone e trackpad che qui si scorre la pagina in giù */
}

.static-mockup-img {
  pointer-events: auto !important; /* Sblocchiamo il mouse sull'immagine */
  user-select: none; /* Evita che si selezioni di blu per sbaglio */
  -webkit-user-drag: none; /* Evita che l'utente si trascini via l'immagine per sbaglio */
}
/* 3. Assicura che i bottoni rimangano cliccabili nonostante il pointer-events: none sopra */
.slide-actions {
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

.horizontal-templates-gallery {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  width: 100%; -ms-overflow-style: none; scrollbar-width: none;
}
.horizontal-templates-gallery::-webkit-scrollbar { display: none; }

/* La singola slide (Che contiene Nome, Feature, Immagine e Bottoni in colonna) */
.template-slide {
  flex: 0 0 100%; width: 100%; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center;
  padding: 0; box-sizing: border-box;
}

/* 1. Nome Template */
.template-label { font-family: var(--font-hero); font-size: 2rem; color: var(--text-color); margin-bottom:0; font-weight: 700; text-transform: uppercase;}

/* 2. Features con Spunta */
/* SPUNTE E LISTA (Ora in colonna e centrata come blocco) */
.plan-features {
  display: flex;
  flex-direction: column; /* Mette in colonna! */
  align-items: flex-start; /* Allinea icone e testo a sinistra */
  gap: 15px;
  margin: 0 auto 40px auto; /* Centra l'intero blocco */
  list-style: none;
  width: fit-content; /* Fondamentale: fa stringere il blocco attorno al testo */
}
.plan-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--secondary-text);
  font-weight: 400;
  text-align: left; /* Testo pulito a sinistra */
}
.plan-features li svg {
  flex-shrink: 0;
  color: var(--accent-color);
  width: 20px;
  height: 20px;
}
.plan-features li strong { font-weight: 700; color: var(--text-color); }
/* 3. Immagine Statica Mockup */
.static-mockup-wrapper { width: 100%; display: flex; justify-content: center;}
.static-mockup-img {
  width: 100%; max-width: 1000px; height: auto; object-fit: contain;
  /* Nessuna ombra CSS: le tue immagini da Figma hanno già un'ombra bellissima! */
}

/* 4. I Bottoni */
.slide-actions { display: flex; flex-direction: column; align-items: center; gap: 25px; }

.btn-demo-link {
  font-family: var(--font-tech);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--secondary-text);
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.3s ease, text-decoration-color 0.3s ease;
  /* Trasformiamo il link in un flexbox per allineare testo e freccia */
  display: inline-flex;
  align-items: center;
  gap: 6px; /* Spaziatura tra il testo e l'icona */
}
/* Colore al passaggio del mouse */
.btn-demo-link:hover {
  color: var(--accent-color);
}

/* Animazione fluida della freccia: scatta leggermente in alto a destra */
.btn-demo-link:hover::after {
  transform: translate(3px, -3px);
}

/* Creiamo la freccia diagonale direttamente in CSS */
.btn-demo-link::after {
  content: "";
  display: block;
  width: 14px;
  height: 14px;

  /* Prende in automatico il colore del testo (grigio di base, blu all'hover) */
  background-color: currentColor;

  /* Disegniamo la freccia usando una maschera SVG */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='7' y1='17' x2='17' y2='7'%3E%3C/line%3E%3Cpolyline points='7 7 17 7 17 17'%3E%3C/polyline%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='7' y1='17' x2='17' y2='7'%3E%3C/line%3E%3Cpolyline points='7 7 17 7 17 17'%3E%3C/polyline%3E%3C/svg%3E") center/contain no-repeat;

  transition: transform 0.3s ease;
}

.btn-visit {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 20px; border-radius: 50px; background-color: var(--accent-color); border: 2px solid var(--accent-color);
  color: #fff; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; font-size: 0.95rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); cursor: pointer; box-shadow: 0 4px 15px rgba(37,99,235,0.15);
}
.btn-visit:hover { transform: translateY(-5px) scale(1.02); box-shadow: 0 15px 30px rgba(37,99,235,0.4); background-color: #1d4ed8; color: #fff; }

/* CONTENITORE DEL BOTTONE FISSO (Fuori dallo slider) */
.master-action-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 15px 30px 15px; /* Togliamo padding inutile ai lati */
  position: relative;
  z-index: 30;
  margin-top: 20px;
}
/* 5. Le Frecce sotto allo Slider */
.gallery-controls { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 20px; width: 100%; }
.slider-arrow { width: 45px; height: 45px; border-radius: 50%; background: var(--surface-color); border: 1px solid var(--border-color); color: var(--text-color); display: flex; justify-content: center; align-items: center; cursor: pointer; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); flex-shrink: 0; box-shadow: 0 4px 6px rgba(0,0,0,0.02); }
.slider-arrow:hover { background: var(--accent-color); color: #fff; border-color: var(--accent-color); transform: scale(1.1); box-shadow: 0 5px 15px rgba(37,99,235,0.3); }
.slider-arrow svg { width: 20px; height: 20px; stroke-width: 2; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }

.gallery-pagination { display: flex; gap: 20px; align-items: center; justify-content: center; }
.gallery-num { font-family: var(--font-tech); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; color: var(--secondary-text); font-weight: 600; cursor: pointer; transition: all 0.3s ease; padding: 5px 10px; text-align: center;}
.gallery-num:hover { color: var(--text-color); }
.gallery-num.active { color: var(--accent-color); transform: scale(1.05); text-shadow: 0 0 10px rgba(37,99,235,0.2); }

/* ========================================================================= */
/* --- CUSTOMIZATION SECTION --- */
/* ========================================================================= */
.customization-section { position: relative; padding: 100px 0; background-color: var(--bg-color); }
.static-grid-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: linear-gradient(to right, rgb(218, 228, 255) 1px, transparent 1px), linear-gradient(to bottom, rgb(218, 228, 255) 1px, transparent 1px); background-size: 100px 100px; z-index: 0; opacity: 0.7; pointer-events: none; -webkit-mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent); mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent); }

.customization-notice { margin: 0 auto; max-width: 1100px; padding: 40px; border-radius: 16px; display: flex; gap: 30px; align-items: center; opacity: 0; transform: translateY(20px); transition: opacity 0.8s ease, transform 0.8s ease; background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(2px) saturate(200%); -webkit-backdrop-filter: blur(2px) saturate(200%); border: 1px solid rgba(255, 255, 255, 0.9); border-left: 4px solid var(--accent-color); box-shadow: 0 15px 35px rgba(37, 99, 235, 0.05); }
.customization-notice.revealed { opacity: 1; transform: translateY(0); }
.customization-notice svg { width: 45px; height: 45px; color: var(--accent-color); flex-shrink: 0; }
.customization-text h3 { font-size: 1.5rem; color: var(--text-color); margin-bottom: 10px; letter-spacing: -0.5px; line-height: 1.2; font-weight: 800;}
.customization-text p { color: var(--secondary-text); font-size: 1.05rem; line-height: 1.6; margin: 0; font-weight: 400;}
.customization-text strong { color: var(--text-color); font-weight: 700; }

/* ========================================================================= */
/* --- FOOTER & FORMS --- */
/* ========================================================================= */
footer { padding: 80px 0; border-top: 1px solid var(--border-color); background-color: var(--surface-color); position: relative; z-index: 10; font-size: 0.95rem; color: var(--secondary-text); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 60px; }
.footer-col h4 { color: var(--text-color); font-size: 1.1rem; margin-bottom: 20px; font-weight: 700; }
.footer-col .logo { color: var(--text-color); }
.footer-col ul li { margin-bottom: 12px; }
.footer-col ul li a:hover { color: var(--accent-color); font-weight: 500;}
.contact-item { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; color: var(--secondary-text); transition: 0.3s; font-weight: 500;}
.contact-item:hover { color: var(--accent-color); }
.contact-item svg { width: 20px; height: 20px; stroke-width: 1.5; }
.social-link svg { fill: currentColor; width: 24px; height: 24px; }

.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15,23,42,0.7); backdrop-filter: blur(5px);
  z-index: 20000; display: flex; justify-content: center; align-items: center;
  opacity: 0;
  visibility: hidden; /* AGGIUNTO: Lo nasconde in modo assoluto al caricamento */
  pointer-events: none; transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible; /* AGGIUNTO: Lo fa riapparire solo quando attivato dal JS */
  pointer-events: all;
}
.modal-box { background: #ffffff; border: none; padding: 40px; border-radius: 20px; width: 90%; max-width: 450px; position: relative; transform: translateY(20px); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }
.modal-overlay.active .modal-box { transform: translateY(0); }
.modal-close { position: absolute; top: 15px; right: 20px; font-size: 2rem; color: var(--text-color); cursor: pointer; line-height: 1; transition: color 0.3s; font-weight: 300;}
.modal-close:hover { color: var(--accent-color); }
.modal-title { font-family: var(--font-tech); font-size: 1.3rem; font-weight: 700; margin-bottom: 10px; color: var(--text-color); text-transform: uppercase; letter-spacing: -0.5px;}
.modal-desc { font-size: 1rem; color: var(--secondary-text); margin-bottom: 25px; }

.form-group { margin-bottom: 20px; }
.form-input { width: 100%; background: #F1F5F9; border: 1px solid #CBD5E1; padding: 15px; color: var(--text-color); font-family: var(--font-main); font-size: 1rem; border-radius: 10px; outline: none; transition: all 0.3s ease; }
.form-input:focus { border-color: var(--accent-color); background: #ffffff; box-shadow: 0 0 0 4px rgba(37,99,235,0.1); }
textarea.form-input { resize: vertical; min-height: 120px; }

/* CHECKBOX PRIVACY PREMIUM */
.checkbox-group { margin-bottom: 25px; text-align: left; }
.custom-checkbox { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; position: relative; user-select: none; }
.custom-checkbox input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.checkmark { flex-shrink: 0; width: 22px; height: 22px; background-color: #F1F5F9; border: 1px solid #CBD5E1; border-radius: 6px; transition: all 0.3s ease; display: flex; justify-content: center; align-items: center; margin-top: 2px; }
.custom-checkbox:hover input ~ .checkmark { border-color: var(--accent-color); }
.custom-checkbox input:checked ~ .checkmark { background-color: var(--accent-color); border-color: var(--accent-color); box-shadow: 0 4px 10px rgba(37,99,235,0.2); }
.checkmark::after { content: ""; display: none; width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-bottom: 2px; }
.custom-checkbox input:checked ~ .checkmark::after { display: block; animation: checkAnim 0.2s ease-in-out forwards; }
@keyframes checkAnim { 0% { transform: rotate(45deg) scale(0); } 100% { transform: rotate(45deg) scale(1); } }
.checkbox-text { font-size: 0.85rem; color: var(--secondary-text); line-height: 1.5; }
.checkbox-text a { color: var(--text-color); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; transition: color 0.3s ease; }
.checkbox-text a:hover { color: var(--accent-color); }

.privacy-error-msg { color: #EF4444; font-size: 0.8rem; margin-top: 8px; margin-left: 34px; font-weight: 600; display: none; animation: fadeInError 0.3s ease; }
.privacy-error-msg.show { display: block; }
.checkmark.error-border { border-color: #EF4444 !important; background-color: rgba(239, 68, 68, 0.05); animation: shakeCheck 0.4s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shakeCheck { 10%, 90% { transform: translate3d(-1px, 0, 0); } 20%, 80% { transform: translate3d(2px, 0, 0); } 30%, 50%, 70% { transform: translate3d(-3px, 0, 0); } 40%, 60% { transform: translate3d(3px, 0, 0); } }
@keyframes fadeInError { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

.btn-submit { width: 100%; padding: 16px 0; background: var(--accent-color); color: #fff; border: none; border-radius: 10px; font-family: var(--font-tech); font-size: 1rem; font-weight: 700; cursor: pointer; transition: all 0.3s ease; text-transform: uppercase; letter-spacing: 1px; }
.btn-submit:hover { background: #1d4ed8; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(37,99,235,0.3);}

/* ========================================================================= */
/* --- RESPONSIVE MOBILE MEDIA QUERIES --- */
/* ========================================================================= */
@media (max-width: 1024px) {
  h1 { font-size: 12vw; margin-bottom: 1.5rem; }
  .hero { height: 100vh;}
  .container { padding: 0 20px;}
  p.hero-subtitle { font-family: var(--font-logo); font-size: 1.1rem;}
  .hero-content-mask { padding-top: 140px; padding-bottom: 60px; }
  .hero-wrapper { flex-direction: column; align-items: flex-start; justify-content: flex-start; padding-top: 0; }
  .hero-text-block { width: 100%; margin-bottom: 40px; }
  .nav-links, .desktop-spacer { display: none; }
  .menu-toggle { display: flex; }
  .footer-grid { grid-template-columns: 1fr; gap: 40px; }
  .blueprint-grid { opacity: 0.5; -webkit-mask-image: none !important; mask-image: none !important;}

  .tier-section { gap: 20px; margin-bottom: 30px; }
  .plan-features { flex-direction: column; gap: 15px; align-items: flex-start; }

  .slider-arrow { display: none !important; }
  .gallery-num { font-size: 0.75rem; padding: 5px; }
  .gallery-pagination { gap: 10px; }

  .customization-notice { flex-direction: column; align-items: flex-start; padding: 30px; gap: 20px; margin-bottom: 60px; }
  .template-label {font-size: 1.1rem;}
  .btn-demo-link { font-size: 0.85rem; }
}
