/* ================================================================
   1. Design tokens e fondazioni
   ================================================================ */
:root {
  --color-text: #f4f1e8;
  --color-muted: #b4b1a8;
  --color-bg: #0d0f12;
  --color-surface: #16191f;
  --color-surface-alt: #20242b;
  --color-brand: #39d6c8;
  --color-brand-deep: #0f8f86;
  --color-accent: #ffb15c;
  --color-accent-deep: #d46f30;
  --color-success: #65d88f;
  --color-border: rgba(244, 241, 232, 0.14);
  --shadow-soft: 0 24px 70px rgba(0, 0, 0, 0.34);
  --radius-sm: 0.55rem;
  --radius-md: 0.8rem;
  --radius-lg: 1.1rem;
  --radius-pill: 999px;
  --space-xxs: 0.35rem;
  --space-xs: 0.65rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --container: min(1140px, 92vw);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
  color: var(--color-text);
  background:
    url('../img/ai-network-pattern.svg') center 5rem / 1200px 900px repeat-y,
    radial-gradient(circle at 78% 6%, rgba(57, 214, 200, 0.14) 0%, transparent 31rem),
    radial-gradient(circle at 7% 28%, rgba(255, 177, 92, 0.1) 0%, transparent 27rem),
    radial-gradient(circle at 82% 72%, rgba(15, 143, 134, 0.1) 0%, transparent 32rem),
    linear-gradient(145deg, #0b0d10 0%, #15181d 46%, #0d1114 100%);
  background-color: var(--color-bg);
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

@media (max-width: 760px) {
  body {
    background:
      url('../img/ai-network-pattern.svg') center 4rem / 760px 570px repeat-y,
      radial-gradient(circle at 88% 8%, rgba(57, 214, 200, 0.12) 0%, transparent 21rem),
      radial-gradient(circle at 4% 34%, rgba(255, 177, 92, 0.08) 0%, transparent 18rem),
      linear-gradient(150deg, #0b0d10 0%, #14171c 52%, #0d1114 100%);
    background-color: var(--color-bg);
  }
}

body.nav-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-brand);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover,
a:focus-visible {
  color: #7bf1e7;
}

h1,
h2,
h3,
h4 {
  font-family: inherit;
  letter-spacing: 0;
  line-height: 1.15;
  margin-top: 0;
  color: var(--color-text);
}

h1 {
  font-size: 3.3rem;
  margin-bottom: var(--space-sm);
}

h2 {
  font-size: 2.15rem;
  margin-bottom: var(--space-sm);
}

h3 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

p {
  margin-top: 0;
  margin-bottom: var(--space-sm);
}

ul {
  padding-left: 1.15rem;
}

main {
  min-height: 60vh;
}

section {
  padding-block: var(--space-xl);
}

.container {
  width: var(--container);
  margin-inline: auto;
}

.stack > * + * {
  margin-top: var(--space-sm);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-text);
  color: #111;
  padding: 0.5rem 0.75rem;
  border-radius: 0.4rem;
  border: 2px solid #000;
}

.skip-link:focus {
  left: 1rem;
  z-index: 10000;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ================================================================
   2. Azioni, etichette e utility condivise
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  padding: 0.8rem 1.35rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-brand) 0%, #7bf1e7 100%);
  color: #08100f;
  box-shadow: 0 12px 28px rgba(57, 214, 200, 0.22);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  color: #08100f;
  background: linear-gradient(135deg, #71f2e6 0%, #a5fff6 100%);
}

.btn-secondary {
  background: rgba(244, 241, 232, 0.06);
  border-color: rgba(244, 241, 232, 0.2);
  color: var(--color-text);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: rgba(244, 241, 232, 0.12);
}

.text-link {
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.text-link::after {
  content: '\2192';
  transition: transform 160ms ease;
}

.text-link:hover::after,
.text-link:focus-visible::after {
  transform: translateX(3px);
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  font-size: 0.76rem;
  color: var(--color-accent);
  margin-bottom: 0.55rem;
}

.section-head {
  max-width: 75ch;
  margin-bottom: var(--space-lg);
}

.section-head p:last-child {
  color: var(--color-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.7rem;
  background: rgba(255, 177, 92, 0.16);
  color: #ffd6a3;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.badge-quiet {
  background: rgba(57, 214, 200, 0.12);
  color: #9df6ef;
}

.section-offset-sm {
  margin-top: 1.2rem;
}

.card-accent-top {
  border-top: 4px solid var(--color-brand);
}

/* ================================================================
   3. Header e navigazione
   ================================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(13, 15, 18, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(244, 241, 232, 0.12);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 5.35rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-text);
  min-width: 0;
}

.brand-logo {
  width: 58px;
  height: auto;
  object-fit: contain;
}

.brand-name {
  font-weight: 800;
  font-size: 1.08rem;
  line-height: 1;
  color: var(--color-text);
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-mark {
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  color: #0d0f12;
  background: linear-gradient(145deg, var(--color-brand), var(--color-accent));
  border-radius: 0.55rem;
  padding: 0.45rem 0.6rem;
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.site-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.05rem;
}

.nav-link {
  text-decoration: none;
  color: rgba(244, 241, 232, 0.78);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  padding: 0.5rem 0.05rem;
  border-bottom: 2px solid transparent;
  transition: color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.nav-link.is-active,
.nav-link:hover,
.nav-link:focus-visible {
  border-color: var(--color-accent);
  color: var(--color-text);
}

.nav-link:hover {
  opacity: 1;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 0.6rem;
  background: rgba(244, 241, 232, 0.08);
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

@media (min-width: 1041px) {
  .site-header .container {
    width: min(1320px, 96vw);
  }

  .brand {
    flex: 0 0 auto;
  }

  .site-nav {
    flex: 1 1 auto;
    justify-content: flex-end;
  }

  .site-nav ul {
    justify-content: flex-end;
  }

  .site-nav > .btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding-inline: 1.15rem;
  }
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--color-text);
  display: block;
  transition: transform 170ms ease, opacity 170ms ease;
}

.menu-toggle.is-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ================================================================
   4. Hero e strutture di pagina
   ================================================================ */
.hero {
  position: relative;
  overflow: clip;
  padding-top: clamp(4.5rem, 8vw, 7.5rem);
  min-height: 84vh;
  display: grid;
  align-items: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.32;
  filter: saturate(0.9) contrast(1.08);
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

.hero::before {
  inset: 0;
  background:
    linear-gradient(180deg, rgba(13, 15, 18, 0) 0%, rgba(13, 15, 18, 0.9) 100%),
    radial-gradient(circle at 20% 26%, rgba(255, 177, 92, 0.2) 0%, transparent 34%),
    radial-gradient(circle at 84% 22%, rgba(57, 214, 200, 0.2) 0%, transparent 35%);
}

.hero::after {
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 177, 92, 0.55), rgba(57, 214, 200, 0.45), transparent);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: minmax(0, 0.98fr) minmax(280px, 0.55fr);
  align-items: center;
}

.hero-copy p {
  color: var(--color-muted);
  max-width: 64ch;
}

.hero-copy {
  max-width: 44rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.hero-visual {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035)),
    linear-gradient(150deg, rgba(57, 214, 200, 0.22), rgba(255, 177, 92, 0.1));
  border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 3.5vw, 2rem);
  box-shadow: var(--shadow-soft);
  color: #fff;
  position: relative;
  border: 1px solid rgba(244, 241, 232, 0.16);
  overflow: hidden;
}

