/* ============================================================
   gbarca 2.0 – Design System
   Palette, typography, layout, components, utilities
   ============================================================ */

/* ── FONT SELF-HOSTED ────────────────────────────────────── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── TOKENS ────────────────────────────────────────────────── */
:root {
  /* Palette brand */
  --navy:       #1B2D6B;
  --navy-dark:  #0a1230;
  --navy-mid:   #152358;
  --accent:     #C2410C;
  --accent-dark:#a33509;

  /* Neutri */
  --dark:       #0F172A;
  --gray-700:   #334155;
  --gray-500:   #64748B;
  --gray-300:   #CBD5E1;
  --gray-200:   #E2E8F0;
  --gray-100:   #F1F5F9;
  --gray-50:    #F8FAFC;
  --white:      #ffffff;

  /* Semantici */
  --success:    #16a34a;
  --danger:     #dc2626;
  --warning:    #d97706;
  --info:       #2563eb;
  --indigo:     #4f46e5;
  --teal:       #0d9488;

  /* Tipografia */
  --font:       'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  /* Layout */
  --container:  1152px;
  --gap:        1.5rem;

  /* Radius */
  --radius-sm:  6px;
  --radius:     12px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-full:9999px;

  /* Ombre */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:     0 4px 16px rgba(0,0,0,.10);
  --shadow-md:  0 6px 24px rgba(0,0,0,.12);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.14);
  --shadow-xl:  0 16px 60px rgba(0,0,0,.18);

  /* Transizioni */
  --t:          200ms ease;
  --t-slow:     350ms ease;

  /* Navbar height */
  --nav-h: 72px;
}

/* ── RESET & BASE ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--dark);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img, video, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--accent-dark); }

ul, ol { list-style: none; }

h1,h2,h3,h4,h5,h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--dark);
}

/* ── SKIP LINK ───────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  background: var(--accent);
  color: var(--white);
  padding: .5rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: top var(--t);
}
.skip-link:focus { top: 1rem; }

/* ── FOCUS VISIBLE ───────────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ── CONTAINER & LAYOUT ──────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ── GRADIENTS ───────────────────────────────────────────── */
.gradient-navy      { background: linear-gradient(135deg, var(--navy) 0%, var(--accent) 100%); }
.gradient-navy-dark { background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy-mid) 100%); }

/* ── EYEBROW / LABEL SOPRA TITOLO ────────────────────────── */
.eyebrow {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .5rem;
}

/* ── SECTION BASE ────────────────────────────────────────── */
.section {
  padding-block: 5rem;
}
.section--gray { background: var(--gray-50); }
.section--dark {
  background: var(--navy-dark);
  color: var(--white);
}
.section--dark h2, .section--dark h3 { color: var(--white); }

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
}
.section-header p {
  max-width: 44rem;
  margin: .75rem auto 0;
  color: var(--gray-500);
}
.section--dark .section-header p { color: var(--gray-300); }

.section-cta {
  text-align: center;
  margin-top: 3rem;
}

/* ── NAVBAR ──────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  transition: background var(--t), box-shadow var(--t);
}

.site-header.scrolled {
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.site-header.scrolled .navbar__link { color: var(--dark); }
.site-header.scrolled .navbar__link:hover { color: var(--accent); }
.site-header.scrolled .lang-switcher__link { color: var(--gray-500); }
.site-header.scrolled .lang-switcher__link.active { color: var(--navy); }
.site-header.scrolled .navbar__toggle-bar { background: var(--dark); }

/* Navbar quando è su sfondo scuro (hero) */
.site-header:not(.scrolled) .navbar__link { color: rgba(255,255,255,.85); }
.site-header:not(.scrolled) .navbar__link:hover { color: var(--white); }
.site-header:not(.scrolled) .lang-switcher__link { color: rgba(255,255,255,.7); }
.site-header:not(.scrolled) .lang-switcher__link.active { color: var(--white); }
.site-header:not(.scrolled) .navbar__toggle-bar { background: var(--white); }

.navbar { height: var(--nav-h); }
.navbar__inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 100%;
}

.navbar__logo { flex-shrink: 0; display: flex; align-items: center; }
.navbar__logo-img { height: 40px; width: auto; display: block; }
/* Il logo segue lo stato della navbar: bianco sopra l'header scuro,
   navy quando la barra diventa chiara scrollando. */
.site-header:not(.scrolled) .navbar__logo-img--dark,
.site-header.scrolled .navbar__logo-img--light { display: none; }

.navbar__menu {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-left: auto;
}

.navbar__nav {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.navbar__link {
  font-size: .9rem;
  font-weight: 500;
  padding: .35rem .65rem;
  border-radius: var(--radius-sm);
  transition: background var(--t), color var(--t);
}
.navbar__link:hover { background: rgba(255,255,255,.1); }
.site-header.scrolled .navbar__link:hover { background: var(--gray-100); }
.navbar__link.active { font-weight: 600; }

/* Accesso al portale clienti: sta fra le azioni e non fra le voci di
   menu, perché non è una pagina del sito e non riguarda chi arriva da
   una ricerca. Più piccolo del resto, per la stessa ragione. */
.navbar__link--riservata {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  white-space: nowrap;
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Language switcher (navbar) */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--gray-500);
}
.lang-switcher span { color: var(--gray-300); }
.lang-switcher__link { transition: color var(--t); }
.lang-switcher__link.active { font-weight: 700; }

/* Mobile toggle */
.navbar__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
  margin-left: auto;
}
.navbar__toggle-bar {
  width: 24px;
  height: 2px;
  border-radius: 2px;
  transition: transform var(--t), opacity var(--t);
}
.navbar__toggle[aria-expanded="true"] .navbar__toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar__toggle[aria-expanded="true"] .navbar__toggle-bar:nth-child(2) { opacity: 0; }
.navbar__toggle[aria-expanded="true"] .navbar__toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1;
  padding: .75rem 1.5rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t), transform var(--t), box-shadow var(--t);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-sm { font-size: .85rem; padding: .5rem 1rem; }
.btn-lg { font-size: 1rem; padding: .875rem 1.875rem; }

.btn-primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--white); box-shadow: 0 4px 20px rgba(194,65,12,.35); }

.btn-accent { background: var(--accent); color: var(--white); border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--white); box-shadow: 0 4px 20px rgba(194,65,12,.35); }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline:hover { background: var(--accent); color: var(--white); }

.btn-ghost {
  background: transparent;
  color: var(--dark);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--gray-100); }

.btn-white {
  background: var(--white);
  color: var(--navy);
  border-color: var(--white);
}
.btn-white:hover { background: var(--gray-100); color: var(--navy-dark); }

.btn-white-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,.6);
}
.btn-white-outline:hover { background: rgba(255,255,255,.1); border-color: var(--white); }

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: var(--nav-h);
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, #1e3a7a 100%);
  z-index: 0;
}
.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 75% 50%, rgba(194,65,12,.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 80%, rgba(11,18,48,.6) 0%, transparent 60%);
}

.hero__container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  padding-block: 5rem;
}

.hero__content { color: var(--white); }

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.9);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .05em;
  padding: .4rem .85rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
}

.hero__title {
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 1.25rem;
  letter-spacing: -.02em;
}

.hero__tagline {
  font-size: 1.125rem;
  color: rgba(255,255,255,.75);
  max-width: 44ch;
  margin-bottom: 2.25rem;
  line-height: 1.6;
}

.hero__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.hero__stats {
  display: flex;
  gap: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.15);
}
.hero__stat {}
.hero__stat-number {
  display: block;
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}
/* Variante testuale: "Da zero", "Gratis" — parole, non cifre, quindi
   corpo più contenuto per non sbilanciare la riga accanto a "8+". */
.hero__stat-number--text {
  font-size: 1.5rem;
  letter-spacing: -.01em;
}
.hero__stat-label {
  font-size: .8rem;
  color: rgba(255,255,255,.6);
  margin-top: .2rem;
}

/* Hero visual card */
.hero__visual {
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero__visual-card {
  position: relative;
  width: 280px;
  height: 280px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.4);
  backdrop-filter: blur(10px);
}
.hero__visual-dot {
  position: absolute;
  border-radius: var(--radius-full);
}
.hero__visual-dot--1 { width: 80px; height: 80px; background: rgba(194,65,12,.3); top: -20px; right: -20px; filter: blur(20px); }
.hero__visual-dot--2 { width: 60px; height: 60px; background: rgba(27,45,107,.6); bottom: 20px; left: -10px; filter: blur(15px); }
.hero__visual-dot--3 { width: 40px; height: 40px; background: rgba(255,255,255,.1); top: 50%; left: 50%; transform: translate(-50%,-50%); filter: blur(8px); }

/* Hero scroll hint */
.hero__scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}
.hero__scroll-hint span {
  display: block;
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,.4));
  margin: 0 auto;
  animation: scrollHint 2s ease-in-out infinite;
}
@keyframes scrollHint {
  0%,100% { transform: scaleY(1); opacity: .7; }
  50%      { transform: scaleY(.6); opacity: .3; }
}

/* ── SERVICES GRID ───────────────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
  cursor: default;
  /* Descrizioni di lunghezza diversa disallineavano i "Scopri il servizio":
     colonna flex + margin-top auto sul link li tiene sulla stessa linea. */
  display: flex;
  flex-direction: column;
}
.service-card > .service-card__link { margin-top: auto; padding-top: .5rem; }
.service-card:hover,
.service-card:focus-within {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--gray-300);
}

.service-card__icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Le icone gb-* sono a due toni: il tratto base è navy e l'accent
     rame resta il dettaglio. La piastrella quindi si tinge di navy,
     non di rame, altrimenti l'accent non stacca più. */
  background: rgba(27,45,107,.07);
  border-radius: var(--radius);
  color: var(--navy);
  margin-bottom: 1.125rem;
  transition: background var(--t);
}
.service-card:hover .service-card__icon,
.service-card:focus-within .service-card__icon { background: rgba(27,45,107,.11); }

.service-card__title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: .5rem;
  color: var(--dark);
}

.service-card__desc {
  font-size: .9rem;
  color: var(--gray-500);
  line-height: 1.55;
  margin-bottom: 1.125rem;
}

.service-card__link {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--accent);
  transition: gap var(--t);
}
.service-card__link:hover { gap: .6rem; }

