:root {
  --navy: #0d1b2a;
  --steel: #1b2e45;
  --blue: #1a6ebd;
  --accent: #f0a500;
  --light: #e8edf2;
  --white: #ffffff;
  --gray: #7a8fa6;
  --section-pad: 80px 0;
}

/* ── TEMA CHIARO (giorno) ── */
html[data-theme="light"] {
  --navy:  #eef2f7;
  --steel: #ffffff;
  --blue:  #1560a8;
  --accent:#c47f00;
  --light: #243240;
  --white: #0d1b2a;
  --gray:  #5c6b7a;
}

/* Transizione morbida al cambio tema */
body, nav, section, .service-card, .process-card, .project-card,
.skill-group, .skill-tag, .highlight-item, .contact-item, .contact-note,
.contact-form, .form-field input, .form-field textarea,
#lang-toggle, #lang-toggle button {
  transition: background-color .4s ease, color .4s ease, border-color .4s ease;
}

/* Superfici con colore "fisso" navy → adattate al tema chiaro */
html[data-theme="light"] nav         { background: rgba(255,255,255,0.92); }
html[data-theme="light"] #lang-toggle{ background: rgba(255,255,255,0.85); }
html[data-theme="light"] .highlight-item { background: rgba(13,27,42,0.04); }
html[data-theme="light"] .skill-tag  { background: #f0f4f8; }
html[data-theme="light"] #hero {
  background:
    linear-gradient(to bottom, rgba(238,242,247,0.7) 0%, rgba(238,242,247,0.97) 100%),
    repeating-linear-gradient(45deg, transparent, transparent 40px,
      rgba(21,96,168,0.05) 40px, rgba(21,96,168,0.05) 80px);
}
/* Testo che deve restare bianco perché sta su fondo colorato */
html[data-theme="light"] .btn-primary,
html[data-theme="light"] .testimonial-avatar,
html[data-theme="light"] #lang-toggle button.active { color: #fff; }
html[data-theme="light"] .btn-outline:hover { color: #fff; }
/* Ombre più leggere su fondo chiaro */
html[data-theme="light"] .service-card:hover,
html[data-theme="light"] .process-card:hover,
html[data-theme="light"] .project-card:hover { box-shadow: 0 12px 32px rgba(13,27,42,0.12); }

/* Pulsante tema (sole/luna) */
#theme-btn { display: flex; align-items: center; padding: 4px 9px; }
#theme-btn .ic { width: 16px; height: 16px; stroke: var(--accent); }

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--navy);
  color: var(--light);
  line-height: 1.7;
  overflow-x: hidden;
  max-width: 100%;
}

/* ── LANG TOGGLE ── */
#lang-toggle {
  position: fixed;
  top: 18px; right: 24px;
  z-index: 1000;
  display: flex;
  gap: 4px;
  background: rgba(13,27,42,0.85);
  border: 1px solid var(--blue);
  border-radius: 6px;
  padding: 4px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
#lang-toggle button {
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 4px;
  transition: all 0.2s;
}
#lang-toggle button.active {
  background: var(--blue);
  color: var(--white);
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 999;
  background: rgba(13,27,42,0.95);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(26,110,189,0.3);
  display: flex;
  align-items: center;
  padding: 0 40px;
  height: 60px;
}
nav .logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 1px;
}
nav .logo span { color: var(--accent); }
nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0 auto;
}
nav ul a {
  color: var(--gray);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: color 0.2s;
}
nav ul a:hover { color: var(--accent); }

/* ── HERO ── */
#hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    linear-gradient(to bottom, rgba(13,27,42,0.7) 0%, rgba(13,27,42,0.95) 100%),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 40px,
      rgba(26,110,189,0.04) 40px,
      rgba(26,110,189,0.04) 80px
    );
  padding: 100px 24px 60px;
}
#hero .badge {
  display: inline-block;
  background: rgba(26,110,189,0.15);
  border: 1px solid var(--blue);
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 18px;
  border-radius: 20px;
  margin-bottom: 24px;
}
#hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 10px;
}
#hero h1 span { color: var(--accent); }
#hero .subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--gray);
  margin-bottom: 36px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