.hero-visual::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(244, 241, 232, 0.22);
  border-radius: calc(var(--radius-lg) - 0.45rem);
}

.hero-visual::after {
  content: '';
  position: absolute;
  inset: auto -12% -28% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 177, 92, 0.18) 0%, rgba(255, 177, 92, 0) 72%);
  pointer-events: none;
}

.hero-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-sm);
}

.hero-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-xs);
  align-items: start;
  font-weight: 600;
}

.hero-list li::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 22px rgba(255, 177, 92, 0.6);
  margin-top: 0.45rem;
}

/* ================================================================
   5. Griglie, card e componenti commerciali
   ================================================================ */
.surface {
  background: rgba(244, 241, 232, 0.045);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.panel {
  padding: clamp(1rem, 2vw, 1.8rem);
}

.grid {
  display: grid;
  gap: var(--space-md);
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  background:
    linear-gradient(180deg, rgba(244, 241, 232, 0.075), rgba(244, 241, 232, 0.04)),
    var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.22);
  height: 100%;
  overflow: hidden;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(57, 214, 200, 0.26);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.card p {
  color: var(--color-muted);
}

.card-media {
  width: calc(100% + 2.4rem);
  max-width: none;
  height: 150px;
  object-fit: cover;
  margin: -1.2rem -1.2rem 1rem;
  border-bottom: 1px solid var(--color-border);
  filter: saturate(0.95) contrast(1.04);
}

.card ul {
  color: rgba(244, 241, 232, 0.86);
  margin-top: 0;
  margin-bottom: var(--space-sm);
}

.service-card h3,
.ai-card h3,
.blog-card h3,
.case-study-card h3 {
  margin-top: 0.55rem;
}

.case-study-card {
  border: 1px solid rgba(57, 214, 200, 0.28);
  background: linear-gradient(160deg, rgba(57, 214, 200, 0.12), rgba(255, 177, 92, 0.06)), var(--color-surface);
}

.cta-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-md);
  align-items: center;
  padding: clamp(1.2rem, 3vw, 2rem);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(57, 214, 200, 0.2), rgba(255, 177, 92, 0.15)),
    #12161a;
  color: #fff;
  border: 1px solid rgba(244, 241, 232, 0.16);
  box-shadow: var(--shadow-soft);
}