/* ── ICONE SERVIZI (set gb-*, animate) ────────────────────
   SVG inline prodotto da app/lib/ServiceIcons.php: tratto base in
   currentColor (navy), dettaglio caratterizzante in accent.

   Lo stato a riposo è quello definitivo — icona intera, nessuna
   trasformazione — e ogni keyframe parte e torna all'identità: se
   l'animazione viene tolta a metà (mouse via, .is-inview rimossa) non
   resta mai un tratto a metà o un pezzo fuori posto. Senza CSS, senza
   JS o con prefers-reduced-motion l'icona è comunque completa.

   Si animano su hover/focus-within della card e una volta sola al primo
   ingresso in viewport (.is-inview, aggiunta da main.js: da telefono
   l'hover non esiste). Mai animazioni in loop su una pagina ferma. */
.svc-icon__p {
  transform-box: view-box;
  transform-origin: center;
}
.svc-icon__accent { stroke: var(--accent); }

@keyframes svcDraw {
  from { stroke-dasharray: 1; stroke-dashoffset: 1; }
  92%  { stroke-dasharray: 1; stroke-dashoffset: 0; }
  to   { stroke-dasharray: none; stroke-dashoffset: 0; }
}
@keyframes svcFlow {
  from { stroke-dasharray: .34 .3; stroke-dashoffset: .64; }
  to   { stroke-dasharray: .34 .3; stroke-dashoffset: 0; }
}
@keyframes svcBlink  { 0%,100% { opacity: 1 } 40% { opacity: .2 } }
@keyframes svcGlint  { 0%,100% { opacity: 1 } 35% { opacity: .15 } 70% { opacity: 1 } }
@keyframes svcRise {
  from { transform: translateY(1.6px); opacity: 0 }
  60%  { opacity: 1 }
  to   { transform: translateY(0); opacity: 1 }
}
@keyframes svcSpin    { to { transform: rotate(360deg) } }
@keyframes svcTwinkle {
  0%,100% { transform: scale(1) rotate(0) }
  30%     { transform: scale(1.22) rotate(14deg) }
  65%     { transform: scale(.94) rotate(-6deg) }
}
@keyframes svcPop    { 0%,100% { transform: scale(1) } 45% { transform: scale(1.09) } }
@keyframes svcPulse  { 0%,100% { transform: scale(1); opacity: 1 } 45% { transform: scale(1.2); opacity: .7 } }
@keyframes svcNudgeL { 0%,100% { transform: translateX(0) } 45% { transform: translateX(-1.1px) } }
@keyframes svcNudgeR { 0%,100% { transform: translateX(0) } 45% { transform: translateX(1.1px) } }
@keyframes svcMorphSq { 0%,100% { transform: scale(1) rotate(0) } 50% { transform: scale(.9) rotate(-4deg) } }
@keyframes svcMorphCi { 0%,100% { transform: scale(1) } 50% { transform: scale(1.08) } }

/* Animazioni una tantum: identiche su hover/focus e all'ingresso in
   viewport, quindi lo stesso prefisso di trigger per tutte. */
:is(.service-card:hover, .service-card:focus-within, .svc-icon.is-inview) .svc-icon__draw
  { animation: svcDraw .62s ease-out both }
:is(.service-card:hover, .service-card:focus-within, .svc-icon.is-inview) .svc-icon__draw2
  { animation: svcDraw .28s ease-out .48s both }
:is(.service-card:hover, .service-card:focus-within, .svc-icon.is-inview) .svc-icon__blink
  { animation: svcBlink .5s ease-in-out 2 }
:is(.service-card:hover, .service-card:focus-within, .svc-icon.is-inview) .svc-icon__blink2
  { animation: svcBlink .5s ease-in-out .18s 2 }
:is(.service-card:hover, .service-card:focus-within, .svc-icon.is-inview) .svc-icon__glint
  { animation: svcGlint .9s ease-in-out .1s 2 }
:is(.service-card:hover, .service-card:focus-within, .svc-icon.is-inview) .svc-icon__rise1
  { animation: svcRise .38s ease-out both }
:is(.service-card:hover, .service-card:focus-within, .svc-icon.is-inview) .svc-icon__rise2
  { animation: svcRise .38s ease-out .1s both }
:is(.service-card:hover, .service-card:focus-within, .svc-icon.is-inview) .svc-icon__rise3
  { animation: svcRise .38s ease-out .2s both }
:is(.service-card:hover, .service-card:focus-within, .svc-icon.is-inview) .svc-icon__pop
  { animation: svcPop .55s ease-in-out .12s }
:is(.service-card:hover, .service-card:focus-within, .svc-icon.is-inview) .svc-icon__twinkle
  { animation: svcTwinkle 1.1s ease-in-out 2 }
:is(.service-card:hover, .service-card:focus-within, .svc-icon.is-inview) .svc-icon__hub
  { animation: svcPulse .9s ease-out 2 }
:is(.service-card:hover, .service-card:focus-within, .svc-icon.is-inview) .svc-icon__node-l
  { animation: svcPulse .9s ease-out .12s 2 }
:is(.service-card:hover, .service-card:focus-within, .svc-icon.is-inview) .svc-icon__node-r
  { animation: svcPulse .9s ease-out .24s 2 }
:is(.service-card:hover, .service-card:focus-within, .svc-icon.is-inview) .svc-icon__lens
  { animation: svcPulse 1s ease-out 2 }
:is(.service-card:hover, .service-card:focus-within, .svc-icon.is-inview) .svc-icon__bracket-l
  { animation: svcNudgeL .5s ease-in-out }
:is(.service-card:hover, .service-card:focus-within, .svc-icon.is-inview) .svc-icon__bracket-r
  { animation: svcNudgeR .5s ease-in-out }
:is(.service-card:hover, .service-card:focus-within, .svc-icon.is-inview) .svc-icon__morph-sq
  { animation: svcMorphSq .8s ease-in-out }
:is(.service-card:hover, .service-card:focus-within, .svc-icon.is-inview) .svc-icon__morph-ci
  { animation: svcMorphCi .8s ease-in-out }

/* Ingranaggio e flusso dati girano finché il puntatore resta sulla card;
   all'ingresso in viewport fanno un solo passaggio. L'ordine conta: a
   pari specificità la regola dell'hover deve vincere su .is-inview. */
.svc-icon.is-inview .svc-icon__spin { animation: svcSpin 1.6s cubic-bezier(.42,0,.3,1) }
.svc-icon.is-inview .svc-icon__flow { animation: svcFlow 1.05s linear 2 }
:is(.service-card:hover, .service-card:focus-within) .svc-icon__spin
  { animation: svcSpin 4.2s linear infinite }
:is(.service-card:hover, .service-card:focus-within) .svc-icon__flow
  { animation: svcFlow 1.05s linear infinite }

/* Centri di rotazione, in unità della griglia 24×24. */
.svc-icon[data-icon="gb-automazioni-ai"] .svc-icon__spin { transform-origin: 9.3px 14px }
.svc-icon__twinkle  { transform-origin: 17.6px 7px }
.svc-icon__pop      { transform-origin: 15px 8.875px }
.svc-icon__hub      { transform-origin: 12px 9.9px }
.svc-icon__node-l   { transform-origin: 6.6px 3.7px }
.svc-icon__node-r   { transform-origin: 17.4px 3.7px }
.svc-icon__lens     { transform-origin: 12px 11.75px }
.svc-icon__morph-sq { transform-origin: 7px 7px }
.svc-icon__morph-ci { transform-origin: 16.75px 16.75px }

@media (prefers-reduced-motion: reduce) {
  .svc-icon__p { animation: none !important }
}

/* ── ABOUT SECTION ───────────────────────────────────────── */
.about-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}
.about-split__text h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 800;
  margin-bottom: 1rem;
}
.about-split__text p {
  color: var(--gray-700);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.about-list {
  margin-bottom: 2rem;
}
.about-list li {
  position: relative;
  padding-left: 1.5rem;
  font-size: .9375rem;
  color: var(--gray-700);
  margin-bottom: .5rem;
}
.about-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .55em;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: var(--radius-full);
}

/* About visual floating cards */
.about-visual {
  position: relative;
  height: 340px;
}
.about-visual__card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: .875rem 1.25rem;
  box-shadow: var(--shadow-md);
  font-size: .875rem;
  font-weight: 600;
  color: var(--dark);
  white-space: nowrap;
}
.about-visual__card svg { color: var(--accent); flex-shrink: 0; }
.about-visual__card--1 { top: 40px;  left: 0; }
.about-visual__card--2 { top: 140px; right: 0; }
.about-visual__card--3 { bottom: 30px; left: 20px; }

/* ── PORTFOLIO GRID ──────────────────────────────────────── */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
}

.project-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--t), transform var(--t);
  display: flex;
  flex-direction: column;
}
.project-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }

.project-card__img-wrap {
  position: relative;
  aspect-ratio: 16/9;
  display: block;
  overflow: hidden;
}
.project-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.project-card:hover .project-card__img { transform: scale(1.04); }

.project-card__img-placeholder {
  width: 100%;
  height: 100%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-300);
}

.project-card__badge {
  position: absolute;
  top: .75rem;
  left: .75rem;
  background: var(--navy);
  color: var(--white);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .25rem .65rem;
  border-radius: var(--radius-full);
}

.project-card__body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.project-card__title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: .5rem;
}
.project-card__title a { color: var(--dark); }
.project-card__title a:hover { color: var(--accent); }
.project-card__desc {
  font-size: .9rem;
  color: var(--gray-500);
  line-height: 1.55;
  margin-bottom: 1rem;
  flex: 1;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1.125rem;
}
.tech-tag {
  font-size: .72rem;
  font-weight: 600;
  background: var(--gray-100);
  color: var(--gray-700);
  padding: .2rem .55rem;
  border-radius: var(--radius-sm);
}

.project-card__link {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: auto;
  transition: gap var(--t);
}
.project-card__link:hover { gap: .6rem; }

/* ── CTA BAND ────────────────────────────────────────────── */
.cta-band {
  position: relative;
  padding-block: 5rem;
  overflow: hidden;
  text-align: center;
}
.cta-band__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--navy) 0%, var(--accent) 100%);
  z-index: 0;
}
.cta-band__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 80% at 30% 50%, rgba(255,255,255,.06) 0%, transparent 70%);
}
.cta-band__content {
  position: relative;
  z-index: 1;
  color: var(--white);
}
.cta-band__content h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 1rem;
  letter-spacing: -.02em;
}
.cta-band__content p {
  font-size: 1.125rem;
  color: rgba(255,255,255,.8);
  max-width: 50ch;
  margin: 0 auto 2.25rem;
}

/* ── FAQ ─────────────────────────────────────────────────── */
.faq-list { max-width: 800px; margin-inline: auto; }

.faq-item {
  border-bottom: 1px solid var(--gray-200);
}
.faq-item:first-child { border-top: 1px solid var(--gray-200); }

