/* ==========================================================================
   Rifinitura delle pagine interne
   Stesso linguaggio della home: inchiostro blu-petrolio, verde del marchio,
   superfici morbide, ingressi allo scroll e micro-interazioni.
   Gli ingressi animati partono solo con JavaScript (classe .sp-rise) e
   rispettano «riduci movimento».
   ========================================================================== */
body.content-page {
  --sp-ink: #11303a;
  --sp-accent: #2c7054;
  --sp-accent-soft: #e4efe6;
  --sp-muted: #4f6468;
  --sp-line: #dbe4dd;
  --sp-ease: cubic-bezier(.2, .7, .2, 1);
  --sp-shadow: 0 30px 70px -42px rgba(17, 48, 58, .4), 0 2px 6px rgba(17, 48, 58, .04);
}

/* ---- Tipografia: un unico tono ---------------------------------------- */
.content-page:not(.usecase-page) main :is(h1, h2, h3):not(.content-callout *):not(.art *) { color: var(--sp-ink); }
.content-page:not(.usecase-page) main :is(h1, h2, h3) em:not(.content-callout *):not(.art *) { color: var(--sp-accent); }
.content-page:not(.usecase-page) .seo-hero-copy > p:first-child,
.content-page:not(.usecase-page) .feature-copy > p:first-child {
  color: var(--sp-accent);
  letter-spacing: .16em;
}
.content-page:not(.usecase-page) .seo-hero-copy > p:not(:first-child),
.content-page:not(.usecase-page) .feature-copy > p:not(:first-child),
.content-page:not(.usecase-page) .content-block > p { color: var(--sp-muted); }
.content-page .breadcrumbs a { transition: color .2s ease; }
.content-page .breadcrumbs a:hover { color: var(--sp-accent); }