.cta-panel h2,
.cta-panel p {
  color: #fff;
}

.cta-actions {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.cta-panel .btn-primary {
  background: var(--color-text);
  color: #101214;
}

.cta-panel .btn-secondary {
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  background: transparent;
}

.cta-panel .btn-secondary:hover,
.cta-panel .btn-secondary:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.breadcrumbs {
  margin-top: 1.15rem;
}

.breadcrumbs ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}

.breadcrumbs li {
  color: var(--color-muted);
}

.breadcrumbs li + li::before {
  content: '/';
  margin-right: 0.3rem;
  color: rgba(244, 241, 232, 0.35);
}

.highlight-box {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 177, 92, 0.26);
  background: linear-gradient(145deg, rgba(255, 177, 92, 0.13), rgba(57, 214, 200, 0.08)), var(--color-surface);
  padding: 1.2rem;
}

.number-steps {
  counter-reset: flow;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.number-steps li {
  counter-increment: flow;
  background: rgba(244, 241, 232, 0.055);
  border: 1px solid var(--color-border);
  border-radius: 0.8rem;
  padding: 0.8rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-xs);
}

.number-steps li::before {
  content: counter(flow);
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #111;
  background: var(--color-brand);
}

.list-columns {
  columns: 2;
  column-gap: 1.2rem;
}

.list-columns li {
  break-inside: avoid;
  margin-bottom: 0.4rem;
}

.pricing-card {
  border-top: 4px solid var(--color-accent);
}

/* ================================================================
   6. Form e contatti
   ================================================================ */
.contact-wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: var(--space-md);
  align-items: start;
}

.form-note {
  border-left: 4px solid var(--color-accent);
  padding-left: 0.75rem;
  color: var(--color-muted);
}

.contact-form {
  background:
    linear-gradient(180deg, rgba(244, 241, 232, 0.08), rgba(244, 241, 232, 0.035)),
    var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.form-field {
  display: grid;
  gap: 0.32rem;
}

.form-field-full {
  grid-column: 1 / -1;
}

.contact-form label {
  font-weight: 700;
  font-size: 0.9rem;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  border: 1px solid rgba(244, 241, 232, 0.18);
  border-radius: 0.65rem;
  padding: 0.72rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--color-text);
  background: rgba(13, 15, 18, 0.72);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(244, 241, 232, 0.45);
}

.contact-form textarea {
  resize: vertical;
}

.contact-form input:focus-visible,
.contact-form select:focus-visible,
.contact-form textarea:focus-visible,
.menu-toggle:focus-visible,
.btn:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(255, 177, 92, 0.48);
  outline-offset: 1px;
}

