/* ==========================================================================
   ESSE I — sito pubblico, v3 "Corporate tech" in versione scura parziale
   Struttura della proposta A; fasce scure per header, hero, prodotti e footer,
   fasce chiare per servizi, clienti e news. Riferimenti al logo: il cerchio
   (punto della i) e il triangolo (payoff "IT SOLUTIONS ▲ CONSULTING").
   ========================================================================== */

/* Montserrat ExtraBold (OFL), solo per le sigle dei prodotti: equivalente libero del Gotham usato nei loghi.
   Sottoinsieme ASCII, ~11 KB, caricato solo dove compaiono i cerchi dei prodotti. */
@font-face { font-family: "Montserrat Badge"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/montserrat-badge-800.woff2") format("woff2"); unicode-range: U+0020-007E; }

:root {
  /* fondi scuri */
  --night: #0f1e28;        /* fondo scuro principale */
  --night-2: #152a37;      /* superfici sul fondo scuro (schede) */
  --night-line: #2a4354;   /* bordi sul fondo scuro */
  --on-night: #eef3f7;     /* testo su scuro */
  --on-night-muted: #a9bccb;/* testo secondario su scuro (8:1) */

  /* colori del logo */
  --sky: #3a9fdf;          /* azzurro logo: forme, e testo su fondo scuro (5,5:1) */
  --sky-text: #1a6fa6;     /* azzurro per testo su bianco (5,4:1) */
  --ink: #231f20;          /* nero logo */

  /* fondi chiari */
  --paper: #ffffff;
  --mist: #f3f6f8;
  --line: #e1e7ec;
  --text: #13232e;         /* testo principale su chiaro */
  --text-muted: #4b5b67;   /* testo secondario su chiaro (7:1) */
  --danger: #b3261e;       /* errori dei moduli */
  --input-border: #8a99a5;
  color-scheme: light dark;

  --font: Arial, "Helvetica Neue", Helvetica, "Liberation Sans", sans-serif; /* il font che il sito attuale mostra davvero */
  --font-badge: "Montserrat Badge", Arial, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.4rem;
  --step-3: clamp(1.75rem, 1.4rem + 1.3vw, 2.5rem);
  --step-4: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);

  --max: 75rem;
  --gutter: clamp(1.25rem, 0.8rem + 2vw, 2rem);
  --section: clamp(4rem, 3rem + 4vw, 6.5rem);
  --radius: 1.25rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font-family: var(--font); font-size: var(--step-0); line-height: 1.65; color: var(--text); background: var(--paper); }
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { line-height: 1.18; font-weight: 700; letter-spacing: -0.01em; }

a { color: var(--sky-text); text-underline-offset: 0.2em; }
a:hover { color: var(--text); }
:focus-visible { outline: 3px solid var(--sky-text); outline-offset: 3px; border-radius: 4px; }
.dark :focus-visible { outline-color: var(--sky); }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--sky); color: var(--night); padding: 0.75rem 1.25rem; border-radius: 999px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 1rem; color: var(--night); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* fasce scure */
.dark { background: var(--night); color: var(--on-night); }
.dark a { color: var(--sky); }
.dark a:hover { color: var(--on-night); }

/* ---------- etichetta di sezione: triangolo del payoff + testo normale ---------- */
.kicker { display: inline-flex; align-items: center; gap: 0.55rem; font-size: var(--step--1); font-weight: 600; color: var(--sky-text); }
.kicker::before { content: ""; width: 0.7rem; height: 0.6rem; background: var(--sky); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.dark .kicker { color: var(--sky); }

.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; flex-wrap: wrap; }
.section-head h2 { margin-top: 0.6rem; font-size: var(--step-3); }
.section-head p { margin-top: 0.75rem; color: var(--text-muted); max-width: 52ch; }
.dark .section-head p { color: var(--on-night-muted); }