#hero .tagline {
  font-size: 1.05rem;
  color: var(--light);
  max-width: 680px;
  margin: 0 auto 44px;
}
.cta-group { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s;
  letter-spacing: 0.5px;
}
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: #1a5fa3; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(26,110,189,0.4); }
.btn-outline { border: 2px solid var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: var(--navy); transform: translateY(-2px); }

.hero-stats {
  display: flex;
  gap: 48px;
  justify-content: center;
  margin-top: 64px;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat .num {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.stat .label { font-size: 0.8rem; color: var(--gray); letter-spacing: 1px; text-transform: uppercase; margin-top: 4px; }

/* ── SECTIONS ── */
section { padding: var(--section-pad); }
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
}
h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 16px;
}
.lead {
  font-size: 1.05rem;
  color: var(--gray);
  max-width: 680px;
  margin-bottom: 56px;
}
.divider {
  width: 48px; height: 4px;
  background: var(--accent);
  border-radius: 2px;
  margin-bottom: 20px;
}

/* ── ABOUT ── */
#about { background: var(--steel); }
.about-top {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 44px;
}
.about-photo img {
  width: 100%;
  display: block;
  border-radius: 12px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.04);
  border: 1px solid rgba(26,110,189,0.35);
  box-shadow: 0 14px 40px rgba(0,0,0,0.35);
}
.about-text p { color: var(--light); margin-bottom: 16px; }
.cv-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.cv-actions .btn { padding: 11px 22px; font-size: 0.85rem; }
.about-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 16px;
}
.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: rgba(13,27,42,0.5);
  border: 1px solid rgba(26,110,189,0.2);
  border-radius: 8px;
  padding: 16px 20px;
}
.highlight-icon { flex-shrink: 0; display: flex; align-items: center; }

/* ── SVG ICONS ── */
.ic {
  display: inline-block;
  vertical-align: middle;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.highlight-icon .ic { width: 26px; height: 26px; }
.service-card .icon .ic { width: 34px; height: 34px; }
.ci-icon .ic { width: 22px; height: 22px; stroke: var(--blue); }
.logo-mark { width: 24px; height: 24px; vertical-align: middle; margin-right: 7px; }
.highlight-item strong { color: var(--white); display: block; margin-bottom: 2px; font-size: 0.95rem; }
.highlight-item span { color: var(--gray); font-size: 0.88rem; }

/* ── SERVICES ── */
#services { background: var(--navy); }
#software { background: var(--steel); }
#software .feature-grid { grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); }
#software .callout { margin-top: 28px; }
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 24px;
}
.service-card {
  background: var(--steel);
  border: 1px solid rgba(26,110,189,0.2);
  border-radius: 10px;
  padding: 28px 24px;
  transition: all 0.3s;
}
.service-card:hover {
  border-color: var(--blue);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}
.service-card .icon { font-size: 2rem; margin-bottom: 16px; }
.service-card h3 { color: var(--white); font-size: 1.05rem; margin-bottom: 10px; }
.service-card p { color: var(--gray); font-size: 0.88rem; line-height: 1.6; }

/* ── METHOD ── */
#method {
  background:
    var(--navy)
    repeating-linear-gradient(45deg, transparent, transparent 40px, rgba(26,110,189,0.045) 40px, rgba(26,110,189,0.045) 80px);
}
.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(235px, 100%), 1fr));
  gap: 24px;
}
.process-card {
  background: var(--steel);
  border: 1px solid rgba(26,110,189,0.22);
  border-radius: 10px;
  padding: 30px 24px 24px;
  transition: transform 0.3s, border-color 0.3s;
}
.process-card:hover { transform: translateY(-4px); border-color: var(--blue); }
.process-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(240,165,0,0.12); border: 1px solid var(--accent);
  color: var(--accent); font-weight: 800; font-size: 1.15rem; margin-bottom: 16px;
}
.process-card h3 { color: var(--white); font-size: 1.05rem; margin-bottom: 10px; }
.process-card p { color: var(--gray); font-size: 0.9rem; line-height: 1.6; }