.checkbox-field {
  grid-template-columns: auto 1fr;
  align-items: start;
}

.checkbox-field input {
  width: auto;
  margin-top: 0.2rem;
}

.form-status {
  margin-top: 0.6rem;
  color: var(--color-success);
  font-weight: 700;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 360ms ease, transform 360ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================================
   7. Pagine editoriali, articoli e FAQ
   ================================================================ */
.page-hero {
  padding-bottom: var(--space-lg);
}

.page-hero p {
  max-width: 76ch;
  color: var(--color-muted);
}

.article-cover {
  width: 100%;
  height: auto;
  display: block;
}

.article-shell {
  display: grid;
  gap: var(--space-md);
  max-width: min(1040px, 92vw);
  margin-inline: auto;
}

.article-panel {
  padding: clamp(1.1rem, 2.3vw, 2rem);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.38rem 0.72rem;
  border-radius: var(--radius-pill);
  background: rgba(244, 241, 232, 0.06);
  border: 1px solid var(--color-border);
  color: rgba(244, 241, 232, 0.88);
  font-size: 0.82rem;
  font-weight: 700;
}

.article-lead {
  font-size: 1.08rem;
  color: rgba(244, 241, 232, 0.9);
}

.article-content {
  display: grid;
  gap: 0.95rem;
}

.article-content > * {
  margin: 0;
}

.article-content h2,
.article-content h3 {
  margin-top: 0.5rem;
}

.article-content p,
.article-content li {
  color: rgba(244, 241, 232, 0.9);
}

.article-content ul,
.article-content ol {
  margin: 0;
  padding-left: 1.2rem;
}

.article-note {
  padding: 0.95rem 1rem;
  border-left: 4px solid var(--color-brand);
  border-radius: 0.8rem;
  background: rgba(57, 214, 200, 0.08);
}

.article-related {
  display: grid;
  gap: 0.85rem;
}

.article-related a {
  text-decoration: none;
}

.article-related strong {
  display: block;
  color: var(--color-text);
  margin-bottom: 0.2rem;
}

.article-related span {
  color: var(--color-muted);
  font-size: 0.94rem;
}

.muted-block {
  color: var(--color-muted);
  max-width: 70ch;
}

.service-groups article + article {
  margin-top: var(--space-md);
}

.service-groups ul {
  columns: 2;
  column-gap: 1.2rem;
}

.service-groups li {
  break-inside: avoid;
  margin-bottom: 0.35rem;
}

.blog-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-md);
}

.category-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.category-pill-list span {
  border-radius: var(--radius-pill);
  padding: 0.33rem 0.65rem;
  border: 1px solid var(--color-border);
  background: rgba(244, 241, 232, 0.06);
  font-size: 0.84rem;
}

.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: 0.85rem;
  background: rgba(244, 241, 232, 0.055);
  padding: 0.7rem 0.8rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
}

/* ================================================================
   8. Footer e consenso cookie
   ================================================================ */
.site-footer {
  margin-top: var(--space-xl);
  padding-top: clamp(2.75rem, 6vw, var(--space-xl));
  background:
    radial-gradient(circle at 12% 0%, rgba(57, 214, 200, 0.07), transparent 32rem),
    #090a0c;
  color: #e9f1fc;
  border-top: 1px solid rgba(244, 241, 232, 0.12);
}

.footer-grid > section {
  min-width: 0;
  padding-block: 0;
}

.site-footer h2 {
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.3;
  margin-bottom: 0.7rem;
}

.site-footer p,
.site-footer li,
.site-footer a {
  color: rgba(244, 241, 232, 0.72);
  margin-bottom: 0.35rem;
  text-decoration: none;
}

.site-footer p,
.site-footer li,
.site-footer a,
.footer-contact {
  font-size: 0.88rem;
  line-height: 1.55;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: #fff;
  text-decoration: underline;
}

.cookie-banner {
  position: fixed;
  z-index: 1400;
  inset: auto 1rem 1rem;
  max-width: 1120px;
  width: calc(100% - 2rem);
  display: grid;
  gap: 0.95rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid rgba(244, 241, 232, 0.2);
  border-radius: 0.9rem;
  background: rgba(12, 15, 20, 0.97);
  backdrop-filter: blur(6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.cookie-banner::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--color-brand), var(--color-accent));
}