/* link "vedi tutti": triangolo orientato a destra */
.more { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; text-decoration: none; }
.more::after { content: ""; width: 0.5rem; height: 0.55rem; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.more:hover { text-decoration: underline; }

/* ---------- pulsanti a pillola (come il punto del logo) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0.75rem 1.6rem; border-radius: 999px; font: inherit; font-weight: 600; text-decoration: none; border: 2px solid transparent; }
.btn-primary { background: var(--sky); color: var(--night); }
.dark .btn-primary { color: var(--night); }
.btn-primary:hover, .dark .btn-primary:hover { background: #ffffff; color: var(--night); }
.btn-outline { border-color: var(--on-night-muted); color: var(--on-night); }
.dark .btn-outline { color: var(--on-night); }
.btn-outline:hover, .dark .btn-outline:hover { border-color: var(--on-night); background: rgba(255, 255, 255, 0.06); color: var(--on-night); }
.btn-dark { background: var(--night); color: var(--on-night); }
.btn-dark:hover { background: var(--sky-text); color: #fff; }

/* ==========================================================================
   Header (scuro)
   ========================================================================== */
.site-header { position: relative; z-index: 10; border-bottom: 1px solid var(--night-line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 5rem; }
.brand img { width: 8.5rem; }
.nav-main ul { display: flex; gap: 1.75rem; }
.nav-main a { color: var(--on-night); text-decoration: none; font-weight: 500; padding-block: 0.5rem; }
.nav-main a:hover { color: var(--sky); }
.header-tools { display: flex; align-items: center; gap: 1rem; }
.lang-switch { font-weight: 600; text-decoration: none; padding: 0.5rem; }
.dark .lang-switch { color: var(--on-night-muted); }
.header-tools .btn { min-height: 2.6rem; padding: 0.5rem 1.25rem; }

.nav-mobile { display: none; }
.nav-mobile summary { list-style: none; cursor: pointer; min-height: 2.75rem; display: flex; align-items: center; padding: 0 1.1rem; border: 2px solid var(--on-night-muted); border-radius: 999px; font-weight: 600; }
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--night); border-bottom: 1px solid var(--night-line); }
.nav-mobile ul { padding: 0.5rem var(--gutter) 1.5rem; }
.nav-mobile a { display: block; padding: 0.85rem 0; border-bottom: 1px solid var(--night-line); font-size: var(--step-1); font-weight: 600; text-decoration: none; }
.dark .nav-mobile a { color: var(--on-night); }
@media (max-width: 62rem) { .nav-main, .header-tools .btn { display: none; } .nav-mobile { display: block; } }

/* ==========================================================================
   Hero (scuro): testo a sinistra, composizione cerchio + triangolo a destra
   ========================================================================== */
.hero { position: relative; overflow: hidden; isolation: isolate; padding-block: clamp(4rem, 2.5rem + 6vw, 8.5rem); min-height: clamp(30rem, 60vh, 40rem); display: flex; align-items: center; }
/* sfondo di riserva se JavaScript non c'è: un leggero bagliore azzurro a destra */
.hero { background: radial-gradient(60rem 30rem at 85% 40%, rgba(58, 159, 223, 0.14), transparent 70%), var(--night); }
.hero-waves { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; display: block; }
.hero .wrap { width: 100%; }
.hero h1 { margin-top: 1rem; font-size: var(--step-4); max-width: 18ch; }
.hero-lead { margin-top: 1.5rem; font-size: var(--step-1); color: var(--on-night-muted); max-width: 46ch; }
.hero-actions { margin-top: 2.25rem; display: flex; flex-wrap: wrap; gap: 1rem; }
.hero-pause {
  /* in basso a sinistra, allineato al testo: in basso a destra c'è il pulsante della chat ESSEBOT */
  position: absolute; left: calc(max(0px, (100% - var(--max)) / 2) + var(--gutter)); bottom: 1.25rem; z-index: 1;
  min-height: 2.25rem; padding: 0.35rem 0.9rem; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 0.8125rem; font-weight: 500;
  color: var(--on-night-muted); background: rgba(15, 30, 40, 0.7); border: 1px solid var(--night-line);
}
.hero-pause:hover { color: var(--on-night); border-color: var(--on-night-muted); }
@media (max-width: 52rem) {
  .hero { min-height: 0; }
  .hero-pause { position: static; align-self: flex-start; margin: 2rem var(--gutter) 0; }
  /* spazio riservato anche prima che lo script mostri il pulsante: nessuno spostamento del layout */
  .hero-pause[hidden] { display: block; visibility: hidden; }
  .hero { flex-direction: column; align-items: stretch; }
}

