/* ============================================================
   BASE — Variabili, Reset, Tipografia, Utilità globali
   ============================================================ */

:root {
  --navy:         #0d2b3e;
  --deep-blue:    #0a1e2e;
  --royal:        #b91c1c;
  --accent:       #e42f35;
  --accent-mid:   #ef4444;
  --accent-light: #f87171;
  --accent-glow:  #fca5a5;

  --bg:           #ffffff;
  --bg-soft:      #f8fafc;
  --bg-muted:     #f1f5f9;
  --surface:      #ffffff;
  --border:       #e2e8f0;

  --text:         #0f172a;
  --text-mid:     #334155;
  --text-muted:   #64748b;
  --text-faint:   #94a3b8;
}

/* ----- Reset ----- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text-mid);
  overflow-x: hidden;
}

/* ----- Scrollbar ----- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ----- Sezioni ----- */
section { padding: 4.5rem 8%; position: relative; }

.section-label {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.7rem;
}
.section-label::before {
  content: ''; width: 28px; height: 2px;
  background: var(--accent); border-radius: 1px;
}

.section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(1.85rem, 3vw, 2.7rem);
  font-weight: 700; color: var(--navy);
  margin-bottom: 0.9rem; line-height: 1.15;
}

.section-subtitle {
  font-size: 1rem; color: var(--text-muted);
  max-width: 530px; line-height: 1.7;
}

/* ----- Wave Dividers ----- */
.wave-divider {
  position: relative; width: 100%;
  overflow: hidden; line-height: 0; margin-top: -1px;
}
.wave-divider svg { display: block; width: 100%; height: 60px; }
.wave-divider.flip { transform: scaleX(-1); }

/* ----- Watermark logo sezioni ----- */
.section-watermark {
  position: absolute; width: 180px; height: 180px;
  opacity: 0.035; pointer-events: none; z-index: 0;
}
.section-watermark img { width: 100%; height: 100%; object-fit: contain; }
.section-watermark.left  { left: 2%;  top: 50%; transform: translateY(-50%); }
.section-watermark.right { right: 2%; top: 50%; transform: translateY(-50%) scaleX(-1); }

/* ----- Pulsanti globali ----- */
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.9rem; background: var(--accent);
  color: #fff; text-decoration: none; border-radius: 8px;
  font-weight: 600; font-size: 0.93rem; transition: all 0.3s;
  box-shadow: 0 4px 16px rgba(228,47,53,0.22);
  border: none; cursor: pointer;
}
.btn-primary:hover {
  background: var(--royal); transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(228,47,53,0.32);
}

.btn-secondary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.9rem; background: transparent;
  color: var(--text-mid); text-decoration: none;
  border-radius: 8px; font-weight: 500; font-size: 0.93rem;
  border: 1.5px solid var(--border); transition: all 0.3s; cursor: pointer;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ----- Animazioni scroll reveal ----- */
.reveal {
  opacity: 0; transform: translateY(35px);
  transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible          { opacity: 1; transform: translateY(0); }
.reveal-delay-1          { transition-delay: 0.1s; }
.reveal-delay-2          { transition-delay: 0.2s; }
.reveal-delay-3          { transition-delay: 0.3s; }
.reveal-delay-4          { transition-delay: 0.4s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .hero-visual        { display: none; }
  .services-icons-grid { grid-template-columns: repeat(3, 1fr); }
  .tech-layout        { grid-template-columns: 1fr; gap: 2rem; }
  .tech-left          { text-align: center; }
  .tech-left .section-label { justify-content: center; }
  .tech-desc          { max-width: 560px; margin: 0 auto; }
  .why-grid           { grid-template-columns: 1fr 1fr; }
  .contact-wrapper    { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  section             { padding: 3.2rem 6%; }
  .nav-links          { display: none; }
  .nav-toggle         { display: flex; }
  .services-icons-grid { grid-template-columns: repeat(3, 1fr); }
  .why-grid           { grid-template-columns: 1fr; }
  .cert-logos         { gap: 1.5rem; }
  .form-row           { grid-template-columns: 1fr; }
  .map-row            { grid-template-columns: 1fr; }
  .footer-top         { flex-direction: column; gap: 2rem; }
  .footer-bottom      { flex-direction: column; gap: 1rem; text-align: center; }
  .hero-actions       { flex-direction: column; align-items: stretch; }
  .section-label      { font-size: 0.68rem; letter-spacing: 2px; }
  .section-title      { font-size: clamp(1.75rem, 8vw, 2.3rem); line-height: 1.12; }
  .section-subtitle   { font-size: 0.96rem; line-height: 1.65; }
  .btn-primary,
  .btn-secondary      { width: 100%; justify-content: center; padding: 0.95rem 1.15rem; }
  .wave-divider svg   { height: 42px; }
}

/* Mobile nav open state (gestito da main.js) */
@media (max-width: 768px) {
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--navy);
    padding: 1rem 5% 1.5rem;
    gap: 1.2rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  }
}

@media (max-width: 480px) {
  section           { padding: 2.7rem 5%; }
  .section-label    { font-size: 0.64rem; letter-spacing: 1.7px; }
  .section-title    { font-size: clamp(1.55rem, 8.5vw, 2rem); }
  .section-subtitle { font-size: 0.92rem; }
  .wave-divider svg { height: 34px; }
}