.cookie-banner p {
  margin: 0;
  color: var(--color-muted);
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.cookie-banner .btn {
  font-size: 0.88rem;
  padding: 0.62rem 1.1rem;
}

.cookie-banner .btn-secondary {
  border-color: rgba(244, 241, 232, 0.36);
}

.cookie-banner .btn-secondary:hover,
.cookie-banner .btn-secondary:focus-visible {
  background: rgba(244, 241, 232, 0.16);
}

.footer-grid {
  display: grid;
  gap: clamp(2rem, 5vw, var(--space-lg));
  grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 0.85fr));
}

.footer-grid ul {
  display: grid;
  gap: 0.08rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-company-name {
  color: rgba(244, 241, 232, 0.9) !important;
  font-weight: 600;
}

.footer-contact {
  display: grid;
  justify-items: start;
  gap: 0.16rem;
  color: rgba(244, 241, 232, 0.72);
  font-style: normal;
}

.footer-meta > h2:nth-of-type(2) {
  margin-top: 1.25rem;
}

.footer-social-links {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.42rem !important;
}

.footer-social-links a {
  min-height: 2rem;
  padding: 0.28rem 0.62rem;
  border: 1px solid rgba(244, 241, 232, 0.15);
  border-radius: var(--radius-pill);
  background: rgba(244, 241, 232, 0.045);
  font-size: 0.78rem;
}

.footer-social-links a:hover,
.footer-social-links a:focus-visible {
  border-color: rgba(57, 214, 200, 0.48);
  background: rgba(57, 214, 200, 0.1);
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid rgba(244, 241, 232, 0.14);
  padding-block: var(--space-sm) var(--space-lg);
  margin-top: var(--space-lg);
}

.footer-bottom p {
  margin: 0;
  font-size: 0.85rem;
}

/* ================================================================
   9. Chatbot pubblico
   ================================================================ */
.chatbot-widget {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1300;
  width: min(500px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  display: flex;
  flex-direction: column;
  min-height: 0;
  transition: width 180ms ease;
}

.chatbot-widget[data-lead-form="open"] {
  width: min(580px, calc(100vw - 2rem));
}

.chatbot-toggle {
  display: flex;
  flex: 0 0 auto;
  align-self: flex-end;
  width: auto;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.62rem 0.82rem;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  color: #051515;
  background: linear-gradient(135deg, #39d6c8 0%, #8bf5ec 100%);
  box-shadow: 0 14px 36px rgba(11, 44, 42, 0.45);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
}

.chatbot-toggle-icon {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(5, 21, 21, 0.12);
}

.chatbot-widget[data-open="true"] .chatbot-toggle {
  display: none;
}

.chatbot-widget[data-open="true"] .chatbot-panel {
  margin-top: 0;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  height: min(740px, calc(100vh - 2rem));
  height: min(740px, calc(100dvh - 2rem));
}

.chatbot-toggle:hover,
.chatbot-toggle:focus-visible {
  transform: translateY(-2px);
}

.chatbot-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 5.5rem);
  max-height: calc(100dvh - 5.5rem);
  height: min(680px, calc(100vh - 5.5rem));
  height: min(680px, calc(100dvh - 5.5rem));
  margin-top: 0.7rem;
  border: 1px solid rgba(244, 241, 232, 0.2);
  border-radius: 1rem;
  overflow: hidden;
  background: rgba(10, 12, 15, 0.98);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.52);
}

.chatbot-panel[hidden] {
  display: none;
}

.chatbot-header {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.95rem;
  border-bottom: 1px solid rgba(244, 241, 232, 0.12);
  background: linear-gradient(90deg, rgba(57, 214, 200, 0.2), rgba(255, 177, 92, 0.1));
}

.chatbot-header h2 {
  margin: 0;
  font-size: 1rem;
  color: #f7fbfd;
}

.chatbot-header p {
  margin: 0.1rem 0 0;
  color: rgba(244, 241, 232, 0.68);
  font-size: 0.76rem;
}

