/* ============================================================
   ATR Sistemi — pagine servizio
   Layout condiviso; la palette cambia con la classe sul <body>
   ============================================================ */

:root {
  --font: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Archivo", "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --maxw: 1120px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;
}

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

body {
  font-family: var(--font);
  /* asse wdth di Archivo (display): 105% lo squadra e lo irrobustisce
     appena. Hanken Grotesk non ha l'asse, quindi ignora il valore. */
  font-stretch: 105%;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

a {
  color: inherit;
}

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

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Top bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}
.back:hover {
  color: var(--accent);
}
.back svg {
  width: 16px;
  height: 16px;
}

.topbar__brand {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.topbar__brand b {
  color: var(--text);
}

/* ---- Hero ---- */
.hero {
  position: relative;
  padding: clamp(64px, 12vw, 130px) 0 clamp(48px, 8vw, 90px);
  overflow: hidden;
  background: var(--hero-bg, transparent);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-glow, none);
  opacity: 0.9;
  pointer-events: none;
}

.hero__inner {
  position: relative;
}

/* lockup di brand: logo del prodotto + nota "distribuito da ATR Sistemi".
   Non è più l'<h1> (che ora è testo reale, vedi sotto). */
.hero__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.hero__logo {
  height: clamp(24px, 3.2vw, 32px);
  width: auto;
  object-fit: contain;
  object-position: left center;
}
.hero__brand-note {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

/* eyebrow = tassonomia: label uppercase + trattino rosso. NON più un chip a
   sfondo pieno (era il tell "hero-eyebrow-chip" del detector). */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.eyebrow__tick {
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  flex: none;
}

/* H1 testuale (prima era solo il logo immagine): headline editoriale forte,
   display Archivo, tracking negativo. */
.hero h1,
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5.2vw, 3.8rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--heading, var(--text));
  max-width: 20ch;
}

.hero__lead {
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  font-weight: 500;
  color: var(--muted);
  max-width: 40ch;
  margin-bottom: 18px;
}

.hero__desc {
  font-size: 1.02rem;
  color: var(--muted);
  max-width: 62ch;
  margin-bottom: 34px;
}

/* ---- Bottoni ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.98rem;
  font-weight: 700;
  text-decoration: none;
  padding: 14px 26px;
  border-radius: var(--r-md);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
    background 0.2s var(--ease);
}

/* ombra NEUTRA (DESIGN.md §4: hairline + 1 ombra morbida): il glow colorato
   sotto i bottoni era un tell da template 2018 */