/* ---- Apertura: il titolo si compone, l'illustrazione entra ------------ */
@media (prefers-reduced-motion: no-preference) {
  .content-page .seo-hero-copy > * { animation: sp-hero-in .9s var(--sp-ease) both; }
  .content-page .seo-hero-copy > :nth-child(2) { animation-delay: .08s; }
  .content-page .seo-hero-copy > :nth-child(3) { animation-delay: .16s; }
  .content-page .seo-hero-copy > :nth-child(4) { animation-delay: .24s; }
  .content-page .seo-hero-copy > :nth-child(n+5) { animation-delay: .32s; }
  .content-page .seo-hero > .art { animation: sp-art-in 1.2s var(--sp-ease) .15s both; }
}
@keyframes sp-hero-in { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes sp-art-in { from { opacity: 0; transform: perspective(1400px) translateY(40px) rotateX(10deg) scale(.96); } to { opacity: 1; transform: none; } }
/* Leggera profondità dell'illustrazione mentre si scorre (site-polish.js). */
.content-page .seo-hero > .art { translate: 0 var(--sp-drift, 0px); }

/* ---- Illustrazioni scure: più profondità ------------------------------ */
.content-page .art {
  box-shadow: 0 60px 110px -60px rgba(10, 31, 34, .75), 0 2px 10px rgba(10, 31, 34, .08);
}

/* ---- Righe testo + illustrazione -------------------------------------- */
.content-page .feature-row .art,
.content-page .feature-row .mini-art {
  transition: transform .6s var(--sp-ease), box-shadow .6s ease;
}
.content-page .feature-row:hover .art,
.content-page .feature-row:hover .mini-art { transform: translateY(-4px); }

/* ---- Schede ----------------------------------------------------------- */
.content-page .content-cards > *,
.content-page .guide-grid > * {
  transition: transform .45s var(--sp-ease), box-shadow .45s ease, border-color .3s ease, background-color .3s ease;
}
.content-page .content-cards > *:hover,
.content-page .guide-grid > *:hover {
  transform: translateY(-5px);
  box-shadow: var(--sp-shadow);
  border-color: #bcd4c4;
}
.content-page .guide-grid > * h3,
.content-page .guide-grid > * strong { transition: color .25s ease; }
.content-page .guide-grid > *:hover h3 { color: var(--sp-accent); }

/* ---- Invito finale scuro ---------------------------------------------- */
.content-page .content-callout,
.content-page .guide-cta {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.content-page .content-callout {
  background:
    radial-gradient(70% 120% at 100% 0%, rgba(84, 168, 128, .26), transparent 60%),
    radial-gradient(60% 100% at 0% 100%, rgba(46, 110, 92, .3), transparent 70%),
    #0a1f22;
  box-shadow: 0 50px 100px -60px rgba(10, 31, 34, .8);
}
.content-page .content-callout::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(80% 90% at 85% 10%, #000, transparent 70%);
  -webkit-mask-image: radial-gradient(80% 90% at 85% 10%, #000, transparent 70%);
}
.content-page .content-callout .text-link span,
.content-page .content-callout a span { display: inline-block; transition: transform .3s var(--sp-ease); }
.content-page .content-callout a:hover span { transform: translate(3px, -3px); }

/* ---- Domande frequenti brevi ------------------------------------------ */
.content-page .mini-faq summary { transition: color .25s ease; }
.content-page .mini-faq summary:hover { color: var(--sp-accent); }
.content-page .mini-faq details[open] > :not(summary) { animation: sp-hero-in .45s var(--sp-ease); }

/* ==========================================================================
   Articoli della guida: lettura comoda
   ========================================================================== */
.sp-progress {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 60;
  height: 3px;
  pointer-events: none;
  background: linear-gradient(90deg, #2c7054, #8cc3a2);
  transform-origin: left;
  transform: scaleX(0);
}
.content-page .guide-body { color: #33494d; }
.content-page .guide-body p,
.content-page .guide-body li { color: #2f4448; }
.content-page .guide-body :is(h2, h3) { scroll-margin-top: 120px; }
.content-page .guide-body a:not(.button) {
  color: var(--sp-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--sp-accent) 40%, transparent);
  transition: text-decoration-color .2s ease;
}
.content-page .guide-body a:not(.button):hover { text-decoration-color: currentColor; }
.content-page .guide-body ::selection,
.content-page .content-body ::selection { background: #cfe6d6; color: var(--sp-ink); }
.content-page .guide-toc a { transition: color .2s ease, transform .3s var(--sp-ease); }
.content-page .guide-toc a:hover { color: var(--sp-accent); }
.content-page .guide-toc a.on { color: var(--sp-accent); transform: translateX(4px); }
.content-page .guide-figure .art { box-shadow: var(--sp-shadow); }

/* ==========================================================================
   Ingressi allo scroll (solo ciò che sta sotto la piega al caricamento)
   ========================================================================== */
.sp-rise {
  opacity: 0;
  translate: 0 30px;
  transition: opacity .8s ease var(--sp-delay, 0s), translate 1s var(--sp-ease) var(--sp-delay, 0s);
}
.sp-rise.sp-in { opacity: 1; translate: 0 0; }
/* Nelle righe, illustrazione e testo arrivano da lati opposti. */
.feature-row > .sp-rise.sp-side { translate: 40px 0; }
.feature-row.flip > .sp-rise.sp-side { translate: -40px 0; }
.feature-row > .sp-rise.sp-side.sp-in { translate: 0 0; }

@media (prefers-reduced-motion: reduce) {
  .sp-rise, .feature-row > .sp-rise.sp-side { opacity: 1; translate: none; transition: none; }
  .content-page .content-cards > *:hover,
  .content-page .guide-grid > *:hover,
  .content-page .feature-row:hover .art,
  .content-page .feature-row:hover .mini-art { transform: none; }
  .content-page .seo-hero > .art { translate: none; }
}

/* ==========================================================================
   Impaginazione
   ========================================================================== */
/* Titoli senza parole orfane, paragrafi senza righe spezzate male. */
.content-page main :is(h1, h2, h3) { text-wrap: balance; }
.content-page main p { text-wrap: pretty; }

/* Sezioni di solo testo: titolo a sinistra, lettura a destra. */
@media (min-width: 1000px) {
  .content-page .content-body > .content-block:has(> h2:first-child):not(.mini-faq):not(:has(.content-cards, .guide-grid, details, ul, ol, .art, figure, table, form)) {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: clamp(40px, 6vw, 96px);
    align-items: start;
  }
  .content-page .content-body > .content-block:has(> h2:first-child):not(.mini-faq):not(:has(.content-cards, .guide-grid, details, ul, ol, .art, figure, table, form)) > h2 {
    grid-column: 1;
    grid-row: 1 / span 20;
    position: sticky;
    top: 130px;
    margin: 0;
  }
  .content-page .content-body > .content-block:has(> h2:first-child):not(.mini-faq):not(:has(.content-cards, .guide-grid, details, ul, ol, .art, figure, table, form)) > :not(h2) {
    grid-column: 2;
    max-width: 640px;
  }
  /* Quattro schede: due righe da due, invece di tre più una sola. */
  .content-page .content-cards:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Schede dei contenuti: bianche, con un filo di colore. */
.content-page .content-cards article {
  position: relative;
  overflow: hidden;
  background: #fff;
  border-color: var(--sp-line);
  box-shadow: 0 20px 44px -36px rgba(17, 48, 58, .45);
}
.content-page .content-cards article::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--sp-accent), transparent 80%);
  opacity: .7;
}
.content-page .content-cards h3 { color: var(--sp-ink); }
.content-page .content-cards p { color: var(--sp-muted); }

/* Indice degli articoli: tre colonne leggibili, tutta la scheda cliccabile. */
@media (min-width: 1100px) {
  .content-page .guide-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
}
.content-page .guide-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border-color: var(--sp-line);
  box-shadow: 0 20px 44px -36px rgba(17, 48, 58, .45);
}
.content-page .guide-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--sp-accent), transparent 80%);
  opacity: 0;
  transition: opacity .3s ease;
}
.content-page .guide-card:hover::before { opacity: .8; }
.content-page .guide-card strong { color: var(--sp-ink); transition: color .25s ease; }
.content-page .guide-card:hover strong { color: var(--sp-accent); }
.content-page .guide-card small { color: var(--sp-accent); }
.content-page .guide-card em { color: var(--sp-accent); font-weight: 600; }
.content-page .guide-chips a { transition: background-color .25s ease, color .25s ease, transform .3s var(--sp-ease); }
.content-page .guide-chips a:hover { background: var(--sp-ink); color: #fff; transform: translateY(-2px); }

/* ==========================================================================
   Pagina 404
   ========================================================================== */
body:has(> .sp-404) { min-height: 100svh; margin: 0; background: #0a1f22; }
.sp-404 {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 80px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  color: #eef5ef;
  background:
    radial-gradient(60% 60% at 50% 110%, rgba(84, 168, 128, .35), transparent 70%),
    radial-gradient(40% 40% at 85% 0%, rgba(46, 110, 92, .3), transparent 70%),
    #0a1f22;
}
.sp-404::before {
  content: '404';
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  transform: translate(-50%, -54%);
  font-size: clamp(200px, 38vw, 520px);
  font-weight: 700;
  letter-spacing: -.07em;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(159, 216, 180, .16);
  pointer-events: none;
}
.sp-404 .eyebrow { color: #9fd8b4 !important; letter-spacing: .2em; }
.content-page .sp-404 h1 { color: #f2f7f2 !important; font-size: clamp(40px, 6vw, 80px); margin: 18px 0 18px; }
.sp-404 > p:not(.eyebrow) { color: rgba(232, 240, 233, .72) !important; font-size: 17px; max-width: 460px; }
.sp-404 .content-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 30px; }
.sp-404 .content-links a {
  padding: 14px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  color: #0b2120;
  background: #9fd8b4;
  border: 0;
  transition: transform .3s var(--sp-ease), background-color .25s ease;
}
.sp-404 .content-links a + a { background: transparent; color: #eef5ef; box-shadow: inset 0 0 0 1px rgba(159, 216, 180, .45); }
.sp-404 .content-links a:hover { transform: translateY(-2px); }

/* ==========================================================================
   Revisione: leggibilità, contrasto e telefoni piccoli
   ========================================================================== */
/* Intestazione: su telefoni stretti logo, «Demo» e menu stanno sempre nello schermo. */
@media (max-width: 400px) {
  .header .nav-wrap { gap: 10px; width: calc(100% - 28px); }
  .header .nav-cta { padding-inline: 14px; gap: 8px; }
  .header .nav-cta span { display: none; }
  .header .brand { gap: 7px; }
}
/* Testi secondari: stesso tono, contrasto almeno 4,5:1. */
.breadcrumbs, .breadcrumbs a, .breadcrumbs li,
.guide-meta, .guide-toc > span, figcaption, .guide-sources > h2,
.form-head > p, .form-note, .privacy-note,
.email-contact > small, .email-contact > p, #catalogue-count,
.module-order, .boundary-number, .ai-disclosure > p, #chat-coverage, .role-choice-hint,
.ease-slide-copy > span, .ease-slide-copy > p, .ease-cinema-heading > p,
.visual-label, .search-result > span, .wizard-person small, .wizard-person em,
.faq-list details > p, .seo-hero-copy > p:first-child, .voice-hero-copy > .eyebrow, .science-grid article > span {
  color: #4b5f63 !important;
}
/* Mai testi sotto gli 11 px; note legali a 12. */
.module-order, .boundary-number, .ease-slide-copy > span, .visual-label,
.search-result > span, .wizard-person small, .wizard-person em, #chat-coverage {
  font-size: 11px !important;
}
.form-head > p, .form-note, .privacy-note, .ai-disclosure > p { font-size: 12px !important; }
/* Aree toccabili di almeno 44 px su touch, senza cambiare l'aspetto. */
@media (pointer: coarse) {
  .text-link, .studio-footer__email, .case-breadcrumb, .contact-privacy-link, .breadcrumbs a {
    display: inline-flex; align-items: center; min-height: 44px;
  }
  .contact-privacy input[type="checkbox"] { width: 22px; height: 22px; }
}
.help-visual > .visual-label { color: #a9c9b4 !important; }
.science-note { color: #4b5f63 !important; }