/* ---------- certificazioni (chiaro, subito sotto l'hero) ---------- */
.trust-bar { background: var(--mist); border-bottom: 1px solid var(--line); }
.trust-bar .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); align-items: center; gap: 1.25rem 2.5rem; padding-block: 1.75rem; }
.trust-item { display: flex; align-items: center; gap: 1rem; }
.trust-item .disc { flex: none; width: 3.25rem; height: 3.25rem; border-radius: 50%; display: grid; place-items: center; background: var(--night); color: #fff; font-weight: 700; font-size: 0.8rem; }
.trust-item .disc.sky { background: var(--sky); color: var(--night); }
.trust-item strong { display: block; font-weight: 600; }
.badge-iso { flex: none; width: 4rem; height: 4rem; }
.badge-iubenda { flex: none; display: block; border-radius: 0.5rem; }
.badge-iubenda img { width: 9.5625rem; height: auto; }
.trust-item span { display: block; color: var(--text-muted); font-size: var(--step--1); }
.trust-bar a { font-weight: 600; }

/* ==========================================================================
   Servizi (chiaro): griglia di schede come nella proposta A
   ========================================================================== */
.services { padding-block: var(--section); }
.service-grid { margin-top: 3rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 1.25rem; }
.service-card {
  position: relative; display: flex; flex-direction: column; gap: 0.9rem; height: 100%;
  padding: 2rem; border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); text-decoration: none; background: var(--paper);
}
.service-card svg { width: 2.25rem; height: 2.25rem; color: var(--sky-text); }
.service-card h3 { font-size: var(--step-1); }
.service-card .go { margin-top: auto; color: var(--sky-text); font-weight: 600; font-size: var(--step--1); }
/* il punto del logo compare sulla scheda attiva */
.service-card::after { content: ""; position: absolute; top: 1.25rem; right: 1.25rem; width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--line); }
.service-card:hover { border-color: var(--sky-text); color: var(--text); }
.service-card:hover::after { background: var(--sky); }
.service-card:hover h3 { text-decoration: underline; text-underline-offset: 0.2em; }

/* ==========================================================================
   Prodotti (scuro): griglia che cresce con il numero di prodotti
   ========================================================================== */