/* ── PORTFOLIO ── */
#portfolio { background: var(--steel); }
.projects-list { display: flex; flex-direction: column; gap: 28px; }
.project-card {
  background: var(--navy);
  border: 1px solid rgba(26,110,189,0.2);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  transition: box-shadow 0.3s;
}
.project-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.project-card h3 { color: var(--white); font-size: 1.1rem; margin-bottom: 8px; }
.project-card p { color: var(--gray); font-size: 0.9rem; }
.project-tag {
  background: rgba(26,110,189,0.15);
  border: 1px solid var(--blue);
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}
.tech-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tech-tag {
  background: rgba(240,165,0,0.1);
  border: 1px solid rgba(240,165,0,0.3);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
}

/* ── SKILLS ── */
#skills { background: var(--navy); }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 28px;
}
.skill-group {
  background: var(--steel);
  border: 1px solid rgba(26,110,189,0.15);
  border-radius: 10px;
  padding: 24px;
}
.skill-group h3 {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(26,110,189,0.2);
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tag {
  background: rgba(13,27,42,0.8);
  border: 1px solid rgba(26,110,189,0.3);
  color: var(--light);
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 5px;
}

/* ── CERTIFICATIONS ── */
#certifications { background: var(--steel); }
.cert-highlight {
  background: rgba(240,165,0,0.07);
  border: 1px solid rgba(240,165,0,0.3);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 40px;
  color: var(--light);
  font-size: 0.98rem;
  line-height: 1.7;
  max-width: 860px;
}
.cert-highlight strong { color: var(--white); }
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 28px;
}
.cert-col {
  background: var(--navy);
  border: 1px solid rgba(26,110,189,0.2);
  border-radius: 10px;
  padding: 26px 28px;
}
html[data-theme="light"] .cert-col { background: rgba(13,27,42,0.04); }
.cert-col h3 {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(26,110,189,0.2);
}
.cert-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid rgba(26,110,189,0.12);
}
.cert-item:last-child { border-bottom: none; padding-bottom: 0; }
.cert-item .cert-ic { flex-shrink: 0; display: flex; padding-top: 2px; }
.cert-item .cert-ic .ic { width: 20px; height: 20px; stroke: var(--accent); }
.cert-title { color: var(--white); font-weight: 600; font-size: 0.95rem; display: block; margin-bottom: 3px; }
.cert-meta { color: var(--gray); font-size: 0.82rem; }
.cert-badge {
  display: inline-block;
  background: rgba(26,110,189,0.15);
  border: 1px solid var(--blue);
  color: var(--blue);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ── TESTIMONIALS ── */
#testimonials {
  background:
    var(--navy)
    repeating-linear-gradient(45deg, transparent, transparent 40px, rgba(26,110,189,0.045) 40px, rgba(26,110,189,0.045) 80px);
}
.testimonials-wrap { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; }
.testimonial-card {
  flex: 1 1 320px;
  max-width: 560px;
  background: var(--steel);
  border: 1px solid rgba(26,110,189,0.2);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 32px;
  position: relative;
}
.testimonial-card .quote-mark {
  font-size: 3.4rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.35;
  font-family: Georgia, serif;
  margin-bottom: 4px;
}
.testimonial-quote { color: var(--light); font-size: 1rem; line-height: 1.75; font-style: italic; margin-bottom: 22px; }
.testimonial-author { display: flex; align-items: center; gap: 14px; }
.testimonial-avatar {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-weight: 800; font-size: 0.95rem;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 0.5px;
}
.testimonial-name { color: var(--white); font-weight: 700; font-size: 0.95rem; }
.testimonial-role { color: var(--gray); font-size: 0.82rem; }