.faq-item__question { font-size: 1rem; font-weight: 400; }

.faq-item__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 1.25rem 0;
  text-align: left;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark);
  transition: color var(--t);
}
.faq-item__toggle:hover { color: var(--accent); }
.faq-item__toggle[aria-expanded="true"] { color: var(--accent); }

.faq-item__icon {
  flex-shrink: 0;
  transition: transform var(--t);
  color: var(--gray-500);
}
.faq-item__toggle[aria-expanded="true"] .faq-item__icon {
  transform: rotate(180deg);
  color: var(--accent);
}

.faq-item__panel {
  padding-bottom: 1.25rem;
}
.faq-item__panel p {
  color: var(--gray-700);
  line-height: 1.7;
}
.faq-item__panel[hidden] { display: none; }

/* ── CONTACT TEASER ──────────────────────────────────────── */
.contact-teaser { background: var(--white); }
.contact-teaser__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
}
.contact-teaser h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: .5rem;
}
.contact-teaser p { color: var(--gray-500); max-width: 50ch; }
.contact-teaser__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ── PAGE HEADER (inner pages) ────────────────────────────── */
.page-header {
  padding-top: calc(var(--nav-h) + 3rem);
  padding-bottom: 3rem;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
  color: var(--white);
}
.page-header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: .75rem;
  letter-spacing: -.02em;
}
.page-header p {
  font-size: 1.125rem;
  color: rgba(255,255,255,.75);
  max-width: 60ch;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: rgba(255,255,255,.6);
  margin-bottom: 1.25rem;
}
.breadcrumb a { color: rgba(255,255,255,.75); }
.breadcrumb a:hover { color: var(--white); }
.breadcrumb__sep { font-size: .7rem; }

/* 404 error page */
.page-header--error {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
}
.error-page { text-align: center; }
.error-page__code {
  font-size: clamp(6rem, 15vw, 10rem);
  font-weight: 900;
  line-height: 1;
  color: rgba(255,255,255,.12);
  letter-spacing: -.05em;
  margin-bottom: 1rem;
}
.error-page__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--white);
  margin-bottom: .75rem;
}
.error-page__subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,.7);
  margin-bottom: 2rem;
}

/* ── FOOTER ──────────────────────────────────────────────── */
.site-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,.7);
  padding-top: 4rem;
  padding-bottom: 0;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.footer__logo img { margin-bottom: 1rem; }
.footer__tagline { font-size: .9rem; margin-bottom: 1rem; line-height: 1.6; }
.footer__address {
  font-size: .875rem;
  font-style: normal;
  line-height: 1.6;
}
.footer__address a { color: rgba(255,255,255,.6); }
.footer__address a:hover { color: var(--white); }

.footer__heading {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 1.25rem;
}

.footer__list { display: flex; flex-direction: column; gap: .5rem; }
.footer__list a {
  font-size: .9rem;
  color: rgba(255,255,255,.6);
  transition: color var(--t);
}
.footer__list a:hover { color: var(--white); }
.footer__list li { font-size: .9rem; }

.footer__lang-switcher {
  display: flex;
  gap: .75rem;
  margin-top: 1.25rem;
}
.footer__lang-switcher a {
  font-size: .85rem;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  transition: color var(--t);
}
.footer__lang-switcher a:hover,
.footer__lang-switcher a.active { color: var(--white); }

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-block: 1.5rem;
}

.footer__copy { font-size: .85rem; }

.footer__legal {
  display: flex;
  gap: 1.5rem;
}
.footer__legal a {
  font-size: .85rem;
  color: rgba(255,255,255,.5);
  transition: color var(--t);
}
.footer__legal a:hover { color: var(--white); }

/* ── BACK TO TOP ─────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 50;
  width: 44px;
  height: 44px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background var(--t), transform var(--t), opacity var(--t);
  opacity: 0;
  transform: translateY(10px);
}
.back-to-top:not([hidden]) { opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: var(--accent); }
.back-to-top[hidden] { display: none; }

/* ── CARDS GENERICHE ─────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: box-shadow var(--t), transform var(--t);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ── BADGE / TAG ─────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .3rem .7rem;
  border-radius: var(--radius-full);
}
.badge-navy    { background: var(--navy);   color: var(--white); }
.badge-accent  { background: var(--accent); color: var(--white); }
.badge-gray    { background: var(--gray-100); color: var(--gray-700); }
.badge-success { background: #dcfce7; color: var(--success); }
.badge-danger  { background: #fee2e2; color: var(--danger); }

/* ── FORMS ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: .4rem;
}
.form-label .required { color: var(--danger); margin-left: .2rem; }

.form-input,
.form-textarea,
.form-select {
  display: block;
  width: 100%;
  font-family: var(--font);
  font-size: .9375rem;
  color: var(--dark);
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  padding: .6875rem 1rem;
  transition: border-color var(--t), box-shadow var(--t);
  appearance: none;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,45,107,.12);
}
.form-textarea { resize: vertical; min-height: 120px; }

.form-error {
  font-size: .8125rem;
  color: var(--danger);
  margin-top: .35rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}

/* ── UTILITIES ───────────────────────────────────────────── */
.text-center   { text-align: center; }
.text-left     { text-align: left; }
.text-right    { text-align: right; }
.text-accent   { color: var(--accent); }
.text-navy     { color: var(--navy); }
.text-muted    { color: var(--gray-500); }
.text-white    { color: var(--white); }
.text-sm       { font-size: .875rem; }
.text-xs       { font-size: .8rem; }
.font-bold     { font-weight: 700; }
.font-semibold { font-weight: 600; }

.mt-0  { margin-top: 0; }
.mt-1  { margin-top: .5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mt-4  { margin-top: 2rem; }
.mb-0  { margin-bottom: 0; }
.mb-1  { margin-bottom: .5rem; }
.mb-2  { margin-bottom: 1rem; }
.mb-3  { margin-bottom: 1.5rem; }
.mb-4  { margin-bottom: 2rem; }

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

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero__container { grid-template-columns: 1fr; gap: 3rem; }
  .hero__visual { display: none; }
  .hero { min-height: auto; padding-bottom: 4rem; }
  .hero__container { padding-block: 4rem; }

  .about-split { grid-template-columns: 1fr; gap: 3rem; }
  .about-split__visual { display: none; }

  .footer__grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  .footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  :root { --nav-h: 64px; }

  .section { padding-block: 3.5rem; }

  /* Mobile navbar */
  .navbar__toggle { display: flex; }

  .navbar__menu {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    padding: 1.5rem;
    gap: 0;
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }
  .navbar__menu.open { display: flex; }

  .navbar__nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    margin-bottom: 1.5rem;
  }
  .navbar__link {
    color: var(--dark) !important;
    font-size: 1rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--gray-100);
    border-radius: 0;
  }
  .navbar__link:hover { background: transparent; color: var(--accent) !important; }
  .navbar__link.active { color: var(--accent) !important; }

  .navbar__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    width: 100%;
  }
  .lang-switcher { justify-content: flex-start; }
  .lang-switcher__link { color: var(--gray-500) !important; }
  .lang-switcher__link.active { color: var(--navy) !important; }

  .site-header .btn { text-align: center; justify-content: center; }

  /* Hero */
  .hero__stats { gap: 1.5rem; }
  .hero__stat-number { font-size: 1.5rem; }
  .hero__cta { flex-direction: column; }
  .hero__cta .btn { justify-content: center; }

  /* Services */
  .services-grid { grid-template-columns: 1fr; }

  /* Portfolio */
  .portfolio-grid { grid-template-columns: 1fr; }

  /* Contact teaser */
  .contact-teaser__inner { flex-direction: column; gap: 2rem; }
  .contact-teaser__actions { flex-direction: column; width: 100%; }
  .contact-teaser__actions .btn { justify-content: center; }

  /* Footer */
  .footer__grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer__brand { grid-column: auto; }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .footer__legal { flex-direction: column; gap: .5rem; }

  /* Back to top */
  .back-to-top { bottom: 1rem; right: 1rem; }
}

@media (max-width: 480px) {
  .container { padding-inline: 1rem; }
  .hero__title { font-size: 2rem; }
  .btn-lg { font-size: .9375rem; padding: .75rem 1.5rem; }
}

/* ── PAGE HEADER EXTRAS ──────────────────────────────────── */
.page-header__updated {
  font-size: .85rem;
  color: rgba(255,255,255,.5);
  margin-top: .5rem;
}
.page-header__updated time { font-style: normal; }

/* ── SERVICE DETAIL LAYOUT ───────────────────────────────── */
.service-card--lg .service-card__tagline {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .4rem;
}

.services-grid--large {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.servizio-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 3rem;
  align-items: start;
}

.servizio-layout__main h2 {
  font-size: clamp(1.4rem, 3vw, 1.875rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.benefit-list { list-style: none; }
.benefit-list__item {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  padding: .625rem 0;
  font-size: .9375rem;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
}
.benefit-list__item:last-child { border-bottom: none; }
.benefit-list__icon { color: var(--success); flex-shrink: 0; margin-top: .1rem; }

.info-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
}
.info-card__label {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: .25rem;
}
.info-card__value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--navy);
  margin-bottom: .5rem;
}
.info-card__note {
  font-size: .825rem;
  color: var(--gray-500);
  line-height: 1.5;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  padding-top: 1.25rem;
}
.feature-card__dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}
.feature-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .4rem;
}
.feature-card__desc {
  font-size: .875rem;
  color: var(--gray-500);
  line-height: 1.55;
}

/* ── PORTFOLIO FILTER ────────────────────────────────────── */
.portfolio-filter {
  margin-bottom: 2.5rem;
}
.portfolio-filter__inner {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.portfolio-filter__btn {
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 600;
  padding: .4rem 1rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-full);
  background: var(--white);
  color: var(--gray-500);
  cursor: pointer;
  transition: all var(--t);
}
.portfolio-filter__btn:hover,
.portfolio-filter__btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* ── PROJECT DETAIL ──────────────────────────────────────── */
.project-detail { }

.project-detail__cover {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 3rem;
  aspect-ratio: 16/9;
  background: var(--gray-100);
}
.project-detail__cover--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-300);
  min-height: 320px;
}
.project-detail__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-detail__body {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  align-items: start;
}

.project-detail__meta {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  order: 2;
}

.project-meta__item {
  padding: .875rem 0;
  border-bottom: 1px solid var(--gray-200);
}
.project-meta__item:last-child { border-bottom: none; }
.project-meta__label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: .25rem;
}
.project-meta__value {
  font-size: .9rem;
  color: var(--dark);
  font-weight: 500;
}