.products { padding-block: var(--section); position: relative; overflow: hidden; }
.product-grid { margin-top: 3rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: 1.25rem; }
.product-card { display: flex; flex-direction: column; gap: 0.75rem; height: 100%; padding: 1.75rem; border-radius: var(--radius); background: var(--night-2); border: 1px solid var(--night-line); }
.monogram { display: block; width: 3.25rem; height: 3.25rem; }
.monogram text { fill: #fff; font-family: var(--font-badge); font-weight: 800; font-size: 19px; letter-spacing: -0.03em; }
.product-card .card-title { margin-top: 0.5rem; font-size: var(--step-2); color: #fff; }
.product-card p { color: var(--on-night-muted); font-size: var(--step--1); }
.product-card a { margin-top: auto; padding-top: 0.75rem; font-weight: 600; font-size: var(--step--1); word-break: break-word; }
.products-all { margin-top: 2rem; }
/* cerchio decorativo del logo, fuori campo */
.products::before { content: ""; position: absolute; width: 28rem; height: 28rem; border-radius: 50%; border: 1px solid var(--night-line); right: -10rem; top: -12rem; pointer-events: none; }

/* ==========================================================================
   Clienti (chiaro)
   ========================================================================== */
.clients { padding-block: var(--section); }
.client-grid { margin-top: 2.5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr)); gap: 1rem; }
.client-grid li { display: flex; align-items: center; justify-content: center; height: 6rem; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: 1rem; }
/* loghi a colori, appena attenuati per non fare a gara tra loro; colore pieno al passaggio del mouse */
.client-grid li { background: #ffffff; }
.client-grid img { max-height: 2.4rem; width: auto; object-fit: contain; filter: saturate(0.8); transition: filter 0.2s; }
.client-grid li:hover img { filter: none; }
@media (prefers-reduced-motion: reduce) { .client-grid img { transition: none; } }
.case { margin-top: 2.5rem; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.5rem; align-items: center; padding: 1.5rem 1.75rem; border-radius: var(--radius); background: var(--mist); }
.case .disc { width: 3.25rem; height: 3.25rem; border-radius: 50%; background: var(--sky); display: grid; place-items: center; }
.case .disc::before { content: ""; width: 1rem; height: 0.9rem; background: var(--night); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.case h3 { font-size: var(--step-1); }
.case p { color: var(--text-muted); font-size: var(--step--1); }
@media (max-width: 52rem) { .case { grid-template-columns: minmax(0, 1fr); } .case .disc { display: none; } }

/* ==========================================================================
   News (chiaro, su fondo nebbia)
   ========================================================================== */
.news { padding-block: var(--section); background: var(--mist); }
.news-grid { margin-top: 3rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1.5rem; }
.news-card { display: flex; flex-direction: column; background: var(--paper); border-radius: var(--radius); overflow: hidden; height: 100%; }
.news-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.news-card .body { padding: 1.5rem 1.6rem 1.75rem; display: flex; flex-direction: column; gap: 0.6rem; }
.news-card time { color: var(--text-muted); font-size: var(--step--1); }
.news-card .card-title { font-size: var(--step-1); line-height: 1.35; }
.news-card .card-title a { color: var(--text); text-decoration: none; }
.news-card .card-title a:hover { text-decoration: underline; }

/* ==========================================================================
   Contatto (scuro, fascia finale prima del footer)
   ========================================================================== */
.contact { padding-block: var(--section); position: relative; overflow: hidden; }
.contact .wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 3rem; align-items: center; }
.contact h2 { font-size: var(--step-3); max-width: 20ch; }
.contact p { margin-top: 1rem; color: var(--on-night-muted); max-width: 44ch; }
.contact-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; }
.contact-phone { font-weight: 600; font-size: var(--step-1); text-decoration: none; }
.dark .contact-phone { color: var(--on-night); }
.jobs { padding: 2rem; border-radius: var(--radius); background: var(--night-2); border: 1px solid var(--night-line); }
.jobs h3 { font-size: var(--step-2); color: #fff; }
.jobs ul { margin: 1rem 0 1.5rem; }
.jobs li { padding: 0.6rem 0; border-bottom: 1px solid var(--night-line); color: var(--on-night-muted); }
.contact::after { content: ""; position: absolute; width: 18rem; height: 18rem; border-radius: 50%; background: var(--sky); opacity: 0.12; left: -8rem; bottom: -10rem; pointer-events: none; }
@media (max-width: 52rem) { .contact .wrap { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   Footer (scuro, separato da una linea)
   ========================================================================== */
.site-footer { border-top: 1px solid var(--night-line); padding-block: 3.5rem 2rem; font-size: var(--step--1); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)) minmax(0, 1.6fr); gap: 2rem; }
.footer-grid h2 { font-size: var(--step-0); color: #fff; margin-bottom: 0.75rem; }
.footer-grid ul { display: grid; gap: 0.25rem; }
.footer-grid li a { display: inline-block; padding-block: 0.3rem; } /* area cliccabile ≥ 24 px (WCAG 2.5.8) */
.dark .footer-grid a { color: var(--on-night); text-decoration: none; }
.dark .footer-grid a:hover { color: var(--sky); text-decoration: underline; }
.footer-brand img { width: 8rem; }
.footer-brand p { margin-top: 1rem; color: var(--on-night-muted); line-height: 1.7; }
.footer-legal { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--night-line); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--on-night-muted); }
.footer-legal nav { display: flex; gap: 1.5rem; }
@media (max-width: 64rem) { .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .footer-brand, .footer-newsletter { grid-column: 1 / -1; } }
@media (max-width: 40rem) { .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* ==========================================================================
   Pagine interne: fascia di apertura, percorso, elenchi, articolo, contatti
   ========================================================================== */
.page-header { position: relative; overflow: hidden; padding-block: clamp(2.5rem, 1.8rem + 3vw, 4.5rem) clamp(3rem, 2rem + 3vw, 5rem); }
.page-header::after { content: ""; position: absolute; width: 26rem; height: 26rem; border-radius: 50%; border: 1px solid var(--night-line); right: -9rem; bottom: -15rem; pointer-events: none; }
.page-header h1 { margin-top: 0.9rem; font-size: var(--step-4); max-width: 24ch; }
.page-header .kicker { margin-top: 1.75rem; }
.page-lead { margin-top: 1.25rem; font-size: var(--step-1); color: var(--on-night-muted); max-width: 60ch; }
.page-meta { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; color: var(--on-night-muted); font-size: var(--step--1); }

.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; font-size: var(--step--1); color: var(--on-night-muted); }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; }
.breadcrumbs li + li::before { content: ""; width: 0.4rem; height: 0.45rem; background: var(--night-line); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.breadcrumbs span[aria-current] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
.dark .breadcrumbs a { color: var(--on-night); }

.list-section { padding-block: clamp(2.5rem, 2rem + 2vw, 4rem) var(--section); }
.list-section .news-grid, .list-section .product-grid { margin-top: 0; }
.list-section .news-card { border: 1px solid var(--line); }
.news .list-section, .list-section.news { background: var(--mist); }
.empty { padding: 2rem; border-radius: var(--radius); background: var(--mist); color: var(--text-muted); }
.dark .empty { background: var(--night-2); color: var(--on-night-muted); }
.news-card-placeholder { aspect-ratio: 16 / 9; background: radial-gradient(circle at 80% 30%, rgba(58, 159, 223, 0.35) 0 18%, transparent 19%), var(--night); }

.pager { margin-top: 3rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem 1.5rem; color: var(--text-muted); }
.btn-outline-dark { border-color: var(--text); color: var(--text); }
.btn-outline-dark:hover { background: var(--night); border-color: var(--night); color: var(--on-night); }

.service-list { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr)); }
.service-card.wide { flex-direction: row; align-items: flex-start; gap: 1.25rem; }
.service-card.wide svg { flex: none; margin-top: 0.2rem; }
.service-card.wide h2 { font-size: var(--step-1); }
.service-card.wide p { margin-top: 0.5rem; color: var(--text-muted); font-size: var(--step--1); }
.service-card.wide .go { display: inline-block; margin-top: 0.9rem; }
.service-card.wide:hover h2 { text-decoration: underline; text-underline-offset: 0.2em; }