/* ── CONTACT ── */
#contact { background: var(--steel); }
.contact-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: start;
}
.contact-info { display: flex; flex-direction: column; gap: 20px; margin-top: 8px; }
.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--navy);
  border: 1px solid rgba(26,110,189,0.2);
  border-radius: 8px;
  padding: 16px 20px;
  text-decoration: none;
  color: var(--light);
  transition: border-color 0.2s;
}
.contact-item:hover { border-color: var(--blue); }
.contact-item .ci-icon { font-size: 1.3rem; }
.contact-item strong { display: block; color: var(--white); font-size: 0.9rem; }
.contact-item span { color: var(--gray); font-size: 0.82rem; overflow-wrap: anywhere; }
.contact-item > div { min-width: 0; }
.contact-note {
  background: var(--navy);
  border: 1px solid rgba(240,165,0,0.3);
  border-radius: 10px;
  padding: 28px;
  margin-top: 20px;
}
.contact-note h3 { color: var(--white); margin-bottom: 12px; font-size: 1.1rem; }
.contact-note p { color: var(--gray); font-size: 0.9rem; margin-bottom: 16px; }
.availability {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4caf7d;
  font-weight: 600;
  font-size: 0.9rem;
}
.availability::before {
  content: '';
  width: 10px; height: 10px;
  background: #4caf7d;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(76,175,125,0.2);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(76,175,125,0.2); }
  50% { box-shadow: 0 0 0 6px rgba(76,175,125,0.05); }
}