.project-detail__content { order: 1; }
.project-detail__content h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: .875rem;
  margin-top: 2rem;
  color: var(--dark);
}
.project-detail__content h2:first-child { margin-top: 0; }
.project-detail__content p {
  color: var(--gray-700);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.result-list { list-style: none; }
.result-list__item {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  padding: .5rem 0;
  font-size: .9375rem;
  color: var(--gray-700);
}
.result-list__icon { color: var(--success); flex-shrink: 0; margin-top: .1rem; }

/* ── GALLERIA PROGETTO ────────────────────────────────────── */
/* Le foto extra stanno fuori dalla colonna del testo, a tutta larghezza:
   sono lì per far vedere i dettagli, e in una colonna stretta non si
   vedrebbero. auto-fill con minmax evita che l'ultima riga si stiri. */
.project-gallery { margin-top: 3rem; }
.project-gallery__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 1.25rem;
}
.project-gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  list-style: none;
}
.project-gallery__item {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  background: var(--gray-100);
  cursor: zoom-in;
  transition: box-shadow var(--t), transform var(--t);
}
.project-gallery__item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.project-gallery__item:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.project-gallery__img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
}

/* ── LIGHTBOX ─────────────────────────────────────────────── */
/* Creato da main.js al primo clic. Senza JS le miniature restano link
   al file originale, quindi niente di questo è indispensabile. */
body.has-lightbox { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.lightbox.is-open { display: flex; }
.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 48, .92);
}
.lightbox__stage {
  position: relative;
  max-width: min(1100px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}
.lightbox__img {
  max-width: 100%;
  /* 6rem lasciano fuori la didascalia e il padding dell'overlay:
     senza, su schermi bassi l'immagine spingerebbe fuori il contatore. */
  max-height: calc(100vh - 6rem);
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--navy-dark);
}
.lightbox__caption {
  color: var(--gray-300);
  font-size: .875rem;
  text-align: center;
  margin: 0;
}
.lightbox__btn {
  position: absolute;
  z-index: 1;
  width: 44px;               /* target minimo comodo anche da touch */
  height: 44px;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, .12);
  color: var(--white);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t);
}
.lightbox__btn:hover { background: rgba(255, 255, 255, .25); }
.lightbox__btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.lightbox__btn--close { top: 1rem; right: 1rem; }
.lightbox__btn--prev  { left: 1rem;  top: 50%; transform: translateY(-50%); }
.lightbox__btn--next  { right: 1rem; top: 50%; transform: translateY(-50%); }

@media (max-width: 640px) {
  .lightbox { padding: 1rem .5rem; }
  .lightbox__btn--prev { left: .25rem; }
  .lightbox__btn--next { right: .25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .project-gallery__item { transition: none; }
  .project-gallery__item:hover { transform: none; }
}

/* ── BLOG GRID & CARD ─────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
}
.blog-grid--3 { grid-template-columns: repeat(3, 1fr); }

.blog-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--t), transform var(--t);
}
.blog-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }

.blog-card__img-wrap {
  position: relative;
  aspect-ratio: 16/9;
  display: block;
  overflow: hidden;
}
.blog-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.blog-card:hover .blog-card__img { transform: scale(1.04); }
.blog-card__img-placeholder {
  width: 100%;
  height: 100%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-300);
}

.blog-card__badge {
  position: absolute;
  top: .75rem;
  left: .75rem;
  background: var(--navy);
  color: var(--white);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .25rem .65rem;
  border-radius: var(--radius-full);
}

.blog-card__body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.blog-card__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: .75rem;
}
.blog-card__date,
.blog-card__read {
  font-size: .8rem;
  color: var(--gray-500);
}
.blog-card__title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: .5rem;
  line-height: 1.3;
}
.blog-card__title a { color: var(--dark); }
.blog-card__title a:hover { color: var(--accent); }
.blog-card__excerpt {
  font-size: .9rem;
  color: var(--gray-500);
  line-height: 1.55;
  flex: 1;
  margin-bottom: 1rem;
}
.blog-card__link {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: auto;
  transition: gap var(--t);
}
.blog-card__link:hover { gap: .6rem; color: var(--accent-dark); }

.blog-card--sm .blog-card__body { padding: 1.25rem; }
.blog-card--sm .blog-card__title { font-size: .9375rem; }

/* ── BLOG ARTICLE ────────────────────────────────────────── */
.article-header-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1rem;
  font-size: .875rem;
  color: rgba(255,255,255,.65);
}
.article-header-meta span {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  align-items: start;
}

.article-content { min-width: 0; }

.article-content__cover {
  margin: 0 0 2.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.article-content__cover img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Prose styles (article body) */
.prose {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--gray-700);
}
.prose h2 { font-size: 1.5rem; font-weight: 700; color: var(--dark); margin: 2rem 0 .875rem; }
.prose h3 { font-size: 1.2rem; font-weight: 700; color: var(--dark); margin: 1.5rem 0 .625rem; }
.prose p { margin-bottom: 1.25rem; }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: .4rem; }
.prose a { color: var(--accent); text-decoration: underline; }
.prose a:hover { color: var(--accent-dark); }
.prose strong { font-weight: 700; color: var(--dark); }
.prose code {
  font-family: var(--font-mono);
  font-size: .875em;
  background: var(--gray-100);
  padding: .15em .4em;
  border-radius: 4px;
}
.prose pre {
  background: var(--navy-dark);
  color: var(--gray-100);
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: .875rem;
}
.prose blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1.25rem;
  color: var(--gray-500);
  font-style: italic;
  margin: 1.5rem 0;
}
.prose figure { margin: 1.5rem 0; }
.prose figure img { border-radius: var(--radius); }
.prose figcaption { text-align: center; font-size: .85rem; color: var(--gray-500); margin-top: .5rem; }

.article-content__footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-200);
}

.article-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.article-sidebar__card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.article-sidebar__label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: .5rem;
}
.article-sidebar__author { font-size: 1rem; font-weight: 700; color: var(--dark); margin-bottom: .375rem; }
.article-sidebar__bio { font-size: .85rem; color: var(--gray-500); line-height: 1.5; margin-bottom: 1rem; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 3rem;
}
.pagination__info { font-size: .875rem; color: var(--gray-500); }

/* ── AZIENDA — Values & Skills ───────────────────────────── */
.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.value-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: box-shadow var(--t), transform var(--t);
}
.value-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.value-card__icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(194,65,12,.08);
  border-radius: var(--radius);
  color: var(--accent);
  margin: 0 auto 1.25rem;
}
.value-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: .625rem;
}
.value-card__desc {
  font-size: .9rem;
  color: var(--gray-500);
  line-height: 1.55;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.skill-group {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.skill-group__area {
  font-size: .875rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .875rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ── CONTATTI PAGE ────────────────────────────────────────── */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  align-items: start;
}

.contact-info { display: flex; flex-direction: column; gap: 0; }

.contact-info__item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--gray-100);
}
.contact-info__item:first-child { padding-top: 0; }

.contact-info__icon {
  width: 44px;
  height: 44px;
  background: rgba(194,65,12,.08);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.contact-info__label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: .2rem;
}
.contact-info__value {
  font-size: .9375rem;
  color: var(--dark);
  font-weight: 500;
}
.contact-info__value--link { color: var(--accent); }
.contact-info__value--link:hover { color: var(--accent-dark); }

.contact-info__cta-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1.5rem;
}
.contact-info__cta-title { font-size: .9375rem; font-weight: 700; margin-bottom: .375rem; }
.contact-info__cta-body { font-size: .875rem; color: var(--gray-500); margin-bottom: 1rem; }

.contact-form-wrap__title {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
}

.contact-form { }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  cursor: pointer;
}
.form-check__input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--navy);
  margin-top: .1rem;
  cursor: pointer;
}
.form-check__label {
  font-size: .9rem;
  color: var(--gray-700);
  line-height: 1.5;
}
.form-check__label a { color: var(--accent); }

.form-input--error { border-color: var(--danger) !important; }

.contact-form__spam-note {
  font-size: .8rem;
  color: var(--gray-500);
  margin-bottom: 1.25rem;
}

/* Alert */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .875rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: .9375rem;
}
.alert--success { background: #dcfce7; color: var(--success); border: 1px solid #bbf7d0; }
.alert--success strong { font-weight: 700; }
.alert--success p { margin-top: .25rem; font-size: .875rem; color: #166534; }
.alert--warning { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }

/* ── DOCUMENTI ───────────────────────────────────────────── */
.doc-list { display: flex; flex-direction: column; gap: 0; }

.doc-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--gray-200);
}
.doc-item:first-child { border-top: 1px solid var(--gray-200); }

.doc-item__icon {
  width: 52px;
  height: 52px;
  background: rgba(194,65,12,.08);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.doc-item__body { flex: 1; min-width: 0; }
.doc-item__title {
  font-size: 1rem;
  font-weight: 700;
  margin: .375rem 0 .5rem;
  color: var(--dark);
}
.doc-item__desc {
  font-size: .875rem;
  color: var(--gray-500);
  line-height: 1.5;
  margin-bottom: .5rem;
}
.doc-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}
.doc-item__meta-item { font-size: .8rem; color: var(--gray-500); }
.doc-item__action { flex-shrink: 0; }
.doc-item__btn--disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ── LEGAL CONTENT ───────────────────────────────────────── */
.legal-content {
  max-width: 780px;
  margin-inline: auto;
}
.legal-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
  margin: 2.5rem 0 .875rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-100);
}
.legal-content h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.legal-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.5rem 0 .5rem;
}
.legal-content p {
  font-size: .9375rem;
  color: var(--gray-700);
  line-height: 1.7;
  margin-bottom: 1rem;
}
.legal-content ul {
  margin: .75rem 0 1rem 1.5rem;
  list-style: disc;
}
.legal-content li {
  font-size: .9375rem;
  color: var(--gray-700);
  line-height: 1.6;
  margin-bottom: .4rem;
}
.legal-content a { color: var(--accent); text-decoration: underline; }
.legal-content a:hover { color: var(--accent-dark); }

.legal-content__notice {
  display: flex;
  align-items: flex-start;
  gap: .875rem;
  background: #fef9c3;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  font-size: .875rem;
  color: #854d0e;
  line-height: 1.55;
}
.legal-content__notice svg { flex-shrink: 0; margin-top: .1rem; }

/* ── PREVENTIVO PAGE ─────────────────────────────────────── */
.quote-placeholder {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--gray-50);
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-lg);
}
.quote-placeholder__icon { color: var(--gray-300); margin: 0 auto 1.25rem; }
.quote-placeholder__loading { font-size: 1rem; color: var(--gray-500); }