.job-list { display: grid; gap: 1rem; }
.job-card { padding: 1.75rem 2rem; border: 1px solid var(--line); border-radius: var(--radius); }
.job-card h2 { font-size: var(--step-2); }
.job-card h2 a { color: var(--text); }
.job-card p { margin-top: 0.6rem; color: var(--text-muted); }
.job-meta { font-size: var(--step--1); }
.note { margin-top: 2.5rem; padding: 1.75rem 2rem; border-radius: var(--radius); background: var(--mist); }
.note h2 { font-size: var(--step-1); }
.note p { margin-top: 0.5rem; }

/* articolo: colonna di lettura stretta, immagini e tabelle che non escono dalla pagina */
.article { padding-block: clamp(2.5rem, 2rem + 2vw, 4rem) var(--section); }
.article-wrap > * { max-width: 50rem; } /* colonna di lettura allineata al titolo */
.article-hero { margin: 0 0 2.5rem; }
.article-hero img { width: 100%; border-radius: var(--radius); }
.prose { font-size: 1.0625rem; line-height: 1.75; overflow-wrap: anywhere; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2em; font-size: var(--step-2); }
.prose h3 { margin-top: 1.6em; font-size: var(--step-1); }
.prose h4, .prose h5, .prose h6 { margin-top: 1.4em; font-size: var(--step-0); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 0.4em; }
.prose img { border-radius: 0.75rem; margin-inline: auto; }
.prose blockquote { margin-inline: 0; padding: 0.5em 1.25em; border-left: 4px solid var(--sky); color: var(--text-muted); }
.prose pre { overflow-x: auto; padding: 1em 1.25em; background: var(--mist); border: 1px solid var(--line); border-radius: 0.75rem; font-size: var(--step--1); line-height: 1.5; }
.prose code { font-family: Consolas, "Courier New", monospace; }
.prose figure { margin-inline: 0; }
.prose figcaption { margin-top: 0.5em; font-size: var(--step--1); color: var(--text-muted); }
.table-scroll { overflow-x: auto; }
.prose table { border-collapse: collapse; min-width: 100%; font-size: var(--step--1); }
.prose th, .prose td { border: 1px solid var(--line); padding: 0.5em 0.75em; text-align: left; vertical-align: top; }
.prose iframe, .video iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 0.75rem; }
.ta-center { text-align: center; }
.ta-right { text-align: right; }
.ta-justify { text-align: left; } /* il giustificato peggiora la leggibilità: si tiene allineato a sinistra */
.gallery ul { margin-top: 2.5rem; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 0.75rem; }
.attachment { margin-top: 2rem; }
.cta-band { margin-top: 3rem; padding: 2rem; border-radius: var(--radius); background: var(--mist); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.cta-band p { font-size: var(--step-1); font-weight: 700; max-width: 32ch; }
.related .section-head h2 { margin-top: 0; }

/* contatti */
.contact-page { padding-block: clamp(2.5rem, 2rem + 2vw, 4rem) var(--section); }
.contact-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 3rem; align-items: start; }
@media (max-width: 56rem) { .contact-layout { grid-template-columns: minmax(0, 1fr); } }
.contact-form-wrap h2, .contact-info h2 { font-size: var(--step-2); }
.form-intro { margin-top: 0.5rem; color: var(--text-muted); }
.contact-form { margin-top: 1.75rem; display: grid; gap: 1.25rem; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1.25rem; }
.field { display: grid; gap: 0.4rem; align-content: start; }
.field label { font-weight: 600; }
.req { font-weight: 400; color: var(--text-muted); font-size: var(--step--1); }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--paper);
  padding: 0.75rem 0.9rem; min-height: 3rem; border: 2px solid var(--input-border); border-radius: 0.75rem;
}
.field textarea { resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { border-color: var(--sky-text); outline-offset: 1px; }
.field [aria-invalid="true"], .check [aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: var(--step--1); font-weight: 600; }
.check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.25rem 0.75rem; align-items: start; }
.check input { width: 1.375rem; height: 1.375rem; margin: 0.15rem 0 0; accent-color: var(--sky-text); }
.check .help, .check .field-error { grid-column: 2; }
.check .help { color: var(--text-muted); font-size: var(--step--1); }
.contact-form .btn { justify-self: start; border: 0; cursor: pointer; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-errors { padding: 1.25rem 1.5rem; border: 2px solid var(--danger); border-radius: var(--radius); margin-top: 1.5rem; }
.form-errors h3 { font-size: var(--step-0); }
.form-errors ul { margin-top: 0.5rem; padding-left: 1.2em; list-style: disc; }
.form-errors a { color: var(--danger); font-weight: 600; }
.form-success { padding: 2rem; border-radius: var(--radius); background: var(--mist); border-left: 6px solid var(--sky); }
.form-success p { margin-top: 0.5rem; }
.contact-info { padding: 2rem; border-radius: var(--radius); background: var(--mist); }
.contact-info dl { margin: 1rem 0 0; display: grid; gap: 0.25rem; }
.contact-info dt { margin-top: 0.75rem; font-weight: 700; font-size: var(--step--1); color: var(--text-muted); }
.contact-info dd { margin: 0; }
/* su schermi stretti i cerchi decorativi passerebbero sopra il testo */
@media (max-width: 52rem) { .page-header::after, .products.list-section::before { display: none; } }

/* chi siamo */
.about-intro, .about-why { padding-block: clamp(2.5rem, 2rem + 2vw, 4rem); }
.about-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 3rem; align-items: start; }
@media (max-width: 56rem) { .about-grid { grid-template-columns: minmax(0, 1fr); } }
.about-grid .prose h2 { margin-top: 0; }
.about-facts { display: grid; gap: 1rem; }
.about-facts li { padding: 1.25rem 1.5rem; border-radius: var(--radius); background: var(--mist); display: grid; gap: 0.2rem; }
.about-facts strong { font-size: var(--step-2); color: var(--text); }
.about-facts span { color: var(--text-muted); font-size: var(--step--1); }
.about-method { padding-block: var(--section); background: var(--mist); }
.about-method h2 { margin-top: 0.6rem; font-size: var(--step-3); max-width: 28ch; }
.steps { margin-top: 2.5rem; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); counter-reset: none; }
.steps li { position: relative; padding: 1.75rem; border-radius: var(--radius); background: var(--paper); }
.step-n { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--sky); color: var(--night); font-weight: 700; }
.steps h3 { margin-top: 1rem; font-size: var(--step-1); }
.steps p { margin-top: 0.5rem; color: var(--text-muted); font-size: var(--step--1); }
.tech h2 { font-size: var(--step-1); }
.tech-list { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tech-list li { padding: 0.35rem 0.85rem; border: 1px solid var(--line); border-radius: 999px; font-size: var(--step--1); }

/* clienti */
.client-group + .client-group { margin-top: 3rem; }
.client-group h2 { font-size: var(--step-2); }
.client-group .client-grid { margin-top: 1.25rem; }
.client-name { font-weight: 700; text-align: center; color: var(--text-muted); }
.case-title { font-size: var(--step-1); }
.client-group .client-grid img { max-height: 3.25rem; max-width: 100%; }

/* logo ESSE I a colori sugli spazi chiari */
.brand-logo { display: block; }
.brand-logo img { width: 100%; height: auto; }
.trust-brand { display: flex; align-items: center; }
.trust-brand .brand-logo { width: 10rem; }
.about-side { display: grid; gap: 1.5rem; }
.about-logo { width: 13.75rem; }
.contact-logo { width: 9.5rem; margin-bottom: 1.25rem; }

/* ==========================================================================
   Tema scuro del sistema (telefoni e computer impostati su "scuro").
   Le fasce già scure restano uguali; quelle chiare diventano scure con testi chiari.
   I riquadri dei loghi dei clienti restano bianchi: i loghi sono pensati per il fondo chiaro.
   ========================================================================== */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0a141b;
    --mist: #122230;
    --line: #29404f;
    --text: #e9eff4;
    --text-muted: #b2c2cf;     /* 9:1 sul fondo */
    --sky-text: #6cbdf0;       /* 8:1 sul fondo */
    --danger: #ff8f85;
    --input-border: #6d8090;
  }
  .client-grid li { border-color: transparent; }
  .field input, .field textarea { background: var(--mist); }
  .btn-outline-dark:hover { background: var(--text); border-color: var(--text); color: var(--paper); }
  .news-card-placeholder { background: radial-gradient(circle at 80% 30%, rgba(58, 159, 223, 0.35) 0 18%, transparent 19%), var(--night-2); }
  .prose blockquote { color: var(--text-muted); }
  .badge-iso { background: #ffffff; border-radius: 50%; }
}