/* ── CONTACT FORM ── */
.contact-form {
  background: var(--navy);
  border: 1px solid rgba(26,110,189,0.25);
  border-radius: 10px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label {
  color: var(--light);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.form-field input,
.form-field textarea {
  background: var(--steel);
  border: 1px solid rgba(26,110,189,0.3);
  border-radius: 6px;
  padding: 11px 14px;
  color: var(--light);
  font-family: inherit;
  font-size: 0.92rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--gray); }
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,110,189,0.15);
}
.form-field textarea { resize: vertical; min-height: 120px; }
.contact-form button {
  border: none;
  cursor: pointer;
  align-self: flex-start;
  margin-top: 4px;
}
.contact-form button:disabled { opacity: 0.6; cursor: not-allowed; }
.form-status {
  font-size: 0.88rem;
  font-weight: 600;
  min-height: 1.2em;
}
.form-status.success { color: #4caf7d; }
.form-status.error { color: #e07a7a; }
/* Honeypot nascosto senza spingere contenuto fuori schermo (evita scroll orizzontale su mobile) */
.hp-field { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── FOOTER ── */
footer {
  background: var(--navy);
  border-top: 1px solid rgba(26,110,189,0.2);
  text-align: center;
  padding: 28px 24px;
  color: var(--gray);
  font-size: 0.82rem;
}
footer a { color: var(--gray); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* ── Pulsante menu mobile ── */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid rgba(26,110,189,0.4);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  margin-right: 12px;
  transition: border-color 0.2s;
}
.nav-toggle:hover { border-color: var(--accent); }
.nav-toggle .ic { width: 20px; height: 20px; stroke: var(--accent); }

/* ── Menu a tendina sotto i 1200px: con undici voci la riga non ci sta ── */
@media (max-width: 1200px) {
  nav { padding: 0 16px; gap: 12px; }
  .nav-toggle { display: inline-flex; }
  nav ul {
    display: none;
    position: fixed;
    top: 60px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 6px 0 12px;
    background: var(--steel);
    border-bottom: 1px solid rgba(26,110,189,0.3);
    box-shadow: 0 14px 30px rgba(0,0,0,0.35);
    max-height: calc(100vh - 60px);
    max-height: calc(100dvh - 60px);
    overflow-y: auto;
  }
  html[data-theme="light"] nav ul { box-shadow: 0 14px 30px rgba(13,27,42,0.15); }
  nav ul.open { display: flex; }
  nav ul li { width: 100%; }
  nav ul a {
    display: block;
    padding: 13px 20px;
    font-size: 0.92rem;
    border-bottom: 1px solid rgba(26,110,189,0.12);
  }
  nav ul li:last-child a { border-bottom: none; }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .about-top, .contact-inner { grid-template-columns: 1fr; gap: 32px; }
  .project-card { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
  .contact-form { padding: 24px 18px; }
}

/* ── FAQ ── */
#faq { background: var(--navy); }
.faq-list { display: flex; flex-direction: column; gap: 14px; max-width: 840px; }
.faq-item {
  background: var(--steel);
  border: 1px solid rgba(26,110,189,0.2);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq-item[open] { border-color: var(--blue); }
.faq-item summary {
  cursor: pointer;
  padding: 18px 22px;
  font-weight: 700;
  color: var(--white);
  font-size: 1rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: '\2212'; }
.faq-item .faq-a {
  padding: 0 22px 20px;
  color: var(--gray);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* Il widget reCAPTCHA ha larghezza fissa (~302px): lo adatto agli schermi stretti */
.contact-form > div[data-netlify-recaptcha] { max-width: 100%; overflow: hidden; }
@media (max-width: 360px) {
  .contact-form > div[data-netlify-recaptcha] { transform: scale(0.86); transform-origin: left top; }
}

/* ============================================================
   COMPONENTI CONDIVISI / PAGINE INTERNE
   ============================================================ */

/* ── Card servizio cliccabile ── */
a.service-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
a.service-card-link:hover { border-color: var(--blue); }
.card-link-cta {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
a.service-card-link:hover .card-link-cta { text-decoration: underline; }

/* ── Voce di menu della pagina corrente ── */
nav ul a.is-current { color: var(--accent); }

/* ── HERO delle pagine interne ── */
.page-hero {
  padding: 130px 24px 70px;
  background:
    linear-gradient(to bottom, rgba(13,27,42,0.7) 0%, rgba(13,27,42,0.95) 100%),
    repeating-linear-gradient(45deg, transparent, transparent 40px,
      rgba(26,110,189,0.04) 40px, rgba(26,110,189,0.04) 80px);
}
html[data-theme="light"] .page-hero {
  background:
    linear-gradient(to bottom, rgba(238,242,247,0.7) 0%, rgba(238,242,247,0.97) 100%),
    repeating-linear-gradient(45deg, transparent, transparent 40px,
      rgba(21,96,168,0.05) 40px, rgba(21,96,168,0.05) 80px);
}
.page-hero h1 {
  font-size: clamp(1.9rem, 4.4vw, 2.9rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 16px;
  max-width: 940px;
}
.page-hero .subtitle {
  font-size: clamp(1rem, 2.2vw, 1.22rem);
  color: var(--accent);
  font-weight: 600;
  max-width: 780px;
  margin-bottom: 20px;
}
.page-hero .tagline {
  font-size: 1.02rem;
  color: var(--light);
  max-width: 780px;
  margin-bottom: 36px;
}
.page-hero .cta-group { justify-content: flex-start; }
.breadcrumb {
  font-size: 0.8rem;
  color: var(--gray);
  margin-bottom: 18px;
  letter-spacing: 0.5px;
}
.breadcrumb a { color: var(--gray); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* ── Griglia "cosa risolvo" ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 16px;
}
.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: rgba(13,27,42,0.5);
  border: 1px solid rgba(26,110,189,0.2);
  border-radius: 8px;
  padding: 18px 20px;
  transition: border-color 0.25s;
}
html[data-theme="light"] .feature-item { background: rgba(13,27,42,0.04); }
.feature-item:hover { border-color: var(--blue); }
.feature-item .f-ic { flex-shrink: 0; display: flex; padding-top: 2px; }
.feature-item .f-ic .ic { width: 22px; height: 22px; }
.feature-item strong { color: var(--white); display: block; font-size: 0.95rem; margin-bottom: 3px; }
.feature-item span { color: var(--gray); font-size: 0.88rem; line-height: 1.6; }

/* ── Riquadro in evidenza ── */
.callout {
  background: rgba(240,165,0,0.07);
  border: 1px solid rgba(240,165,0,0.3);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 22px 26px;
  color: var(--light);
  font-size: 0.98rem;
  line-height: 1.7;
  max-width: 860px;
}
.callout strong { color: var(--white); }
.callout + .callout { margin-top: 18px; }

/* ── Blocco testo con paragrafi (pagine interne) ── */
.prose { max-width: 800px; }
.prose p { color: var(--light); margin-bottom: 16px; font-size: 0.98rem; }
.prose p:last-child { margin-bottom: 0; }
.prose .muted { color: var(--gray); }

/* ── CTA di chiusura pagina ── */
.page-cta {
  background: var(--steel);
  border: 1px solid rgba(240,165,0,0.3);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
}
.page-cta h2 { margin-bottom: 12px; }
.page-cta p { color: var(--gray); max-width: 620px; margin: 0 auto 26px; }
.page-cta .cta-group { justify-content: center; }

@media (max-width: 768px) {
  .page-hero { padding: 100px 16px 54px; }
  .page-cta { padding: 30px 20px; }
}

/* ── Griglia a 3 colonne massimo (servizi di ingresso) ── */
@media (min-width: 900px) {
  .services-grid.grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ── Link dentro i contenuti testuali ── */
.faq-a a, .prose a, .callout a, .contact-note a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}
.faq-a a:hover, .prose a:hover, .callout a:hover, .contact-note a:hover { color: var(--blue); }


/* ── Campo select nei form ── */
.form-field select {
  -webkit-appearance: none;
  appearance: none;
  background-color: var(--steel);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a8fa6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  border: 1px solid rgba(26,110,189,0.3);
  border-radius: 6px;
  padding: 11px 38px 11px 14px;
  color: var(--light);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-field select option { color: initial; }
.form-field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,110,189,0.15);
}

/* ── Campi guidati (form referenza) ── */
.field-hint {
  color: var(--gray);
  font-size: 0.8rem;
  line-height: 1.55;
  margin-top: -2px;
}
.radio-group { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--steel);
  border: 1px solid rgba(26,110,189,0.3);
  border-radius: 6px;
  padding: 11px 14px;
  cursor: pointer;
  color: var(--light);
  font-size: 0.88rem;
  line-height: 1.5;
  transition: border-color 0.2s, background-color 0.2s;
}
.radio-option:hover { border-color: var(--blue); }
.radio-option input {
  margin: 3px 0 0;
  accent-color: var(--blue);
  flex-shrink: 0;
  cursor: pointer;
}
.radio-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(240,165,0,0.07);
}
.form-intro {
  color: var(--gray);
  font-size: 0.86rem;
  line-height: 1.65;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(26,110,189,0.2);
  margin-bottom: 4px;
}


/* ============================================================
   RIFINITURE MOBILE (iOS Safari compreso)
   ============================================================ */
@media (max-width: 768px) {
  /* sotto i 16px iOS ingrandisce la pagina al tocco sul campo */
  .form-field input,
  .form-field textarea,
  .form-field select { font-size: 16px; }

  .hero-stats { gap: 26px 32px; margin-top: 44px; }
  .stat .num { font-size: 2rem; }

  .callout { padding: 18px 18px; font-size: 0.94rem; }
  .contact-note { padding: 22px 20px; }
  .testimonial-card { padding: 26px 20px; }
  .cert-col { padding: 22px 20px; }
  .service-card { padding: 24px 20px; }
  .feature-item { padding: 16px 16px; }
  .page-cta { padding: 30px 20px; }

  #lang-toggle { right: 14px; }
  .btn { padding: 13px 24px; }
}

@media (max-width: 400px) {
  .cta-group { gap: 12px; }
  .cta-group .btn { width: 100%; text-align: center; }
  .hero-stats { gap: 22px 26px; }
}


/* ============================================================
   CONTENIMENTO ORIZZONTALE (WebKit/Safari)
   Safari non restringe select e campi sotto la loro larghezza
   minima intrinseca: senza questi vincoli il form allarga la
   colonna della griglia e il contenuto esce dallo schermo.
   ============================================================ */
.contact-inner > * { min-width: 0; }
.contact-form { min-width: 0; max-width: 100%; }
.form-field { min-width: 0; }
.form-field input:not([type="radio"]):not([type="checkbox"]),
.form-field textarea,
.form-field select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.radio-option input { width: auto; flex: 0 0 auto; }
.radio-option span { min-width: 0; }
.form-field select { text-overflow: ellipsis; }
.radio-option { min-width: 0; }
.feature-item > div,
.highlight-item > div { min-width: 0; }

/* ── Sezione assistenza in home ── */
#assistenza {
  background:
    var(--navy)
    repeating-linear-gradient(45deg, transparent, transparent 40px, rgba(26,110,189,0.045) 40px, rgba(26,110,189,0.045) 80px);
}
.assist-wrap {
  background: var(--steel);
  border: 1px solid rgba(26,110,189,0.22);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 30px 32px;
  max-width: 900px;
}
.assist-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 12px 28px;
  margin-bottom: 24px;
}
.assist-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--light);
  font-size: 0.93rem;
  line-height: 1.5;
}
.assist-list li .ic { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; }
.assist-list li span { min-width: 0; }
.assist-close {
  color: var(--gray);
  font-size: 0.93rem;
  line-height: 1.65;
  padding-top: 20px;
  border-top: 1px solid rgba(26,110,189,0.2);
  margin-bottom: 22px;
}
@media (max-width: 768px) {
  .assist-wrap { padding: 24px 20px; }
  .assist-list { gap: 12px; }
  .assist-wrap .btn { display: block; text-align: center; }
}