.chatbot-close {
  flex: 0 0 32px;
  border: 1px solid rgba(244, 241, 232, 0.2);
  background: rgba(15, 18, 22, 0.7);
  color: #f4f1e8;
  border-radius: 0.55rem;
  width: 32px;
  height: 32px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.chatbot-body {
  flex: 1 1 auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.chatbot-messages {
  min-height: 120px;
  height: auto;
  max-height: none;
  flex: 1 1 auto;
  overflow-y: auto;
  display: grid;
  gap: 0.62rem;
  padding-right: 0.15rem;
}

.chatbot-message {
  border-radius: 0.75rem;
  padding: 0.6rem 0.72rem;
  border: 1px solid rgba(244, 241, 232, 0.1);
}

.chatbot-message-assistant {
  background: rgba(57, 214, 200, 0.1);
}

.chatbot-message-user {
  background: rgba(255, 177, 92, 0.12);
}

.chatbot-message-label {
  margin: 0 0 0.2rem;
  font-size: 0.73rem;
  font-weight: 800;
  color: rgba(244, 241, 232, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chatbot-message-text {
  margin: 0;
  color: #f4f1e8;
  font-size: 0.94rem;
  line-height: 1.46;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chatbot-quick-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.1rem;
}

.chatbot-quick-actions button {
  flex: 0 0 auto;
  border: 1px solid rgba(57, 214, 200, 0.3);
  border-radius: 999px;
  padding: 0.42rem 0.68rem;
  background: rgba(57, 214, 200, 0.08);
  color: #e9fffd;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.chatbot-quick-actions button:hover,
.chatbot-quick-actions button:focus-visible {
  background: rgba(57, 214, 200, 0.18);
}

.chatbot-quick-actions button.is-suggested {
  border-color: #ffb15c;
  background: rgba(255, 177, 92, 0.16);
  color: #fff4e8;
}

.chatbot-input-form,
.chatbot-lead-form {
  display: grid;
  gap: 0.55rem;
}

.chatbot-input-form {
  flex: 0 0 auto;
}

.chatbot-input-form textarea,
.chatbot-lead-form input,
.chatbot-lead-form select,
.chatbot-lead-form textarea {
  width: 100%;
  border: 1px solid rgba(244, 241, 232, 0.2);
  background: rgba(5, 7, 9, 0.72);
  color: #f4f1e8;
  border-radius: 0.62rem;
  padding: 0.6rem 0.7rem;
  font-family: inherit;
  font-size: 0.92rem;
}

.chatbot-input-form textarea {
  min-height: 42px;
  max-height: 96px;
  resize: none;
}

.chatbot-composer {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  padding: 0.35rem;
  border: 1px solid rgba(244, 241, 232, 0.18);
  border-radius: 0.8rem;
  background: rgba(5, 7, 9, 0.72);
}

.chatbot-composer textarea {
  border: 0;
  background: transparent;
  padding: 0.45rem;
}

.chatbot-composer textarea:focus {
  outline: none;
}

.chatbot-send {
  flex: 0 0 auto;
  border: 0;
  border-radius: 0.55rem;
  padding: 0.62rem 0.72rem;
  background: #39d6c8;
  color: #051515;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.chatbot-lead-form .btn {
  font-size: 0.9rem;
  padding: 0.58rem 1rem;
}

.chatbot-status,
.chatbot-lead-status {
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-muted);
}

.chatbot-lead-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  border-top: 1px solid rgba(244, 241, 232, 0.1);
  padding: 0.75rem;
  border-radius: 0.8rem;
  background: rgba(244, 241, 232, 0.04);
}

.chatbot-widget[data-lead-form="open"] .chatbot-messages,
.chatbot-widget[data-lead-form="open"] .chatbot-quick-actions,
.chatbot-widget[data-lead-form="open"] .chatbot-input-form {
  display: none;
}

.chatbot-lead-form h3 {
  margin: 0;
  font-size: 0.94rem;
}

.chatbot-lead-form > p {
  margin: -0.2rem 0 0.25rem;
  color: rgba(244, 241, 232, 0.68);
  font-size: 0.78rem;
  line-height: 1.4;
}

.chatbot-lead-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.chatbot-lead-cancel {
  border: 0;
  background: transparent;
  color: #f4f1e8;
  font-size: 1.2rem;
  cursor: pointer;
}

.chatbot-optional {
  color: rgba(244, 241, 232, 0.55);
  font-size: 0.72rem;
}

.chatbot-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.chatbot-widget[data-lead-form="open"] .chatbot-form-grid {
  gap: 0.75rem;
}

.chatbot-widget[data-lead-form="open"] .chatbot-lead-form {
  padding: 1rem;
}

.chatbot-form-grid label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: rgba(244, 241, 232, 0.9);
}

.chatbot-full {
  grid-column: 1 / -1;
}

.chatbot-privacy {
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: flex-start;
}

.chatbot-privacy input {
  width: auto;
  margin-top: 0.2rem;
}

.chatbot-privacy span {
  font-size: 0.8rem;
  line-height: 1.45;
}

.chatbot-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

/* ================================================================
   10. Adattamento responsive
   ================================================================ */
@media (max-width: 1040px) {
  .header-inner {
    min-height: 4.6rem;
  }

  .site-nav {
    position: fixed;
    inset: 4.9rem 1rem auto;
    width: calc(100% - 2rem);
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    background: rgba(22, 25, 31, 0.98);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    padding: 1rem;
    box-shadow: var(--shadow-soft);
    flex-direction: column;
    align-items: flex-start;
    transform: translateY(-16px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
  }

  .site-nav ul {
    flex-direction: column;
    width: 100%;
    gap: 0.25rem;
  }

  .nav-link {
    display: block;
    padding: 0.8rem 0;
  }

  .site-nav .btn {
    width: 100%;
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .hero-grid,
  .grid-4,
  .grid-3,
  .blog-layout,
  .footer-grid,
  .contact-wrap,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .cta-panel {
    grid-template-columns: 1fr;
  }

  .cta-actions {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(1140px, calc(100vw - 1.5rem));
  }

  .section-head {
    margin-bottom: 1.35rem;
  }

  h1 {
    font-size: clamp(2rem, 9vw, 2.6rem);
    line-height: 1.06;
  }

  h2 {
    font-size: clamp(1.5rem, 7vw, 1.85rem);
  }

  h3 {
    font-size: 1.2rem;
  }

  section {
    padding-block: 2.75rem;
  }

  p,
  li,
  input,
  select,
  textarea {
    font-size: 0.98rem;
  }

  .hero {
    padding-top: 2.9rem;
    padding-bottom: 2.5rem;
    min-height: auto;
  }

  .hero-bg {
    opacity: 0.22;
  }

  .hero-grid {
    gap: 1.25rem;
  }

  .hero-copy p {
    max-width: none;
  }

  .hero-copy .kicker {
    margin-bottom: 0.7rem;
  }

  .hero-actions,
  .cta-actions,
  .cookie-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn,
  .cta-actions .btn,
  .cookie-actions .btn {
    width: 100%;
  }

  .hero-visual {
    padding: 1rem;
  }

  .hero-visual::before {
    inset: 8px;
  }

  .hero-list {
    gap: 0.85rem;
  }

  .hero-list li {
    font-size: 0.98rem;
    line-height: 1.45;
  }

  .card,
  .contact-form,
  .highlight-box,
  .cta-panel {
    padding: 1rem;
  }

  .card-media {
    width: calc(100% + 2rem);
    height: 172px;
    margin: -1rem -1rem 0.95rem;
  }

  .badge {
    font-size: 0.7rem;
  }

  .service-groups ul,
  .list-columns {
    columns: 1;
  }

  .contact-form {
    grid-template-columns: 1fr;
  }

  .contact-wrap {
    gap: 1rem;
  }

  .article-panel {
    padding: 1rem;
  }

  .article-lead {
    font-size: 1rem;
  }

  .checkbox-field {
    gap: 0.6rem;
  }

  .checkbox-field input {
    margin-top: 0.28rem;
  }

  .cookie-banner {
    inset: auto 0.75rem 0.75rem;
    width: calc(100% - 1.5rem);
    padding: 0.9rem;
    border-radius: 0.85rem;
  }

  .cookie-banner p {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .chatbot-widget {
    right: 0.75rem;
    bottom: 0.75rem;
    width: calc(100vw - 1.5rem);
    max-height: calc(100vh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
  }

  .chatbot-widget[data-lead-form="open"] {
    width: calc(100vw - 1.5rem);
  }

  .chatbot-panel {
    max-height: calc(100vh - 5rem);
    max-height: calc(100dvh - 5rem);
    height: calc(100vh - 5rem);
    height: calc(100dvh - 5rem);
  }

  .chatbot-form-grid {
    grid-template-columns: 1fr;
  }

  .chatbot-messages {
    min-height: 120px;
    height: auto;
    max-height: none;
  }

  .brand-logo {
    width: 44px;
  }

  .brand-name {
    font-size: 0.92rem;
    white-space: normal;
    line-height: 1.05;
  }

  .nav-link {
    padding: 0.65rem 0;
  }

  .menu-toggle {
    width: 42px;
    height: 42px;
  }

  .breadcrumbs ol {
    gap: 0.15rem;
    font-size: 0.84rem;
  }

  .site-footer {
    margin-top: 3rem;
    padding-top: 2.1rem;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.65rem 1rem;
  }

  .footer-company {
    grid-column: 1 / -1;
    padding-bottom: 1.4rem !important;
    border-bottom: 1px solid rgba(244, 241, 232, 0.11);
  }

  .site-footer h2 {
    margin-bottom: 0.5rem;
    font-size: 0.88rem;
  }

  .site-footer p,
  .site-footer li,
  .site-footer a,
  .footer-contact {
    font-size: 0.82rem;
  }

  .site-footer a {
    min-height: 2rem;
  }

  .footer-bottom {
    margin-top: 1.6rem;
    padding-top: 1rem;
    padding-bottom: max(4.75rem, calc(1.25rem + env(safe-area-inset-bottom)));
  }

  .footer-bottom p {
    max-width: 42rem;
    font-size: 0.72rem;
    line-height: 1.5;
  }
}

@media (max-width: 420px) {
  .container {
    width: calc(100vw - 1.1rem);
  }

  section {
    padding-block: 2.35rem;
  }

  h1 {
    font-size: 1.82rem;
  }

  h2 {
    font-size: 1.42rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.35rem;
  }

  .footer-company {
    grid-column: auto;
  }

  .footer-grid > section {
    padding-block: 0;
  }

  .footer-nav ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.12rem 0.65rem;
  }

  .footer-nav a {
    align-items: flex-start;
    line-height: 1.35;
  }

  .footer-meta > h2:nth-of-type(2) {
    margin-top: 1rem;
  }

  .footer-policy-links {
    display: flex !important;
    flex-wrap: wrap;
    gap: 0.3rem 0.85rem !important;
  }

  .header-inner {
    gap: 0.85rem;
  }

  .brand {
    gap: 0.55rem;
  }

  .brand-name {
    font-size: 0.86rem;
  }

  .hero {
    padding-top: 2.4rem;
  }

  .hero-visual,
  .card,
  .contact-form,
  .highlight-box,
  .cta-panel,
  .cookie-banner {
    padding: 0.88rem;
  }

  .card-media {
    width: calc(100% + 1.76rem);
    height: 158px;
    margin: -0.88rem -0.88rem 0.9rem;
  }

  .site-nav {
    inset: 4.5rem 0.55rem auto;
    width: calc(100% - 1.1rem);
    max-height: calc(100vh - 5.4rem);
    padding: 0.9rem;
  }

  .cookie-banner {
    inset: auto 0.55rem 0.55rem;
    width: calc(100% - 1.1rem);
  }

  .chatbot-widget {
    right: 0.55rem;
    bottom: 0.55rem;
    width: calc(100vw - 1.1rem);
    max-height: calc(100vh - 1.1rem);
    max-height: calc(100dvh - 1.1rem);
  }

  .chatbot-widget[data-lead-form="open"] {
    width: calc(100vw - 1.1rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