/* ── RESPONSIVE — NEW PAGES ──────────────────────────────── */
@media (max-width: 1024px) {
  .servizio-layout { grid-template-columns: 1fr; }
  .servizio-layout__aside .info-card { position: static; }

  .project-detail__body { grid-template-columns: 1fr; }
  .project-detail__meta { order: 2; position: static; }
  .project-detail__content { order: 1; }

  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }

  .values-grid { grid-template-columns: 1fr 1fr; }

  .contact-layout { grid-template-columns: 1fr; gap: 2.5rem; }
}

@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }

  .blog-grid--3 { grid-template-columns: 1fr; }

  .values-grid { grid-template-columns: 1fr; }

  .doc-item { flex-wrap: wrap; gap: 1rem; }
  .doc-item__action { width: 100%; }

  .services-grid--large { grid-template-columns: 1fr; }

  .features-grid { grid-template-columns: 1fr; }

  .skills-grid { grid-template-columns: 1fr; }

  .article-header-meta { gap: .75rem; }
}

/* ── COOKIE BANNER ───────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: var(--navy-dark);
  color: var(--white);
  box-shadow: 0 -4px 24px rgba(0,0,0,.18);
  padding: 1.25rem 0;
  animation: slideUp .3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.cookie-banner__inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.cookie-banner__text { flex: 1 1 300px; }
.cookie-banner__title { display: block; font-size: .9375rem; margin-bottom: .25rem; color: var(--white); }
.cookie-banner__body { font-size: .8125rem; color: rgba(255,255,255,.75); line-height: 1.5; }
.cookie-banner__link { color: rgba(255,255,255,.9); text-decoration: underline; }
.cookie-banner__link:hover { color: var(--white); }
.cookie-banner__actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.cookie-banner .btn-ghost { color: rgba(255,255,255,.8); }
.cookie-banner .btn-ghost:hover { background: rgba(255,255,255,.08); color: var(--white); }
.cookie-banner .btn-outline { color: var(--white); border-color: rgba(255,255,255,.5); }
.cookie-banner .btn-outline:hover { background: rgba(255,255,255,.1); border-color: var(--white); }

/* ── COOKIE OVERLAY + PREFS ──────────────────────────────── */
.cookie-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(10,18,48,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.cookie-prefs {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: scaleIn .2s ease;
}
@keyframes scaleIn { from { transform:scale(.95); opacity:0; } to { transform:scale(1); opacity:1; } }

.cookie-prefs__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--gray-200);
}
.cookie-prefs__title { font-size: 1.125rem; font-weight: 700; color: var(--dark); }
.cookie-prefs__close {
  background: none;
  border: none;
  cursor: pointer;
  padding: .375rem;
  border-radius: var(--radius-sm);
  color: var(--gray-500);
  transition: background var(--t), color var(--t);
  display: flex;
}
.cookie-prefs__close:hover { background: var(--gray-100); color: var(--dark); }

.cookie-prefs__body { flex: 1; overflow-y: auto; padding: .75rem 1.5rem; }

.cookie-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--gray-100);
}
.cookie-row:last-child { border-bottom: none; }
.cookie-row__text { flex: 1; }
.cookie-row__name { font-size: .9rem; font-weight: 600; color: var(--dark); margin-bottom: .2rem; }
.cookie-row__desc { font-size: .8125rem; color: var(--gray-500); line-height: 1.5; }
.cookie-row__always {
  font-size: .75rem;
  font-weight: 600;
  color: var(--success);
  white-space: nowrap;
  padding: .25rem .625rem;
  background: rgba(22,163,74,.08);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* Toggle switch */
.cookie-toggle { cursor: pointer; flex-shrink: 0; }
.cookie-toggle__track {
  display: block;
  width: 44px;
  height: 24px;
  background: var(--gray-300);
  border-radius: var(--radius-full);
  position: relative;
  transition: background var(--t);
}
.cookie-toggle input:checked ~ .cookie-toggle__track { background: var(--accent); }
.cookie-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t);
}
.cookie-toggle input:checked ~ .cookie-toggle__track .cookie-toggle__thumb { transform: translateX(20px); }
.cookie-toggle:focus-within .cookie-toggle__track { outline: 3px solid var(--accent); outline-offset: 2px; }

.cookie-prefs__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  flex-wrap: wrap;
}
.cookie-prefs__policy-link { font-size: .8125rem; color: var(--gray-500); }
.cookie-prefs__policy-link:hover { color: var(--accent); }
.cookie-prefs__actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* "Gestisci cookie" in footer */
.footer__cookie-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: .8125rem;
  color: var(--gray-500);
  padding: 0;
  transition: color var(--t);
}
.footer__cookie-btn:hover { color: var(--white); }

/* ── PORTFOLIO FILTER ANIMATION ──────────────────────────── */
.project-card.pf-hidden { display: none; }
.project-card.pf-in {
  animation: pfFadeIn .25s ease both;
}
@keyframes pfFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── QUOTE WIZARD ────────────────────────────────────────── */
.quote-wizard {
  max-width: 860px;
  margin: 0 auto;
}

/* Progress bar */
/* È un <ol>: i passi sono una sequenza ordinata, e per un lettore di
   schermo "elenco di 6 elementi, elemento 3" dice molto più di sei <div>
   affiancati. In cambio va tolta la lista che il browser disegna. */
.quiz-progress {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin: 0 0 3rem;
  padding: 0;
  list-style: none;
  position: relative;
}
.quiz-progress::before {
  content: '';
  position: absolute;
  top: 14px;
  left: calc(10% + 14px);
  right: calc(10% + 14px);
  height: 2px;
  background: var(--gray-200);
  z-index: 0;
}
.quiz-progress__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  flex: 1;
  position: relative;
  z-index: 1;
}
.quiz-progress__dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-500);
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--gray-200);
  transition: background var(--t), border-color var(--t), color var(--t);
}
.quiz-progress__label {
  font-size: .7rem;
  font-weight: 500;
  color: var(--gray-500);
  text-align: center;
  line-height: 1.3;
  max-width: 72px;
}
.quiz-progress__step.is-done .quiz-progress__dot {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}
.quiz-progress__step.is-done .quiz-progress__label { color: var(--accent); }
.quiz-progress__step.is-active .quiz-progress__dot {
  background: var(--white);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 4px rgba(194,65,12,.12);
}
.quiz-progress__step.is-active .quiz-progress__label { color: var(--dark); font-weight: 600; }

/* Step container */
.quiz-step {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
}
.quiz-step__label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: .5rem;
}
.quiz-step__title {
  font-size: clamp(1.25rem, 3vw, 1.625rem);
  font-weight: 700;
  margin-bottom: 1.75rem;
}
.quiz-step__hint {
  font-size: .875rem;
  color: var(--gray-500);
  margin-top: -.75rem;
  margin-bottom: 1.5rem;
}

/* Option grid */
.quiz-options {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}
.quiz-options--grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.quiz-options--cols3 {
  grid-template-columns: repeat(3, 1fr);
}

.quiz-option { display: block; cursor: pointer; }
.quiz-option__card {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 1rem 1.125rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
  height: 100%;
  min-height: 80px;
}
.quiz-option:hover .quiz-option__card {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(194,65,12,.08);
}
.quiz-option--selected .quiz-option__card {
  border-color: var(--accent);
  background: rgba(194,65,12,.04);
  box-shadow: 0 0 0 3px rgba(194,65,12,.12);
}
.quiz-option__title { font-size: .9375rem; font-weight: 600; color: var(--dark); }
.quiz-option__desc  { font-size: .8125rem; color: var(--gray-500); line-height: 1.4; }
.quiz-option__price { font-size: .8rem; font-weight: 600; color: var(--accent); margin-top: auto; padding-top: .25rem; }
.quiz-option__mod   { font-size: .8125rem; font-weight: 600; color: var(--navy); margin-top: auto; }

/* Stima prezzo */
.quiz-price {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  margin-top: 1.5rem;
}
.quiz-price__loading { color: var(--gray-500); font-style: italic; }
.quiz-price__hint    { color: var(--gray-500); font-size: .875rem; }
.quiz-price__label   { font-size: .8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--gray-500); margin-bottom: .5rem; }
.quiz-price__range   { font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 800; color: var(--navy); margin-bottom: .5rem; }
.quiz-price__note    { font-size: .8125rem; color: var(--gray-500); line-height: 1.5; }

/* Nav buttons */
.quiz-nav {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-100);
}

/* Success state */
.quiz-success {
  text-align: center;
  padding: 4rem 2rem;
}
.quiz-success__icon { color: var(--success); margin: 0 auto 1.5rem; }
.quiz-success__title { font-size: 1.75rem; font-weight: 800; margin-bottom: 1rem; }
.quiz-success__body { font-size: 1rem; color: var(--gray-500); max-width: 480px; margin: 0 auto 2rem; line-height: 1.6; }

/* Gruppi dentro un passo: pacchetto, opzioni, manutenzione.
   Il <fieldset> serve al lettore di schermo — annuncia "Pacchetto" prima
   dei radio invece di lasciarli orfani — e va spogliato del bordo e del
   padding che il browser gli mette d'ufficio. */
.quiz-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1.5rem;
  min-width: 0;
}
.quiz-fieldset__legend {
  font-size: .8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray-500);
  padding: 0;
  margin-bottom: 1rem;
}
.quiz-fieldset + .quiz-fieldset {
  border-top: 1px solid var(--gray-100);
  padding-top: 1.5rem;
}

/* Opzione con un campo dentro (numero o select): non è cliccabile tutta,
   quindi niente cursor pointer né hover sul bordo. */
.quiz-option--campo { cursor: default; }
.quiz-option--campo:hover .quiz-option__card {
  border-color: var(--gray-200);
  box-shadow: none;
}
.quiz-option--campo .form-input { margin-top: .375rem; }

.quiz-numero {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .375rem;
}
.quiz-numero__input { width: 6rem; }
.quiz-numero__unita { font-size: .8125rem; color: var(--gray-500); }

/* Stima */
.quiz-price__canone {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: .25rem;
}
.quiz-price__iva {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}
/* «al mese» accanto al canone quando il canone È la cifra principale:
   deve leggersi come unità di misura, non come parte del numero. */
.quiz-price__unita {
  font-size: .5em;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: 0;
}
/* Configurazione completa che non produce nessun importo: al posto di
   uno «0 €» che sembrerebbe un prezzo. */