/* ── Riga distintiva nell'hero (subentro su impianti esistenti) ── */
.hero-claim {
  display: inline-block;
  max-width: 700px;
  margin: 0 auto 32px;
  padding: 12px 22px;
  border: 1px solid rgba(240,165,0,0.35);
  border-radius: 8px;
  background: rgba(240,165,0,0.07);
  color: var(--light);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
}
@media (max-width: 768px) {
  .hero-claim { font-size: 0.94rem; padding: 12px 16px; margin-bottom: 26px; }
}

/* ── Case study: problema / intervento / risultato ── */
.case-facts { display: grid; gap: 14px; margin-top: 14px; }
.case-facts b {
  display: block;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.case-facts span {
  display: block;
  color: var(--gray);
  font-size: 0.9rem;
  line-height: 1.65;
}
.case-facts > div:last-child span { color: var(--light); }
@media (max-width: 768px) {
  .case-facts { gap: 12px; }
  .case-facts span { font-size: 0.88rem; }
}

/* ── Barra di navigazione: spazio riservato al selettore lingua/tema ──
   Con dieci voci il menu arrivava sotto il pulsante IT/EN (fisso in alto a destra). */
@media (min-width: 1151px) {
  nav { padding-right: 165px; }
}
@media (min-width: 1151px) and (max-width: 1340px) {
  nav { padding-left: 24px; }
  nav ul { gap: 18px; }
  nav ul a { font-size: 0.79rem; letter-spacing: 0.2px; }
}

/* ── Numeri dell'hero: etichette più lunghe, incolonnate ── */
.stat { max-width: 190px; }
.stat .num { white-space: nowrap; }
.stat .label { line-height: 1.35; }
@media (max-width: 768px) {
  .stat { max-width: 150px; }
  .stat .label { font-size: 0.74rem; letter-spacing: 0.6px; }
}