.btn--primary {
  background: var(--accent);
  color: var(--on-accent, #fff);
  box-shadow: 0 1px 2px rgba(20, 18, 16, 0.08), 0 10px 22px -14px rgba(20, 18, 16, 0.4);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(20, 18, 16, 0.08), 0 14px 28px -14px rgba(20, 18, 16, 0.45);
}
.btn svg {
  width: 17px;
  height: 17px;
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.btn--ghost:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* ---- Mock illustrativi ----
   Le card con dati inventati (margine, incassi, scontrino, recensione) stanno in
   un <figure> con la didascalia "Esempio illustrativo" sopra il riquadro:
   micro-label da tassonomia (scala dell'eyebrow, senza pillola né trattino) nel
   --muted di ciascuna palette, che passa AA su tutte. La didascalia sta FUORI
   dal mock: dentro un aria-hidden o un role="img" gli screen reader non la
   leggerebbero. */
.mock-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.mock-figure__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  line-height: 1.3;
  text-align: center;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Sezione feature ---- */
.section {
  padding: clamp(40px, 7vw, 80px) 0;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
  color: var(--heading, var(--text));
}
.section__sub {
  color: var(--muted);
  margin-bottom: 38px;
  font-size: 1.02rem;
}

/* ---- CTA finale ---- */
.cta {
  margin: clamp(30px, 6vw, 70px) auto;
  text-align: center;
  background: var(--cta-bg, var(--surface));
  /* colore solido risolvibile SOTTO il gradient opaco (--cta-bg): invisibile a
     schermo, ma dà all'analizzatore statico un bg scuro reale su cui valutare il
     testo bianco — altrimenti lo shorthand `background` azzera bg-color a
     transparent e il contrasto viene calcolato sul bg pagina chiaro (falso
     low-contrast). Stessa tecnica di .hero/.cm-hero__screen. */
  background-color: var(--cta-solid, #17171a);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(38px, 6vw, 64px) 24px;
}
.cta h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.4vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
  color: var(--cta-text, var(--heading, var(--text)));
}
.cta p {
  color: var(--cta-muted, var(--muted));
  margin-bottom: 28px;
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
}

/* CTA senza titolo né testo: resta solo il bottone, quindi il blocco si
   stringe in verticale invece di lasciare un riquadro mezzo vuoto. */
.cta--bare {
  padding-block: clamp(26px, 4vw, 40px);
}

/* ---- Footer ---- */
.foot {
  border-top: 1px solid var(--line);
  padding: 30px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
}
/* dati societari: obbligo di legge, quindi su ogni pagina — sottotono
   rispetto alla riga di attribuzione sopra. L'attenuazione sta sui soli
   link: sulla riga dei dati, con un'opacità di 0,72 il contrasto del testo
   scendeva sotto AA. */
.foot__legal {
  display: block;
  margin-top: 8px;
  font-size: 0.78rem;
}
.foot__legal a {
  opacity: 0.72;
}
/* la riga dei dati societari è lunga: sta su un rigo suo, a capo bilanciato
   (senza una sola parola sull'ultimo rigo); i link Privacy e Cookie policy
   le restano subito sotto. */
.foot__company {
  display: block;
  text-wrap: balance;
}
.foot__legal > .foot__company {
  margin-bottom: 4px;
}
.foot a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* ============================================================
   PALETTE PER SERVIZIO
   ============================================================ */

/* Tomato AI — palette chiara fedele al sito ufficiale (tomatoai.it):
   rosso e verde del logo, testo grigio-antracite #343840, sfondo bianco */
body.svc-tomato {
  --bg: #ffffff;
  --surface: #ffffff;
  --line: #e7e7e5;
  --text: #343840;
  --heading: #20232a;
  --muted: #5f6567;
  --accent: #ca2324;
  --accent2: #1e9638;
  --on-accent: #ffffff;
  --hero-glow: radial-gradient(
    900px 420px at 70% -10%,
    rgba(202, 35, 36, 0.09),
    transparent 60%
  );
  --cta-bg: linear-gradient(135deg, #ca2324, #931a1b);
  --cta-text: #fff;
  --cta-muted: rgba(255, 255, 255, 0.85);
}

/* Plateform — SaaS blu navy + CTA corallo, tocco giallo (fedele al sito ufficiale) */
body.svc-plateform {
  --bg: #f7f9ff;
  --surface: #ffffff;
  --line: #e3e8f5;
  --text: #16233a;
  --heading: #1d334e;
  --muted: #5b6a85;
  --accent: #ff575a;
  --accent2: #ffc556;
  --navy: #1d334e;
  --on-accent: #ffffff;
  --hero-glow: radial-gradient(
    820px 420px at 78% -12%,
    rgba(255, 87, 90, 0.14),
    transparent 60%
  );
  --cta-bg: linear-gradient(135deg, #ff575a, #d43d47);
  --cta-text: #fff;
  --cta-muted: rgba(255, 255, 255, 0.88);
}

/* iPratico — Apple-clean, bianco/nero, accento arancio (logo ufficiale) */
body.svc-ipratico {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --line: #e6e6ea;
  --text: #1d1d1f;
  --heading: #1d1d1f;
  --muted: #6e6e73;
  --accent: #faa019;
  --on-accent: #1d1d1f;
  --hero-glow: radial-gradient(
    820px 420px at 75% -12%,
    rgba(250, 160, 25, 0.14),
    transparent 60%
  );
  --cta-bg: #1d1d1f;
  --cta-text: #fff;
  --cta-muted: rgba(255, 255, 255, 0.82);
}

/* Cashmatic — blu navy corporate (fedele al logo ufficiale); hero scura, corpo chiaro */
body.svc-cashmatic {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --line: #dde5f0;
  --text: #0f1f3d;
  --heading: #0c1a33;
  --muted: #4f6079;
  --accent: #3c57a1;
  --on-accent: #ffffff;
  --hero-bg: linear-gradient(180deg, #0c1a33 0%, #1c3f7a 100%);
  --cta-bg: linear-gradient(135deg, #3c57a1, #0c1a33);
  --cta-text: #fff;
  --cta-muted: rgba(255, 255, 255, 0.85);
}
/* testi chiari sopra la hero scura. background-color SOLIDO oltre al gradient
   (--hero-bg): sotto il gradient opaco è invisibile, ma dà un colore di sfondo
   risolvibile — così il contrasto del testo chiaro è valutato sul navy scuro,
   non sul bg pagina chiaro (fix falsi low-contrast del detector). */
body.svc-cashmatic .hero {
  color: #fff;
  background-color: #0c1a33;
}
body.svc-cashmatic .hero .eyebrow {
  color: #9ec1ff; /* azzurro chiaro su hero navy scuro — AA */
}
body.svc-cashmatic .hero h1 {
  color: #fff;
}
body.svc-cashmatic .hero__lead,
body.svc-cashmatic .hero__desc {
  color: rgba(234, 240, 251, 0.86);
}

/* Dojo — dark tech fintech: petrolio scuro + corallo + menta (fedele a dojo.genialead.it) */
body.svc-dojo {
  --bg: #ffffff;
  --surface: #ffffff;
  --line: #e1e1d9;
  --text: #16211e;
  --heading: #06211b;
  --muted: #4c5b56;
  --accent: #ff8066;
  --accent2: #a4f4e5;
  --dark: #003f33;
  --on-accent: #06211b;
  --hero-bg: linear-gradient(180deg, #003f33 0%, #0a5344 100%);
  --cta-bg: linear-gradient(135deg, #ff8066, #e05c40);
  --cta-text: #fff;
  --cta-muted: rgba(255, 255, 255, 0.88);
}
/* testi chiari sopra la hero scura (vedi nota Cashmatic: background-color
   solido per far valutare il contrasto sul petrolio scuro, non sul bg pagina). */
body.svc-dojo .hero {
  color: #fff;
  background-color: #003f33;
}
body.svc-dojo .hero .eyebrow {
  color: #a4f4e5; /* menta chiara su hero petrolio scuro — AA */
}
body.svc-dojo .hero h1 {
  color: #fff;
}
body.svc-dojo .hero__lead,
body.svc-dojo .hero__desc {
  color: rgba(233, 247, 242, 0.86);
}

/* ---- Lockup di brand su hero SCURE (Cashmatic, Dojo) ----
   Il logo del prodotto è scuro: su hero navy/petrolio sparirebbe (era il
   difetto "logo invisibile" dell'audit). Lo poggiamo su un chip bianco; la
   nota "ATR" diventa chiara. */
body.svc-cashmatic .hero__logo,
body.svc-dojo .hero__logo {
  background: #fff;
  padding: 7px 11px;
  border-radius: var(--r-sm);
  box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.55);
}
body.svc-cashmatic .hero__brand-note,
body.svc-dojo .hero__brand-note {
  color: rgba(255, 255, 255, 0.72);
}
/* ghost button dentro le hero SCURE: l'accento di brand (navy/petrolio) come
   testo+bordo su fondo scuro falliva AA (~2:1, quasi invisibile). Qui testo e
   bordo diventano chiari. */
body.svc-cashmatic .hero .btn--ghost,
body.svc-dojo .hero .btn--ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}
body.svc-cashmatic .hero .btn--ghost:hover,
body.svc-dojo .hero .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}
/* primaria dentro le hero SCURE: l'accento di brand (navy/petrolio) come fill
   sparirebbe sul fondo scuro (primario navy su hero navy). Diventa un bottone
   BIANCO pieno con testo scuro: spicca come primaria, il ghost resta outline. */
body.svc-cashmatic .hero .btn--primary,
body.svc-dojo .hero .btn--primary {
  background: #fff;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.45);
}
body.svc-cashmatic .hero .btn--primary {
  color: #0c1a33;
}
body.svc-dojo .hero .btn--primary {
  color: #04352b;
}
body.svc-cashmatic .hero .btn--primary:hover,
body.svc-dojo .hero .btn--primary:hover {
  background: #eef1f6;
  transform: translateY(-2px);
}

/* Supporto iPad — accessorio ATR (no brand terzo): palette pulita Apple-clean
   con accento rosso ATR, coerente col resto della scena hero. */
body.svc-supporto-ipad {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --line: #e6e6ea;
  --text: #1d1d1f;
  --heading: #1d1d1f;
  --muted: #6e6e73;
  --accent: #e2231a;
  --on-accent: #ffffff;
  --hero-glow: radial-gradient(
    820px 420px at 75% -12%,
    rgba(226, 35, 26, 0.12),
    transparent 60%
  );
  --cta-bg: #1d1d1f;
  --cta-text: #fff;
  --cta-muted: rgba(255, 255, 255, 0.82);
}

/* ---- responsive ---- */
@media (max-width: 600px) {
  .topbar__brand {
    display: none;
  }
}