.quiz-price__daValutare {
  font-size: clamp(1.125rem, 3vw, 1.5rem);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1.5rem;
}
.quiz-price__hint--errore { color: var(--danger, #b91c1c); }
.quiz-price__mini {
  font-size: .9375rem;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}
.quiz-price__mini strong { color: var(--navy); }

/* Riepilogo voce per voce: è ciò che rende leggibile la cifra, e il
   motivo per cui la stima non è più solo un numero senza spiegazione. */
.quiz-riepilogo {
  text-align: left;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.quiz-riepilogo__title {
  font-size: .8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray-500);
  margin-bottom: 1rem;
}
.quiz-riepilogo__blocco + .quiz-riepilogo__blocco {
  border-top: 1px solid var(--gray-100);
  margin-top: 1rem;
  padding-top: 1rem;
}
.quiz-riepilogo__servizio {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: .5rem;
}
.quiz-riepilogo__servizio span { color: var(--accent); }
.quiz-riepilogo__voci { list-style: none; margin: 0; padding: 0; }
.quiz-riepilogo__voci li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: .875rem;
  padding: .25rem 0;
}
.quiz-riepilogo__voce { color: var(--gray-600, var(--gray-500)); }
.quiz-riepilogo__voce em { font-style: normal; color: var(--gray-500); }
.quiz-riepilogo__cifra {
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}
.quiz-riepilogo__tempi {
  font-size: .8125rem;
  color: var(--gray-500);
  margin-top: .5rem;
}

/* ── RESPONSIVE — ISOLE REACT ────────────────────────────── */
@media (max-width: 768px) {
  /* Su schermo stretto il banner arrivava a coprire metà pagina, CTA
     dell'hero comprese: testo più compatto e pulsanti su una riga sola. */
  .cookie-banner { padding: .875rem 0; }
  .cookie-banner__inner { flex-direction: column; align-items: flex-start; gap: .75rem; }
  /* In colonna il flex-basis di 300px del blocco testo diventa *altezza*:
     era questo a gonfiare il banner fino a coprire mezzo schermo. */
  .cookie-banner__text { flex: 0 0 auto; }
  .cookie-banner__title { font-size: .875rem; margin-bottom: .125rem; }
  .cookie-banner__body { font-size: .75rem; line-height: 1.45; }
  .cookie-banner__actions { width: 100%; justify-content: flex-start; gap: .5rem; flex-wrap: nowrap; }
  .cookie-banner__actions .btn { flex: 1 1 0; padding-inline: .5rem; font-size: .8125rem; white-space: nowrap; }

  .quiz-options--grid  { grid-template-columns: 1fr 1fr; }
  .quiz-options--cols3 { grid-template-columns: 1fr; }

  .quiz-step { padding: 1.5rem; }

  .quiz-progress__label { display: none; }
  .quiz-progress::before { top: 13px; left: calc(10% + 13px); right: calc(10% + 13px); }

  .quiz-nav { justify-content: space-between; }

  .cookie-prefs__foot { flex-direction: column; align-items: flex-start; }
  .cookie-prefs__actions { width: 100%; justify-content: flex-end; }
}

@media (max-width: 480px) {
  .quiz-options--grid { grid-template-columns: 1fr; }
  .quiz-nav .btn { flex: 1; justify-content: center; }
}

/* ── NEGOZIO ─────────────────────────────────────────────── */
.shop-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
}
.shop-filter-btn {
  padding: .4rem 1rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-full);
  background: var(--white);
  color: var(--gray-700);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--t), color var(--t), background var(--t);
}
.shop-filter-btn:hover { border-color: var(--navy); color: var(--navy); }
.shop-filter-btn.active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.shop-filter-btn__count { opacity: .7; font-size: .8em; }

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.shop-grid--compact { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }

.shop-empty {
  text-align: center;
  padding: 4rem 0;
  color: var(--gray-500);
}

/* Product card */
.product-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--t), transform var(--t);
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.product-card__img-wrap {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--gray-100);
}
.product-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}
.product-card__img-wrap:hover .product-card__img { transform: scale(1.03); }
.product-card__img--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-300);
}
.product-card__badge {
  position: absolute;
  top: .75rem;
  left: .75rem;
  background: var(--accent);
  color: var(--white);
  font-size: .7rem;
  font-weight: 600;
  padding: .2rem .6rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.product-card__body { padding: 1.25rem 1.25rem .75rem; flex: 1; }
.product-card__name-link { text-decoration: none; color: inherit; }
.product-card__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .5rem;
  line-height: 1.3;
}
.product-card__name-link:hover .product-card__name { color: var(--accent); }
.product-card__desc { font-size: .875rem; color: var(--gray-500); line-height: 1.5; }

.product-card__footer {
  padding: .75rem 1.25rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  border-top: 1px solid var(--gray-100);
}
.product-card__price { line-height: 1.2; }
.product-card__price-value { font-size: 1.375rem; font-weight: 800; color: var(--navy); }
.product-card__price-label { display: block; font-size: .7rem; color: var(--gray-500); text-transform: uppercase; }
.product-card__actions { display: flex; gap: .5rem; flex-shrink: 0; }

/* Product detail */
.product-detail__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.product-detail__media { position: sticky; top: calc(var(--nav-h) + 1.5rem); }
.product-detail__img { width: 100%; border-radius: var(--radius-xl); box-shadow: var(--shadow-md); }
.product-detail__img-placeholder {
  aspect-ratio: 16/9;
  background: var(--gray-100);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-300);
}
.product-detail__category { color: var(--accent); }
.product-detail__name { font-size: clamp(1.5rem, 3vw, 2.5rem); margin: .5rem 0 1.25rem; }

.product-detail__price-wrap { display: flex; align-items: baseline; gap: .75rem; margin-bottom: 1.5rem; }
.product-detail__price { font-size: 2.25rem; font-weight: 800; color: var(--navy); }
.product-detail__price-note { font-size: .875rem; color: var(--gray-500); }

.product-detail__desc { font-size: 1rem; color: var(--gray-700); line-height: 1.7; margin-bottom: 1.5rem; }

.product-detail__features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: var(--gray-50);
  border-radius: var(--radius);
}
.product-detail__features li {
  display: flex;
  align-items: center;
  gap: .625rem;
  font-size: .9rem;
  color: var(--gray-700);
}
.product-detail__features li svg { color: var(--accent); flex-shrink: 0; }

.product-detail__cta { margin-bottom: 1.25rem; }
.product-detail__cta-note { margin-top: .625rem; font-size: .8rem; color: var(--gray-500); }
.product-detail__legal {
  font-size: .75rem;
  color: var(--gray-500);
  line-height: 1.6;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}
.product-detail__legal a { color: var(--accent); text-decoration: underline; }

/* Order pages */
.order-page { padding-top: 4rem; padding-bottom: 4rem; }
.order-page__card {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  padding: 3rem 2.5rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}
.order-page__icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}
.order-page__icon--success { background: #dcfce7; color: var(--success); }
.order-page__icon--warning { background: #fef3c7; color: var(--warning); }
.order-page__icon--danger  { background: #fee2e2; color: var(--danger); }

.order-page__title { font-size: 1.75rem; margin-bottom: 1.25rem; }
.order-page__body p { font-size: 1rem; color: var(--gray-700); line-height: 1.7; margin-bottom: .75rem; }
.order-page__note { font-size: .875rem !important; color: var(--gray-500) !important; }
.order-page__actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }

/* ── SHOP CART (React island) ────────────────────────────── */
/* Slot vuoto (carrello nascosto fuori dal negozio): non occupa spazio
   né lascia un gap flex nella navbar finché l'isola non vi inserisce il pulsante. */
#navbar-cart-slot:empty { display: none; }

.cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .4rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--navy);
  border-radius: var(--radius-sm);
  transition: color var(--t), background var(--t);
}
.cart-btn:hover { color: var(--accent); background: var(--gray-100); }
.cart-btn__badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--accent);
  color: var(--white);
  border-radius: var(--radius-full);
  font-size: .65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1100;
  backdrop-filter: blur(2px);
  animation: cartFadeIn .2s ease;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  background: var(--white);
  box-shadow: var(--shadow-xl);
  z-index: 1101;
  display: flex;
  flex-direction: column;
  animation: cartSlideIn .25s ease;
  outline: none;
}

@keyframes cartFadeIn  { from { opacity: 0 } to { opacity: 1 } }
@keyframes cartSlideIn { from { transform: translateX(100%) } to { transform: translateX(0) } }
@keyframes spin        { to { transform: rotate(360deg) } }

.cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}
.cart-drawer__title { font-size: 1.125rem; font-weight: 700; color: var(--navy); }
.cart-drawer__close {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .375rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-500);
  border-radius: var(--radius-sm);
  transition: color var(--t), background var(--t);
}
.cart-drawer__close:hover { color: var(--navy); background: var(--gray-100); }

.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  -webkit-overflow-scrolling: touch;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
  padding: 3rem 0;
}
.cart-empty__text { color: var(--gray-500); font-size: .9rem; }

.cart-items { display: flex; flex-direction: column; gap: .875rem; margin-bottom: 1.5rem; }

.cart-item {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .875rem;
  background: var(--gray-50);
  border-radius: var(--radius);
}
.cart-item__img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.cart-item__info { flex: 1; min-width: 0; }
.cart-item__name {
  font-size: .875rem;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: .2rem;
}
.cart-item__price { font-size: .875rem; font-weight: 700; color: var(--dark); }
.cart-item__iva { font-size: .75rem; color: var(--gray-500); font-weight: 400; }
.cart-item__remove {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: .375rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-500);
  border-radius: var(--radius-sm);
  transition: color var(--t);
}
.cart-item__remove:hover { color: var(--danger); }

.cart-coupon { border-top: 1px solid var(--gray-200); padding-top: 1.25rem; }
.cart-coupon__label { display: block; font-size: .8rem; font-weight: 600; color: var(--gray-700); margin-bottom: .5rem; }
.cart-coupon__row { display: flex; gap: .5rem; }
.cart-coupon__input { flex: 1; text-transform: uppercase; letter-spacing: .05em; }
.cart-coupon__msg { font-size: .8rem; margin-top: .375rem; color: var(--success); }
.cart-coupon__msg--error { color: var(--danger); }
.cart-coupon__applied { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cart-coupon__applied-msg { font-size: .875rem; color: var(--success); font-weight: 500; }

.cart-drawer__footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.cart-summary { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.cart-summary__line {
  display: flex;
  justify-content: space-between;
  font-size: .875rem;
  color: var(--gray-700);
}
.cart-summary__line--discount { color: var(--success); font-weight: 500; }
.cart-summary__total {
  display: flex;
  justify-content: space-between;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy);
  padding-top: .5rem;
  border-top: 1px solid var(--gray-200);
}

.cart-checkout-btn {
  width: 100%;
  justify-content: center;
  gap: .5rem;
  padding: .875rem;
  margin-top: .75rem;
}
.cart-checkout-btn__spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-right: .375rem;
}
.cart-checkout-btn:disabled { opacity: .45; cursor: not-allowed; }
.cart-checkout__error { font-size: .8rem; color: var(--danger); margin-bottom: .5rem; }
.cart-checkout__note { font-size: .72rem; color: var(--gray-500); text-align: center; margin-top: .5rem; }