/* ---------- integrazioni: newsletter nel footer, badge, preferenze cookie, condivisione ---------- */
.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; }
.wrap.narrow { max-width: 46rem; }
.footer-newsletter p { color: var(--on-night-muted); margin-bottom: 0.75rem; }
.footer-newsletter-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.footer-newsletter-form input { flex: 1 1 12rem; min-height: 3rem; padding: 0.6rem 1rem; border-radius: 999px; border: 1px solid var(--night-line); background: #0b1720; color: var(--on-night); font: inherit; }
.footer-newsletter-form input::placeholder { color: var(--on-night-muted); }
.footer-newsletter-form input:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.footer-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 2rem; margin-top: 2.5rem; }
.footer-badges img { height: 4.5rem; width: auto; }
.footer-badges a { display: inline-block; border-radius: 0.5rem; }
.link-button { background: none; border: 0; padding: 0.3rem 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; min-height: 24px; }
.dark .link-button { color: var(--on-night-muted); }
.dark .link-button:hover { color: var(--sky); }
.footer-legal nav { flex-wrap: wrap; align-items: center; }
.footer-legal nav a { padding-block: 0.3rem; }
.share { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.share h2 { font-size: var(--step-0); margin-bottom: 0.75rem; }
.share ul { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.share a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0.4rem 1.1rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-weight: 600; }
.share a:hover { border-color: currentColor; }