/* Rinuncia al recesso: obbligatoria, quindi sta sopra il pulsante e non
   fra le note in fondo, dove si legge dopo aver già cliccato. */
.cart-recesso {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin-bottom: .75rem;
}
.cart-recesso input[type="checkbox"] {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: .15rem;
  accent-color: var(--navy);
}
.cart-recesso label {
  font-size: .78rem;
  line-height: 1.45;
  color: var(--gray-700);
  cursor: pointer;
}
.cart-recesso a { color: var(--accent-dark); text-decoration: underline; }

.add-to-cart-btn { gap: .4rem; }

/* form-input--sm helper */
.form-input--sm { padding: .4rem .75rem; font-size: .875rem; }

/* ── RESPONSIVE NEGOZIO ──────────────────────────────────── */
@media (max-width: 900px) {
  .product-detail__layout { grid-template-columns: 1fr; gap: 2rem; }
  .product-detail__media { position: static; }
}
@media (max-width: 640px) {
  .shop-grid { grid-template-columns: 1fr; }
  .product-card__footer { flex-direction: column; align-items: flex-start; gap: .625rem; }
  .product-card__actions { width: 100%; }
  .product-card__actions .btn { flex: 1; justify-content: center; }
  .order-page__card { padding: 2rem 1.25rem; }
  .cart-drawer { width: 100vw; }
}

/* ══════════════════════════════════════════════════════
   ADMIN
   ══════════════════════════════════════════════════════ */

/* ── Admin Login ──────────────────────────────────────── */
.admin-login-body {
  min-height: 100vh;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.admin-login-wrap { width: 100%; max-width: 420px; }
.admin-login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 4px 32px rgba(0,0,0,.10);
}
.admin-login-logo { text-align: center; margin-bottom: 1.5rem; }
.admin-login-title {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  color: var(--dark);
  margin-bottom: 1.5rem;
}
.admin-login-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: var(--danger);
  border-radius: 8px;
  padding: .75rem 1rem;
  font-size: .875rem;
  margin-bottom: 1.25rem;
}
.admin-login-btn { width: 100%; margin-top: .5rem; }

/* ── Admin App body ───────────────────────────────────── */
.admin-app-body {
  background: var(--gray-50);
  min-height: 100vh;
}
.admin-boot-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1rem;
  color: var(--gray-500);
}
.admin-boot-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ── Admin Layout ─────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px;
  background: #1e293b;
  color: #e2e8f0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: transform .25s;
}
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ── Sidebar Brand ────────────────────────────────────── */
.admin-sidebar__brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.admin-sidebar__logo {
  width: 36px; height: 36px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-weight: 800;
  font-size: .875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-sidebar__name { font-weight: 700; font-size: 1rem; color: #fff; }

/* ── Sidebar Nav ──────────────────────────────────────── */
.admin-nav { flex: 1; padding: .75rem 0; overflow-y: auto; }
.admin-nav__item {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: .625rem 1.25rem;
  font-size: .875rem;
  color: #94a3b8;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  border-radius: 0;
  transition: background .15s, color .15s;
}
.admin-nav__item:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.admin-nav__item--active {
  background: rgba(255,255,255,.10);
  color: #fff;
  font-weight: 600;
  border-left: 3px solid var(--accent);
}
.admin-nav__icon { font-size: 1rem; width: 1.25rem; text-align: center; }

/* ── Sidebar Footer ───────────────────────────────────── */
.admin-sidebar__footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8rem;
}
.admin-sidebar__user { color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-sidebar__logout {
  color: #f87171;
  text-decoration: none;
  font-weight: 500;
  flex-shrink: 0;
}
.admin-sidebar__logout:hover { text-decoration: underline; }

/* ── Admin Header ─────────────────────────────────────── */
.admin-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.admin-header__menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--dark);
  padding: .25rem;
}
.admin-header__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
}

/* ── Admin Content ────────────────────────────────────── */
.admin-content { padding: 1.5rem; flex: 1; }

/* ── Section ──────────────────────────────────────────── */
.admin-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.admin-section__title { font-size: 1.25rem; font-weight: 700; color: var(--dark); margin: 0; }
.admin-section__actions { display: flex; align-items: center; gap: .75rem; }

/* ── Admin Table ──────────────────────────────────────── */
.admin-table-wrap { overflow-x: auto; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  background: var(--white);
}
.admin-table th {
  background: var(--gray-50);
  color: var(--gray-500);
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.admin-table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--dark);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--gray-50); }
.admin-table__ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-table__sub { font-size: .72rem; color: var(--gray-500); }
.admin-table__actions { white-space: nowrap; display: flex; gap: .5rem; align-items: center; }
.admin-table__row--highlight td { background: #fffbeb; }
.admin-table__row--highlight:hover td { background: #fef9c3; }

/* ── Admin Buttons ────────────────────────────────────── */
.admin-btn-edit, .admin-btn-del, .admin-btn-link {
  font-size: .8125rem;
  font-weight: 500;
  padding: .25rem .625rem;
  border-radius: 6px;
  border: 1px solid;
  cursor: pointer;
  background: none;
  transition: background .15s, color .15s;
  line-height: 1.4;
}
.admin-btn-edit { color: var(--info); border-color: var(--info); }
.admin-btn-edit:hover { background: #eff6ff; }
.admin-btn-del { color: var(--danger); border-color: var(--danger); }
.admin-btn-del:hover { background: #fef2f2; }
.admin-btn-link { border: none; color: var(--navy); text-decoration: underline; padding: 0; }
.admin-btn-link:hover { color: var(--accent); }

/* ── Admin Card ───────────────────────────────────────── */
.admin-card {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  padding: 1.25rem;
}
.admin-card__title { font-size: 1rem; font-weight: 700; margin: 0 0 1rem; color: var(--dark); }

/* ── Admin Dashboard ──────────────────────────────────── */
.admin-dashboard { display: flex; flex-direction: column; gap: 1.5rem; }
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.admin-stat-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.25rem;
  border-left: 4px solid var(--gray-300);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.admin-stat-card--navy   { border-left-color: var(--navy); }
.admin-stat-card--success{ border-left-color: var(--success); }
.admin-stat-card--warning{ border-left-color: var(--warning); }
.admin-stat-card--accent { border-left-color: var(--accent); }
.admin-stat-card--info   { border-left-color: var(--info); }
.admin-stat-card--neutral{ border-left-color: var(--gray-300); }
.admin-stat-card__value { font-size: 2rem; font-weight: 800; color: var(--dark); line-height: 1; }
.admin-stat-card__label { font-size: .8125rem; color: var(--gray-500); margin-top: .25rem; }
.admin-dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

/* ── Admin Modal ──────────────────────────────────────── */
.admin-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  padding: 2rem 1rem;
  overflow-y: auto;
}
.admin-modal {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  margin: auto;
}
.admin-modal--wide { max-width: 840px; }
.admin-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}
.admin-modal__title { font-size: 1.125rem; font-weight: 700; margin: 0; color: var(--dark); }
.admin-modal__close {
  background: none; border: none;
  font-size: 1.5rem; line-height: 1;
  cursor: pointer; color: var(--gray-500);
  padding: .125rem .375rem;
  border-radius: 4px;
  transition: background .15s;
}
.admin-modal__close:hover { background: var(--gray-100); }
.admin-modal__body { padding: 1.5rem; }

/* ── Editor rich text (admin blog) ────────────────────── */
/*
   L'area di scrittura imita il corpo dell'articolo pubblico — stessa
   scala tipografica, stessi margini fra i blocchi — così quello che si
   vede scrivendo assomiglia a quello che esce. Non è un'anteprima
   fedele (i token del blog pubblico sono altri) ma toglie la sorpresa.
*/
.rte {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  overflow: hidden;
}
.rte--vuoto { display: flex; align-items: center; justify-content: center; padding: 2rem; }

.rte__testa {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .375rem;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.rte__barra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .125rem;
  flex: 1;
  min-width: 0;
}
.rte__sep {
  width: 1px;
  height: 1.25rem;
  background: var(--gray-300);
  margin: 0 .25rem;
}
.rte__nota {
  flex: 1;
  margin: 0;
  padding: .3rem .25rem;
  font-size: .75rem;
  color: var(--gray-500);
  line-height: 1.4;
}

.rte__btn {
  min-width: 1.9rem;
  padding: .3rem .45rem;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--gray-700);
  font-size: .8rem;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.rte__btn:hover:not(:disabled) { background: var(--gray-200); color: var(--navy); }
.rte__btn:disabled { opacity: .35; cursor: default; }
.rte__btn--active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}
.rte__btn--active:hover:not(:disabled) { background: var(--navy-mid); color: var(--white); }
.rte__btn--sorgente { flex-shrink: 0; font-size: .72rem; letter-spacing: .04em; }
.rte__btn code { font-family: var(--font-mono); font-size: .72rem; }

/* La riga del link occupa tutta la larghezza sotto i pulsanti: sta nel
   flusso della barra invece che in overlay, così non copre il testo che
   si sta collegando. */
.rte__link {
  flex-basis: 100%;
  display: flex;
  gap: .375rem;
  margin-top: .375rem;
  padding-top: .375rem;
  border-top: 1px solid var(--gray-200);
}
.rte__link input {
  flex: 1;
  min-width: 0;
  padding: .3rem .5rem;
  border: 1px solid var(--gray-300);
  border-radius: 5px;
  font-family: inherit;
  font-size: .8rem;
}
.rte__link .rte__btn { border-color: var(--gray-300); background: var(--white); }

.rte__area {
  padding: .875rem 1rem;
  min-height: 18rem;
  max-height: 32rem;
  overflow-y: auto;
  font-size: .95rem;
  line-height: 1.65;
  color: var(--dark);
}
.rte__area:focus { outline: none; }
.rte:focus-within { border-color: var(--navy); }

.rte__area > * + * { margin-top: .75rem; }
.rte__area h2 { font-size: 1.3rem; font-weight: 700; color: var(--navy); margin-top: 1.5rem; }
.rte__area h3 { font-size: 1.1rem; font-weight: 600; color: var(--navy); margin-top: 1.25rem; }
.rte__area h4 { font-size: 1rem;   font-weight: 600; color: var(--navy); margin-top: 1rem; }
.rte__area ul,
.rte__area ol { padding-left: 1.5rem; }
.rte__area li + li { margin-top: .25rem; }
.rte__area a { color: var(--accent-dark); text-decoration: underline; }
.rte__area blockquote {
  padding-left: .875rem;
  border-left: 3px solid var(--accent);
  color: var(--gray-700);
  font-style: italic;
}
.rte__area code {
  padding: .1rem .3rem;
  border-radius: 4px;
  background: var(--gray-100);
  font-family: var(--font-mono);
  font-size: .85em;
}
.rte__area pre {
  padding: .75rem .875rem;
  border-radius: var(--radius-sm);
  background: var(--navy-dark);
  color: var(--gray-100);
  overflow-x: auto;
}
.rte__area pre code { background: none; padding: 0; color: inherit; }
.rte__area img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
/* Un'immagine selezionata deve vedersi: senza, cliccarla non dà segno e
   non si capisce che il tasto Canc la toglierebbe. */
.rte__area img.ProseMirror-selectednode { outline: 2px solid var(--accent); }
.rte__area hr { border: none; border-top: 1px solid var(--gray-300); }

/* Segnaposto sul documento vuoto. Il testo arriva da `data-placeholder`,
   che scrive l'estensione Placeholder: sta nel componente insieme al
   resto delle stringhe, non incastrato in un foglio di stile. */
.rte__area p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  height: 0;
  pointer-events: none;
  color: var(--gray-500);
}

.rte__sorgente {
  display: block;
  width: 100%;
  padding: .875rem 1rem;
  border: none;
  font-family: var(--font-mono);
  font-size: .8rem;
  line-height: 1.6;
  color: var(--dark);
  resize: vertical;
}
.rte__sorgente:focus { outline: none; }

/* ── Admin Form ───────────────────────────────────────── */
.admin-form { display: flex; flex-direction: column; gap: .875rem; }
.admin-form--standalone {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.admin-form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .875rem;
}
/* Avviso dentro un form: qualcosa che vale la pena guardare prima di
   salvare, ma che non impedisce di farlo. */
.admin-avviso {
  margin: 0;
  padding: .625rem .875rem;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #854d0e;
  font-size: .875rem;
  line-height: 1.5;
}
.admin-avviso code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .9em;
}
.admin-form__footer {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--gray-100);
  margin-top: .25rem;
}
.admin-form__section-title {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--dark);
  margin: .75rem 0 .25rem;
  padding-bottom: .375rem;
  border-bottom: 1px solid var(--gray-200);
}

/* ── Admin Field ──────────────────────────────────────── */
.admin-field { display: flex; flex-direction: column; gap: .3rem; }
.admin-field__label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--gray-700);
}
.admin-field__req { color: var(--danger); margin-left: .25rem; }
.admin-field__hint { font-size: .75rem; color: var(--gray-500); margin: .2rem 0 0; }
.admin-field input,
.admin-field textarea,
.admin-field select {
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: .5rem .75rem;
  font-size: .9375rem;
  font-family: inherit;
  color: var(--dark);
  background: var(--white);
  transition: border-color .15s;
  width: 100%;
  box-sizing: border-box;
}
.admin-field input:focus,
.admin-field textarea:focus,
.admin-field select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,45,107,.1);
}
.admin-field textarea { resize: vertical; min-height: 80px; }
.admin-field select { cursor: pointer; }

/* ── Admin Lang Tabs ──────────────────────────────────── */
.admin-lang-tabs { display: flex; gap: .5rem; margin-bottom: .5rem; }
.admin-lang-tab {
  padding: .375rem .875rem;
  border-radius: 8px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--gray-500);
  transition: all .15s;
}
.admin-lang-tab--active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* ── Toggle ───────────────────────────────────────────── */
.admin-toggle { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; clip: rect(0,0,0,0); overflow: hidden; }
.admin-toggle__track {
  width: 40px; height: 22px;
  border-radius: 11px;
  background: var(--gray-300);
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.admin-toggle__track--on { background: var(--success); }
.admin-toggle__thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s;
}
.admin-toggle__track--on .admin-toggle__thumb { transform: translateX(18px); }
.admin-toggle__label { font-size: .875rem; color: var(--gray-700); }

/* ── Badge ────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2em .6em;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge--success { background: #dcfce7; color: #15803d; }
.badge--warning { background: #fef9c3; color: #a16207; }
.badge--danger  { background: #fee2e2; color: #b91c1c; }
.badge--info    { background: #dbeafe; color: #1d4ed8; }
.badge--neutral { background: var(--gray-100); color: var(--gray-500); }

/* ── Toast ────────────────────────────────────────────── */
.admin-toast-wrap {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}
.admin-toast {
  padding: .75rem 1.25rem;
  border-radius: 10px;
  font-size: .875rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  pointer-events: all;
  animation: cartFadeIn .25s ease;
  max-width: 320px;
}
.admin-toast--success { background: #f0fdf4; border: 1px solid #86efac; color: #15803d; }
.admin-toast--error   { background: #fef2f2; border: 1px solid #fca5a5; color: #b91c1c; }
.admin-toast--info    { background: #eff6ff; border: 1px solid #93c5fd; color: #1d4ed8; }

/* ── Spinner ──────────────────────────────────────────── */
.admin-spinner {
  animation: spin .8s linear infinite;
  display: inline-block;
  vertical-align: middle;
  color: currentColor;
}
.admin-loading-center {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  color: var(--gray-500);
}

/* ── Select ───────────────────────────────────────────── */
.admin-select {
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: .4rem .7rem;
  font-size: .875rem;
  background: var(--white);
  color: var(--dark);
  cursor: pointer;
}
.admin-select--sm { padding: .25rem .5rem; font-size: .8125rem; }

/* ── Image Upload ─────────────────────────────────────── */
.admin-img-upload { display: flex; flex-direction: column; gap: .5rem; }
.admin-img-preview { position: relative; display: inline-block; max-width: 200px; }
.admin-img-preview img {
  max-width: 200px; max-height: 120px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  object-fit: cover;
  display: block;
}
.admin-img-remove {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,.6);
  color: #fff; border: none; border-radius: 50%;
  width: 22px; height: 22px;
  cursor: pointer; font-size: 1rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.admin-img-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--navy);
  border: 1.5px dashed var(--gray-300);
  border-radius: 8px;
  padding: .5rem 1rem;
  background: var(--gray-50);
  transition: border-color .15s;
  width: fit-content;
}
.admin-img-btn:hover { border-color: var(--navy); background: #f0f4ff; }

/* ── Admin: galleria foto del progetto ────────────────────── */
.admin-gallery { display: flex; flex-direction: column; gap: .75rem; }
.admin-gallery__list { display: flex; flex-direction: column; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.admin-gallery__row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .5rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--gray-50);
}
.admin-gallery__thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  background: var(--gray-100);
  flex-shrink: 0;
}
.admin-gallery__fields {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  flex: 1;
  min-width: 0;   /* senza, gli input lunghi sfondano la riga flex */
}
.admin-gallery__file {
  font-size: .75rem;
  color: var(--gray-500);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-gallery__fields input {
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  padding: .3rem .55rem;
  font-size: .8125rem;
  background: var(--white);
  width: 100%;
  box-sizing: border-box;
}
.admin-gallery__actions { display: flex; flex-direction: column; gap: .25rem; flex-shrink: 0; }
.admin-gallery__actions button {
  width: 28px;
  height: 24px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: var(--white);
  color: var(--gray-700);
  cursor: pointer;
  font-size: .8125rem;
  line-height: 1;
}
.admin-gallery__actions button:hover:not(:disabled) { border-color: var(--navy); color: var(--navy); }
.admin-gallery__actions button:disabled { opacity: .35; cursor: default; }
.admin-gallery__actions .admin-gallery__del:hover { border-color: var(--danger); color: var(--danger); }
.admin-img-text {
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: .4rem .75rem;
  font-size: .8125rem;
  color: var(--gray-500);
  background: var(--white);
  width: 100%;
  box-sizing: border-box;
}

/* ── Misc ─────────────────────────────────────────────── */
.admin-empty { color: var(--gray-500); padding: 2rem 0; text-align: center; }
.admin-error { color: var(--danger); padding: 1rem 0; }
.admin-code {
  background: var(--gray-100);
  padding: .1em .4em;
  border-radius: 4px;
  font-family: monospace;
  font-size: .9em;
}
.admin-missing { color: var(--warning); font-size: .8125rem; }
.admin-badge-count {
  font-size: .8125rem; font-weight: 600;
  color: var(--gray-500); background: var(--gray-100);
  padding: .25rem .625rem; border-radius: 9999px;
}
.admin-detail { display: flex; flex-direction: column; gap: .625rem; font-size: .9375rem; }
.admin-detail p { margin: 0; }
.admin-detail__body {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 1rem;
  white-space: pre-wrap;
  font-size: .875rem;
  line-height: 1.6;
  border: 1px solid var(--gray-200);
  margin-top: .5rem;
}
.admin-pagination {
  display: flex; align-items: center;
  gap: 1rem; justify-content: center;
  margin-top: 1.25rem; font-size: .875rem;
}
.admin-pagination button {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: .375rem .75rem;
  cursor: pointer; font-size: 1rem;
  color: var(--dark); transition: background .15s;
}
.admin-pagination button:hover:not(:disabled) { background: var(--gray-100); }
.admin-pagination button:disabled { opacity: .4; cursor: default; }
.admin-side-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}

@media (max-width: 900px) {
  .admin-sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    height: 100vh;
  }
  .admin-sidebar--open { transform: translateX(0); }
  .admin-side-backdrop { display: block; }
  .admin-header__menu-btn { display: flex; }
  .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-dashboard-grid { grid-template-columns: 1fr; }
  .admin-content { padding: 1rem; }
}
@media (max-width: 600px) {
  .admin-stat-grid { grid-template-columns: 1fr 1fr; }
  .admin-form__row { grid-template-columns: 1fr; }
  .admin-login-card { padding: 1.75rem 1.25rem; }
  .admin-modal-backdrop { padding: .5rem; align-items: flex-end; }
  .admin-modal { border-radius: 16px 16px 0 0; }
}

/* ── PRINT ───────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .back-to-top, #cookie-banner-root { display: none; }
  body { font-size: 12pt; color: #000; }
  a { color: #000; text-decoration: underline; }
  /* Icone servizi in mono: su carta il rame non stacca dal navy. */
  .svc-icon__accent { stroke: currentColor; }
}
