/* =============================================================
   Parsec Solutions — Refactor front-end
   Design system globale
   Tema: dark-tech, accento blu/ciano, glassmorphism
   Autore: refactor multipage statico (HTML/CSS/JS + three.js)
   ============================================================= */

/* ---------- 1. Design tokens (variabili CSS) ---------- */
:root {
  /* Colori base */
  --bg:        #0b2138;   /* azzurro scuro — base/fondo del gradiente */
  --bg-top:    #1c4677;   /* azzurro tenue — sommità del gradiente hero */
  --bg-alt:    #123456;   /* azzurro medio — fascia sezioni alternate */
  --surface:   rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border:    rgba(255, 255, 255, 0.10);

  /* Testo */
  --text:       #e9eefb;
  --text-muted: #93a1bd;
  --text-dim:   #63708c;

  /* Accenti */
  --accent:    #3b82f6;   /* blu */
  --accent-2:  #22d3ee;   /* ciano */
  --accent-3:  #2ee6b6;   /* verde acqua (secondario, coordinato alla stella) */
  --grad: linear-gradient(120deg, var(--accent-3) 0%, var(--accent-2) 100%);      /* acquamarina → ciano (palette stella) */
  --grad-cta: linear-gradient(120deg, var(--accent-3) 0%, var(--accent-2) 100%);  /* acquamarina → ciano, palette hero */

  /* Tipografia */
  --font-head: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;

  /* Misure */
  --container: 1200px;
  --radius:   18px;
  --radius-sm: 10px;
  --nav-h:    72px;

  /* Ombre / transizioni */
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --glow:   0 0 40px -8px rgba(59, 130, 246, 0.55);
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 2. Reset di base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Sfondo con gradienti radiali "aurora" fissi dietro tutto */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 15% 0%,  rgba(59,130,246,0.15), transparent 60%),
    radial-gradient(50% 50% at 90% 10%, rgba(34,211,238,0.12), transparent 55%),
    radial-gradient(60% 60% at 50% 100%, rgba(46,230,182,0.10), transparent 60%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 65%);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---------- 3. Tipografia ---------- */
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h3 { font-size: 1.25rem; }
p  { color: var(--text-muted); }

.text-grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 4. Layout / utility ---------- */
.container { width: min(100% - clamp(1.5rem, 5vw, 3rem), var(--container)); margin-inline: auto; }

.section { padding: clamp(4rem, 9vw, 3rem) 0; position: relative; }
.section--alt { background: linear-gradient(180deg, transparent, var(--bg-alt) 20% 80%, transparent); }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-head);
  font-size: .8rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 1rem;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--accent-2); }

.section-head { max-width: 720px; margin-bottom: 3.5rem; }
.section-head p { margin-top: 1rem; font-size: 1.05rem; }

.lead { font-size: 1.15rem; color: var(--text-muted); }

/* ---------- 5. Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .85rem 1.6rem;
  border-radius: 999px;
  font-family: var(--font-head); font-weight: 500; font-size: .95rem;
  cursor: pointer;
  border: 0;                                  /* niente bordo */
  -webkit-appearance: none; appearance: none; /* rimuove il rendering nativo dei <button> (bande ai lati) */
  background-clip: padding-box;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
}
.btn:hover { transform: translateY(-3px); }
/* Gradiente "sovradimensionato e centrato": si vede solo la parte centrale fusa,
   così le estremità pure (blu/ciano) non compaiono come fasce ai lati. */
.btn--primary { background: var(--grad-cta); background-size: 200% 100%; background-position: center; color: #04211b; box-shadow: 0 10px 24px -12px rgba(46,230,182,.55); }
.btn--primary:hover { box-shadow: 0 14px 30px -12px rgba(46,230,182,.7); }
.btn--ghost { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); }
.btn svg { width: 18px; height: 18px; }

/* ---------- 6. Header / Navigazione ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(7, 11, 22, 0.72);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; width: 100%; }

.brand { display: flex; align-items: center; gap: .7rem; font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.site-header .brand { margin-left: clamp(.25rem, 2.2vw, 2rem); }
.brand .logo-mark { width: 34px; height: 34px; flex: none; }
.brand span b { color: var(--accent-2); font-weight: 700; }

.nav-links { display: flex; align-items: center; gap: .35rem; }
.nav-links > li > a {
  display: block; padding: .55rem .9rem; border-radius: 999px;
  font-size: .93rem; color: var(--text-muted);
  transition: color .2s, background .2s;
}
.nav-links > li > a:hover { color: var(--text); background: var(--surface); }
.nav-links > li > a.active { color: var(--text); }
.nav-links > li > a.active::after {
  content: ""; display: block; height: 2px; width: 60%; margin: 3px auto 0;
  background: var(--grad); border-radius: 2px;
}

/* Dropdown "Cosa Facciamo" */
.has-drop { position: relative; }
.dropdown {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(8px);
  min-width: 230px; padding: .5rem;
  background: rgba(12,18,35,.96); backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transition: .25s var(--ease);
}
.has-drop:hover .dropdown { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
/* Ponte invisibile che copre il vuoto tra voce e dropdown: evita che l'hover si perda passando il mouse */
.dropdown::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 16px; }
.dropdown a { display: block; padding: .6rem .8rem; border-radius: 8px; font-size: .9rem; color: var(--text-muted); }
.dropdown a:hover { background: var(--surface); color: var(--text); }

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

/* Hamburger mobile */
.nav-toggle { display: none; width: 42px; height: 42px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; position: relative; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 2px; background: var(--text);
  transform: translate(-50%, -50%); transition: .3s var(--ease);
}
.nav-toggle span::before { transform: translate(-50%, -7px); }
.nav-toggle span::after  { transform: translate(-50%, 5px); }
body.menu-open .nav-toggle span { background: transparent; }
body.menu-open .nav-toggle span::before { transform: translate(-50%,-50%) rotate(45deg); }
body.menu-open .nav-toggle span::after  { transform: translate(-50%,-50%) rotate(-45deg); }

/* ---------- 7. Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; overflow: hidden; }
#particles-canvas { position: absolute; inset: 0; z-index: 0; }
.hero-inner { position: relative; z-index: 2; max-width: 820px; padding-top: var(--nav-h); }
.hero h1 { margin-bottom: 1.4rem; }
.hero .lead { max-width: 620px; margin-bottom: 2.2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .6rem; margin-bottom: 1.6rem;
  padding: .4rem .9rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: .82rem; color: var(--text-muted);
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2); }

.scroll-cue { position: absolute; bottom: 1.8rem; left: 50%; transform: translateX(-50%); z-index: 2; color: var(--text-dim); font-size: .75rem; letter-spacing: .15em; text-transform: uppercase; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.scroll-cue .mouse { width: 22px; height: 36px; border: 1px solid var(--border); border-radius: 12px; position: relative; }
.scroll-cue .mouse::after { content: ""; position: absolute; top: 6px; left: 50%; width: 3px; height: 6px; background: var(--accent-2); border-radius: 2px; transform: translateX(-50%); animation: scrollWheel 1.6s infinite; }
@keyframes scrollWheel { 0% { opacity: 0; transform: translate(-50%, 0); } 40% { opacity: 1; } 80% { opacity: 0; transform: translate(-50%, 10px); } }

/* ---------- 8. Card / griglie ---------- */
.grid { display: grid; gap: 1.4rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.8rem; position: relative; overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s, background .35s;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .35s;
  pointer-events: none;   /* il bordo decorativo non deve intercettare i click (fix form) */
}
.card:hover { transform: translateY(-6px); background: var(--surface-2); }
.card:hover::before { opacity: 1; }
.card .ic { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: rgba(59,130,246,.12); color: var(--accent-2); margin-bottom: 1.2rem; }
.card .ic svg { width: 26px; height: 26px; }
.card h3 { margin-bottom: .6rem; }
.card p { font-size: .95rem; }

/* Card area principale (Cosa facciamo) con link */
.area-card { display: flex; flex-direction: column; }
.area-card .area-tag { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-2); margin-bottom: .8rem; }
.area-card .more { margin-top: 1.2rem; color: var(--text); font-family: var(--font-head); font-size: .9rem; display: inline-flex; gap: .4rem; align-items: center; }
.area-card:hover .more svg { transform: translateX(4px); }
.area-card .more svg { width: 16px; height: 16px; transition: transform .25s; }

/* ---------- 9. Split (testo + visual) ---------- */
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.split > * { min-width: 0; }                                   /* evita che il contenuto forzi la larghezza */
.split.reverse .split-media { order: -1; }
.split-media {
  aspect-ratio: 4/3; border-radius: var(--radius); border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(59,130,246,.12), rgba(34,211,238,.06));
  position: relative; overflow: hidden; display: grid; place-items: center;
}
.split-media .orbit { position: absolute; inset: 0; }

/* Lista puntata con check */
.check-list li { display: flex; gap: .8rem; align-items: flex-start; padding: .5rem 0; color: var(--text-muted); }
.check-list li svg { flex: none; width: 20px; height: 20px; color: var(--accent-2); margin-top: 3px; }

/* ---------- 10. Statistiche ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.stat { text-align: center; padding: 1.5rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.stat .num { font-family: var(--font-head); font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; }
.stat .num span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .lbl { color: var(--text-muted); font-size: .9rem; margin-top: .3rem; }

/* ---------- 11. CTA banner ---------- */
.cta-banner {
  text-align: center; padding: clamp(3rem, 6vw, 5rem);
  border-radius: calc(var(--radius) + 6px); border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(59,130,246,.14), rgba(46,230,182,.10));
  position: relative; overflow: hidden;
}
.cta-banner h2 { margin-bottom: 1rem; }
.cta-banner p { max-width: 560px; margin: 0 auto 2rem; }

/* ---------- 12. Form ---------- */
.form-grid { display: grid; gap: 1.1rem; grid-template-columns: 1fr 1fr; min-width: 0; }
.field { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }        /* i campi possono restringersi nel grid */
.field.full, .checkbox.full { grid-column: 1 / -1; }
.field label { font-size: .85rem; color: var(--text-muted); font-family: var(--font-head); }
.field input, .field textarea, .field select {
  width: 100%; min-width: 0; max-width: 100%;                                        /* niente overflow su mobile */
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .85rem 1rem; color: var(--text); font-family: inherit; font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.18); }
.field textarea { resize: vertical; min-height: 130px; }
.checkbox { display: flex; gap: .6rem; align-items: flex-start; font-size: .85rem; color: var(--text-dim); line-height: 1.4; }
.checkbox input { margin-top: .2rem; flex: none; }

/* ---------- 13. News ---------- */
.post-card { overflow: hidden; padding: 0; }
.post-card .thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, rgba(59,130,246,.2), rgba(34,211,238,.08)); display: grid; place-items: center; color: var(--accent-2); }
.post-card .thumb svg { width: 48px; height: 48px; opacity: .5; }
.post-card .body { padding: 1.5rem; }
.post-card .date { font-size: .8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .1em; }
.post-card h3 { margin: .5rem 0 .6rem; }

/* ---------- 14. Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 4rem 0 2rem;}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2.5rem; margin-bottom: 3rem; }
.footer-grid h4 { font-size: .95rem; margin-bottom: 1.1rem; color: var(--text); }
.footer-grid a, .footer-grid p { color: var(--text-muted); font-size: .92rem; display: block; padding: .28rem 0; transition: color .2s; }
.footer-grid a:hover { color: var(--accent-2); }
.footer-brand p { max-width: 280px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; padding-top: 1.6rem; border-top: 1px solid var(--border); color: var(--text-dim); font-size: .85rem; }
.socials { display: flex; gap: .6rem; }
.socials a { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 10px; color: var(--text-muted); transition: .2s; }
.socials a:hover { color: var(--accent-2); border-color: var(--accent); transform: translateY(-2px); }

/* ---------- 15. Page hero (pagine interne) ---------- */
.page-hero { padding: calc(var(--nav-h) + 4rem) 0 3rem; position: relative; }
.page-hero .breadcrumb { color: var(--text-dim); font-size: .85rem; margin-bottom: 1rem; }
.page-hero .breadcrumb a:hover { color: var(--accent-2); }
.page-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 1rem; }
.page-hero p { max-width: 640px; }

/* ---------- 16. Animazioni reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 17. Responsive ---------- */
@media (max-width: 980px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .stats   { grid-template-columns: repeat(2, 1fr); }
  .split   { grid-template-columns: 1fr; }
  .split.reverse .split-media { order: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 1rem 1.5rem 2rem;
    background: rgba(9,13,26,.98); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%); transition: transform .35s var(--ease);
    max-height: calc(100svh - var(--nav-h)); overflow-y: auto;
  }
  body.menu-open .nav-links { transform: translateY(0); }
  .nav-links > li > a { padding: .9rem .4rem; font-size: 1.05rem; border-bottom: 1px solid var(--border); border-radius: 0; }
  .nav-links > li > a.active::after { display: none; }
  .dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; background: transparent; padding: 0 0 .5rem 1rem; }
  .dropdown::before { display: none; }
  .has-drop:hover .dropdown, .has-drop .dropdown { transform: none; }
  /* Regole mobile del mega-menu spostate dopo le regole desktop (vedi sezione 25) per la corretta cascata */
  .lang-toggle { margin-right: .3rem; }
  .nav-toggle { margin-right: clamp(.5rem, 2.5vw, 2rem); }
  .nav-cta .btn { display: none; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* =============================================================
   18. STRATO CINEMATICO (ispirato allo stile "AI Studio" / Textura)
   Grana pellicola + vignettatura + hero a scroll con stella cromata 3D
   ============================================================= */

/* ---- Grana pellicola globale (iniettata via components.js) ---- */
.film-grain {
  position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 0.5s steps(2) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0,0); } 50% { transform: translate(-4%, 3%); } 100% { transform: translate(3%, -2%); }
}

/* Vignettatura globale morbida */
.vignette-global { position: fixed; inset: 0; z-index: 9997; pointer-events: none;
  background: radial-gradient(120% 100% at 50% 45%, transparent 60%, rgba(7,20,38,0.4) 100%); }

/* ---- Reveal cinematico a maschera (per titoli) ---- */
.mask-reveal { display: inline-block; overflow: hidden; vertical-align: top; }
.mask-reveal > span { display: inline-block; transform: translateY(110%); transition: transform 1s var(--ease); }
.mask-reveal.visible > span { transform: translateY(0); }

/* =========== HERO CINEMATICO (solo home) =========== */
.cinematic { position: relative; height: 320vh; }         /* altezza = durata dello scroll cinematico */

/* Fallback senza WebGL: l'hero cinematico diventa un hero statico leggibile */
.cine-fallback { height: auto !important; }
.cine-fallback .cinematic-sticky { position: static; height: auto; min-height: 82vh; }
.cine-fallback .scroll-cue { display: none; }
.cinematic-sticky {
  position: sticky; top: 0; height: 100vh; width: 100%;
  overflow: hidden; display: grid; place-items: center;
}
#cine-canvas { position: absolute; inset: 0; z-index: 0; }

/* Vignetta locale dell'hero, più intensa */
.cine-vignette { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(90% 78% at 50% 42%, transparent 58%, rgba(7,20,38,0.42) 100%),
    linear-gradient(180deg, rgba(7,20,38,0.28), transparent 22% 50%, rgba(7,20,38,0.48)); }

/* Contenitore degli stage di testo cinetico */
.cine-stages { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; text-align: center; pointer-events: none; }
.cine-stage {
  grid-area: 1 / 1; width: min(100% - 3rem, 1100px); margin-inline: auto;
  opacity: 0; will-change: opacity, transform;
}
.cine-stage.pointer { pointer-events: auto; }

.kinetic {
  font-family: var(--font-head); font-weight: 700; letter-spacing: -0.03em; line-height: 0.98;
  font-size: clamp(2.8rem, 9vw, 7rem);
  text-shadow: 0 0 60px rgba(88, 116, 227, 0.35);
}
.kinetic .thin { font-weight: 400; color: var(--text-muted); }
.cine-stage .sub { max-width: 560px; margin: 1.4rem auto 0; font-size: 1.1rem; color: var(--text-muted); }
.cine-stage .hero-actions { justify-content: center; margin-top: 2rem; }

/* Etichetta piccola sopra i titoli cinetici */
.cine-eyebrow { display: inline-flex; align-items: center; gap: .6rem; margin-bottom: 1.4rem;
  font-family: var(--font-head); font-size: .8rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent-2); }
.cine-eyebrow::before, .cine-eyebrow::after { content: ""; width: 30px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-2)); }
.cine-eyebrow::after { background: linear-gradient(90deg, var(--accent-2), transparent); }

/* Indicatore di scroll dentro l'hero cinematico */
.cinematic .scroll-cue { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); z-index: 3; }

@media (max-width: 720px) {
  .cinematic { height: 300vh; }
  .kinetic { font-size: clamp(2.4rem, 13vw, 4rem); }
}

/* =============================================================
   19. SFONDO ANIMATO PROFESSIONALE (bg-field.js)
   ============================================================= */
#bg-field {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.9;
  -webkit-mask-image: radial-gradient(120% 100% at 50% 40%, #000 55%, transparent 100%);
          mask-image: radial-gradient(120% 100% at 50% 40%, #000 55%, transparent 100%);
}

/* =============================================================
   20. SEZIONE SCROLL-SCALE — card da fullscreen a card
   ============================================================= */
.scale-scene { position: relative; height: 220vh; }
.scale-sticky { position: sticky; top: 0; height: 100vh; display: grid; place-items: center; overflow: hidden; }
.scale-card {
  position: relative; width: 100%; height: 100vh; overflow: hidden;
  display: grid; place-items: center; text-align: center;
  border-radius: 0; will-change: transform, border-radius;
  background:
    radial-gradient(90% 120% at 20% 0%, rgba(46,230,182,0.28), transparent 55%),
    radial-gradient(90% 120% at 100% 100%, rgba(34,211,238,0.22), transparent 55%),
    linear-gradient(160deg, #0c2036, #060d18);
  box-shadow: 0 40px 120px -30px rgba(0,0,0,0.9);
}
.scale-card::after {   /* bordo luminoso */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(120deg, rgba(46,230,182,0.6), rgba(34,211,238,0.5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .4s;
}
.scale-card.framed::after { opacity: 1; }
.scale-card .sc-inner { position: relative; z-index: 2; width: min(100% - 3rem, 860px); padding: 2rem; }
.scale-card .sc-eyebrow { font-family: var(--font-head); font-size: .8rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent-2); }
.scale-card h2 { margin: 1rem 0 1.2rem; font-size: clamp(2rem, 5vw, 3.6rem); }
.scale-card p { max-width: 620px; margin: 0 auto; font-size: 1.1rem; }
.scale-card .mock-row { display: flex; gap: 1rem; justify-content: center; margin-top: 2.2rem; flex-wrap: wrap; }
.scale-card .mock-pill { padding: .6rem 1.1rem; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,0.05); font-size: .85rem; color: var(--text-muted); font-family: var(--font-head); }

/* =============================================================
   21. CAROSELLO 3D DI CARD ROTANTI
   ============================================================= */
.carousel-scene { position: relative; padding: clamp(3rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3.5rem); overflow: hidden; }
.carousel-scene .section-head { text-align: center; margin-inline: auto; }
.carousel-scene .eyebrow { justify-content: center; }
.carousel-scene .eyebrow::before { display: none; }

.stage3d { position: relative; height: 420px; perspective: 1400px; margin-top: 1.5rem; }
.ring {
  position: absolute; inset: 0; margin: auto; width: 300px; height: 380px;
  transform-style: preserve-3d; cursor: grab;
  transition: transform .05s linear;
}
.ring:active { cursor: grabbing; }
.ring-card {
  position: absolute; inset: 0; width: 300px; height: 380px;
  border-radius: 20px; overflow: hidden;
  display: flex; flex-direction: column;
  border: 1px solid rgba(255,255,255,0.14);
  background: linear-gradient(180deg, rgba(46,230,182,0.10), rgba(9,26,44,0.96));
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.8);
  backface-visibility: hidden;
}
/* Foto cliccabile: 1/3 superiore, sfuma nel corpo card */
.ring-card .rc-photo {
  position: relative; display: block; flex: 0 0 34%;
  background: var(--img) center/cover no-repeat;
  cursor: pointer; text-decoration: none;
}
.ring-card .rc-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(9,26,44,0.10) 30%, rgba(9,26,44,0.98));
}
.ring-card .rc-index { position: absolute; top: .9rem; left: 1.2rem; z-index: 2; font-family: var(--font-head); font-size: .78rem; letter-spacing: .14em; color: var(--accent-3); text-shadow: 0 1px 6px rgba(0,0,0,.7); }
/* Corpo testo: 2/3 inferiore */
.ring-card .rc-body { position: relative; flex: 1 1 auto; padding: 1.2rem 1.5rem 1.4rem; display: flex; flex-direction: column; color: var(--text); }
.ring-card h3 { font-size: 1.25rem; line-height: 1.15; margin-bottom: .5rem; padding-right: .5rem; }
.ring-card p { font-size: .88rem; color: rgba(233,238,251,0.78); line-height: 1.5; }
/* Icona: ancorata in basso a destra, non si sovrappone al testo */
.ring-card .rc-ic { position: absolute; right: 1.3rem; bottom: 1.2rem; z-index: 3; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(135deg, var(--accent-3), var(--accent-2)); color: #04211b; box-shadow: 0 8px 20px -8px rgba(46,230,182,.6); }
.ring-card .rc-ic svg { width: 22px; height: 22px; }
/* CTA cliccabile: in basso a sinistra, riserva spazio all'icona */
.ring-card .rc-cta { margin-top: auto; padding-top: 1rem; padding-right: 64px; display: inline-flex; align-items: center; gap: .4rem; font-family: var(--font-head); font-size: .82rem; font-weight: 600; letter-spacing: .04em; color: var(--accent-3); cursor: pointer; text-decoration: none; }
.ring-card .rc-cta svg { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.ring-card:hover .rc-cta svg, .ring-card .rc-cta:hover svg { transform: translateX(4px); }
.carousel-hint { text-align: center; margin-top: 2.4rem; color: var(--text-dim); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; }

@media (max-width: 720px) {
  .scale-scene { height: 200vh; }
  .stage3d { height: 400px; }
  .ring, .ring-card { width: 240px; height: 320px; }
}

/* =============================================================
   22. STATO DEI FORM + EFFETTI LEGGERI PAGINE INTERNE
   ============================================================= */
.form-status { margin-top: 1.2rem; font-size: .92rem; display: none; padding: .85rem 1.1rem; border-radius: var(--radius-sm); }
.form-status.ok  { display: block; color: #8ff0c8; background: rgba(34,211,120,0.10); border: 1px solid rgba(34,211,120,0.32); }
.form-status.err { display: block; color: #ffb4b4; background: rgba(255,90,90,0.10); border: 1px solid rgba(255,90,90,0.32); }

/* Input file un po' più leggibile sul tema scuro */
.field input[type="file"] { padding: .6rem 1rem; cursor: pointer; }
.field input[type="file"]::-webkit-file-upload-button,
.field input[type="file"]::file-selector-button {
  margin-right: .9rem; padding: .5rem .9rem; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-family: var(--font-head); font-size: .85rem;
}

/* Accento glow animato nel page-hero (solo CSS, zero peso JS) */
.page-hero { overflow: hidden; }
.page-hero .container { position: relative; z-index: 1; }
.page-hero::after {
  content: ""; position: absolute; z-index: 0; top: -160px; right: -120px;
  width: 460px; height: 460px; border-radius: 50%; filter: blur(40px); opacity: .55;
  background: conic-gradient(from 0deg, rgba(46,230,182,0), rgba(59,130,246,.35), rgba(34,211,238,.35), rgba(46,230,182,0));
  animation: spinAccent 26s linear infinite;
  pointer-events: none;
}
@keyframes spinAccent { to { transform: rotate(360deg); } }

/* Card 3D tilt (transizione morbida quando il cursore lascia la card) */
.card.tiltable { transition: transform .3s var(--ease), border-color .35s, background .35s; transform-style: preserve-3d; }

@media (prefers-reduced-motion: reduce) {
  .page-hero::after { animation: none; }
}

/* =============================================================
   23. FOTOGRAFIE — trattamento coerente col tema scuro
   L'immagine si imposta via variabile inline --img; sopra viene
   stesa un'overlay scura + leggera tinta brand per fondersi.
   ============================================================= */
/* Split-media (decorativi, nessun testo sopra): overlay minimo + resa vivace */
.split-media.media-photo {
  background:
    linear-gradient(180deg, rgba(6,8,20,0.04), rgba(6,8,20,0.20)),
    var(--img) center/cover no-repeat;
  filter: saturate(1.15) brightness(1.08) contrast(1.02);
}

/* Card con foto (testo che riempie la card): foto ricca e SATURA ma meno brillante,
   così i colori restano vivi e coerenti col tema scuro, e il testo bianco resta
   sempre leggibile grazie a scrim uniforme + ombra netta. */
.card.card-photo {
  background:
    linear-gradient(180deg, rgba(5,7,16,0.64) 0%, rgba(5,7,16,0.58) 42%, rgba(5,7,16,0.88) 100%),
    var(--img) center/cover no-repeat !important;
  filter: saturate(1.28) brightness(0.85);
}
.card.card-photo .ic { background: rgba(255,255,255,0.18); backdrop-filter: blur(4px); }
.card.card-photo h3 { color: #ffffff; text-shadow: 0 1px 3px rgba(0,0,0,0.95); }
.card.card-photo p  { color: rgba(242,246,255,0.97); text-shadow: 0 1px 4px rgba(0,0,0,0.95); }

/* Ring-card del carosello (testo in basso): foto luminosa in alto, scuro solo sul fondo */
.ring-card.card-photo {
  background:
    linear-gradient(180deg, rgba(10,6,20,0.06) 0%, rgba(6,8,20,0.30) 50%, rgba(6,8,20,0.85) 100%),
    var(--img) center/cover no-repeat !important;
  filter: saturate(1.12) brightness(1.05);
}
.ring-card.card-photo h3, .ring-card.card-photo p { text-shadow: 0 1px 10px rgba(0,0,0,0.72); }

/* =============================================================
   24. PHOTO CARD — tecnica "Gradient Overlay" (immagine nitida in alto,
   sfumatura scura in basso, testo ancorato in fondo, zoom su hover).
   Struttura: .p-card > .p-card__img + .p-card__grad + .p-card__body
   ============================================================= */
.p-grid { display: grid; gap: 1.4rem; grid-template-columns: repeat(3, 1fr); }

.p-card {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 360px; border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex; flex-direction: column; justify-content: flex-end;
  text-decoration: none;
}

/* Livello immagine: resta brillante e nitido, si zooma leggermente su hover */
.p-card__img {
  position: absolute; inset: 0; z-index: 0;
  background: var(--img) center/cover no-repeat;
  transition: transform .5s var(--ease);
}
.p-card:hover .p-card__img { transform: scale(1.06); }

/* Sfumatura scura dal basso per la leggibilità del testo */
.p-card__grad {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(6,13,24,0.94) 10%, rgba(6,13,24,0.55) 45%, rgba(6,13,24,0.12) 75%, transparent);
}

.p-card__body { position: relative; z-index: 2; padding: 1.7rem; }
.p-card__ic {
  width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 13px; margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2)); color: #04211b;
  box-shadow: 0 8px 20px -8px rgba(46,230,182,.55);
}
.p-card__ic svg { width: 24px; height: 24px; }
.p-card__title { font-family: var(--font-head); font-weight: 600; font-size: 1.3rem; color: #fff; margin-bottom: .45rem; }
.p-card__text { color: rgba(233,238,251,0.82); font-size: .92rem; line-height: 1.55; }

/* Griglia photo-card responsive */
@media (max-width: 900px) { .p-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .p-grid { grid-template-columns: 1fr; } }

/* =============================================================
   25. MEGA MENU (Solutions, 3 colonne) — centrato, tema scuro
   ============================================================= */
.dropdown.mega {
  display: grid; grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 0; padding: 0;
  width: min(760px, calc(100vw - 3rem));
  max-width: calc(100vw - 3rem);
}
/* Il mega-menu si centra sul viewport invece che sotto la voce "Soluzioni":
   su schermi stretti (es. 748px) non sborda più dai lati e resta centrato. */
.has-drop.has-mega { position: static; }
.mega-col { padding: 1.1rem 1.2rem; border-left: 1px solid var(--border); }
.mega-col:first-child { border-left: 0; }
.mega-col__title { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; margin: 0; padding: 0; background: none; border: 0; text-align: left; cursor: default; font-family: var(--font-head); font-weight: 700; font-size: .95rem; color: var(--text); }
.mega-col__chev { width: 18px; height: 18px; flex: none; display: none; }
.mega-col__list { display: block; }
.mega-col__sub { display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-3); margin: .15rem 0 .8rem; }
.mega-col a { display: block; padding: .42rem .6rem; font-size: .88rem; color: var(--text-muted); border-left: 2px solid transparent; transition: color .18s, background .18s, border-color .18s; }
.mega-col a:hover { color: var(--text); background: var(--surface); border-left-color: var(--accent-3); }
/* Voce informativa del mega-menu senza reindirizzamento (es. SAP BI) */
.mega-col .mega-item--static { display: block; padding: .42rem .6rem; font-size: .88rem; color: var(--text-muted); border-left: 2px solid transparent; cursor: default; opacity: .8; }
/* Voce di richiamo "Scopri" evidenziata in verde */
.mega-col a.mega-item--cta { color: var(--accent-3); font-weight: 600; }
.mega-col a.mega-item--cta:hover { color: var(--accent-3); background: var(--surface); border-left-color: var(--accent-3); }
@media (max-width: 820px) and (min-width: 721px) {
  /* Tablet: mega compatto a 3 colonne strette e centrato, non una singola colonna altissima */
  .dropdown.mega { grid-template-columns: repeat(3, minmax(140px, 1fr)); width: min(680px, calc(100vw - 2rem)); }
  .mega-col { padding: .8rem .7rem; }
}

@media (max-width: 720px) {
  /* Menu hamburger: le 3 sottocategorie sono IMPILATE (una sotto l'altra) come le altre voci,
     e ognuna è un accordion che apre le proprie voci al tap. */
  .dropdown.mega { display: block; grid-template-columns: none; width: auto; max-width: 100%; padding: 0 0 0 1rem; }
  .mega-col, .mega-col:first-child { padding: 0; border-left: 0; }
  .mega-col__title { padding: .85rem .2rem; cursor: pointer; border-top: 1px solid var(--border); }
  .mega-col__chev { display: block; transition: transform .25s var(--ease); }
  .mega-col.open .mega-col__chev { transform: rotate(180deg); }
  .mega-col__list { overflow: hidden; max-height: 0; transition: max-height .32s var(--ease); padding-left: .5rem; }
  .mega-col.open .mega-col__list { max-height: 520px; }
  .mega-col__sub { margin-bottom: .35rem; }
}

/* =============================================================
   26. PIRAMIDE 3D (hero Solutions)
   ============================================================= */
.pyramid-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; margin-top: 2rem; }
.pyramid-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
#pyramid-3d-container { width: 100%; max-width: 420px; height: 420px; }
.pyramid-labels { display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.pyr-label {
  font-family: var(--font-head); font-size: .82rem; letter-spacing: .04em;
  padding: .3rem .9rem; border: 1px solid transparent; border-radius: 999px;
  color: #708299; transition: color .25s, border-color .25s;
}
.pyramid-cards { position: relative; min-height: 260px; }
.pyr-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem 1.7rem;
}
.pyr-card h3 { font-size: 1.35rem; margin-bottom: .5rem; }
.pyr-card p { color: var(--text-muted); font-size: .95rem; line-height: 1.55; margin-bottom: 1rem; }
.pyr-card .pyr-tag { display: inline-block; font-family: var(--font-head); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-3); margin-bottom: .6rem; }
.pyr-card .more { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--font-head); font-size: .85rem; font-weight: 600; color: var(--accent-3); }
.pyr-card .more svg { width: 16px; height: 16px; }
.hidden { display: none !important; }
.block  { display: block !important; }
@media (max-width: 820px) {
  .pyramid-layout { grid-template-columns: 1fr; }
  #pyramid-3d-container { height: 340px; }
}

/* =============================================================
   27. SAP ASSESSMENT (check-up quiz)
   ============================================================= */
.sa-card {
  max-width: 720px; margin: 0 auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(1.6rem, 4vw, 2.6rem);
}
.sa-card[data-state="quiz"] .sa-result { display: none; }
.sa-card[data-state="result"] .sa-quiz { display: none; }

.sa-progress { height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.sa-progress__fill { height: 100%; width: 0; background: var(--grad-cta); border-radius: inherit; transition: width .35s var(--ease); }
.sa-progress__label { display: block; margin: .8rem 0 .3rem; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.sa-question { font-size: 1.3rem; line-height: 1.3; margin: .4rem 0 1.3rem; }
.sa-opts { display: flex; flex-direction: column; gap: .7rem; }
.sa-opt {
  text-align: left; width: 100%; padding: .95rem 1.1rem; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font-body); font-size: .95rem;
  transition: border-color .2s, background .2s, transform .1s;
}
.sa-opt:hover { border-color: var(--accent-3); background: var(--surface-2); }
.sa-opt[aria-pressed="true"] { border-color: var(--accent-3); box-shadow: 0 0 0 1px var(--accent-3) inset; }
.sa-back { margin-top: 1.2rem; background: none; border: 0; color: var(--text-muted); cursor: pointer; font-family: var(--font-head); font-size: .85rem; }
.sa-back:hover { color: var(--text); }

.sa-result { text-align: center; }
.sa-score { font-family: var(--font-head); font-weight: 700; font-size: clamp(2.4rem, 7vw, 3.4rem); color: transparent; background: var(--grad-cta); -webkit-background-clip: text; background-clip: text; }
.sa-meter { display: flex; justify-content: center; gap: .5rem; margin: 1rem 0 1.4rem; }
.sa-meter span { width: 44px; height: 8px; border-radius: 999px; background: var(--surface-2); transition: background .3s; }
.sa-result[data-tone="ok"]   .sa-meter span.is-on { background: var(--accent-3); }
.sa-result[data-tone="warn"] .sa-meter span.is-on { background: #f5b544; }
.sa-level { font-size: 1.5rem; margin-bottom: .6rem; }
.sa-result[data-tone="warn"] .sa-level { color: #f5c877; }
.sa-verdict { color: var(--text-muted); max-width: 560px; margin: 0 auto 1.5rem; line-height: 1.6; }
.sa-recs { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.2rem 1.4rem; margin-bottom: 1.5rem; }
.sa-recs h4 { font-size: .95rem; margin-bottom: .7rem; color: var(--text); }
.sa-recs ul { display: flex; flex-direction: column; gap: .6rem; }
.sa-recs li { position: relative; padding-left: 1.4rem; color: var(--text-muted); font-size: .9rem; line-height: 1.5; }
.sa-recs li::before { content: ""; position: absolute; left: 0; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-3); }
.sa-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

/* Stato iniziale della scena ZOOM-IN: card piccola, poi cresce via JS */
.scale-scene--in .scale-card { transform: scale(0.7); border-radius: 40px; }

/* Toggle lingua IT/EN con bandierine */
.lang-toggle { display: inline-flex; align-items: center; gap: .55rem; margin-right: 1.5rem; padding: .3rem .7rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-family: var(--font-head); font-size: .74rem; letter-spacing: .03em; cursor: pointer; transition: background .2s, border-color .2s; }
.lang-toggle:hover { background: var(--surface-2); border-color: var(--accent-3); }
.lang-toggle .lt-it, .lang-toggle .lt-en { display: inline-flex; align-items: center; gap: .35rem; color: var(--text-dim); opacity: .55; transition: color .2s, opacity .2s; }
.lang-toggle .is-on { color: var(--accent-3); opacity: 1; font-weight: 700; }
.lt-flag { width: 20px; height: 13px; border-radius: 2px; display: block; box-shadow: 0 0 0 1px rgba(255,255,255,.18); overflow: hidden; }
@media (max-width: 480px) { .lang-toggle .lt-it span, .lang-toggle .lt-en { } .lang-toggle { gap: .4rem; padding: .28rem .5rem; } }

/* File input personalizzato (Lavora con noi) */
.file-input { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.file-input__native { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.file-input__btn { display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1.1rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-family: var(--font-head); font-size: .9rem; cursor: pointer; transition: border-color .2s, background .2s; }
.file-input__btn:hover { border-color: var(--accent-3); background: var(--surface); }
.file-input__native:focus + .file-input__btn { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.18); }
.file-input__name { font-size: .88rem; color: var(--text-dim); }


/* =============================================================
   PARTNER SELECTOR (pagina Partner) — reel coverflow "stile GTA"
   ============================================================= */
.partner-selector { display: grid; grid-template-columns: 1.35fr 1fr; gap: 2.5rem; align-items: center; margin-top: 2.5rem; }
.partner-selector:focus { outline: none; }

/* --- Palco 3D --- */
.ps-stage { position: relative; height: 440px; display: flex; align-items: center; justify-content: center; }
.ps-reel { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; perspective: 1400px; }

.ps-card { position: absolute; inset: 0; margin: auto; width: 300px; height: 340px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); backdrop-filter: blur(6px); overflow: hidden; cursor: pointer; will-change: transform, opacity; transition: transform .6s var(--ease), opacity .45s var(--ease), filter .45s var(--ease), box-shadow .4s; }
.ps-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(46,230,182,.10), transparent 45%); opacity: 0; transition: opacity .4s; pointer-events: none; }
.ps-card.is-active { border-color: rgba(46,230,182,.55); box-shadow: 0 24px 70px -20px rgba(0,0,0,.8), 0 0 42px -10px rgba(46,230,182,.5); cursor: default; }
.ps-card.is-active::before { opacity: 1; }
.ps-card--pending { filter: grayscale(.85) brightness(.7); }
.ps-card--pending.is-active { filter: grayscale(.4) brightness(.9); }

.ps-card__inner { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 2rem 1.6rem; text-align: center; }
.ps-logo { display: flex; align-items: center; justify-content: center; height: 96px; width: 100%; }
.ps-card__name { display: none; margin-top: .5rem; font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; letter-spacing: .01em; text-align: center; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ps-logo.has-img + .ps-card__name { display: block; }
.ps-logo__img { max-height: 96px; max-width: 100%; object-fit: contain; }
.ps-logo__word { font-family: var(--font-head); font-weight: 700; font-size: 1.55rem; letter-spacing: .01em; color: var(--text); background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ps-logo.has-img .ps-logo__word { display: none; }

.ps-ribbon { position: absolute; top: 30px; right: -52px; width: 196px; padding: .45rem 0; transform: rotate(45deg); background: rgba(255,255,255,.94); color: #0b2138; font-family: var(--font-head); font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; text-align: center; white-space: nowrap; box-shadow: 0 8px 18px -8px rgba(0,0,0,.7); }

/* --- Frecce --- */
.ps-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 40; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); cursor: pointer; backdrop-filter: blur(8px); transition: border-color .2s, background .2s, transform .2s; }
.ps-nav svg { width: 22px; height: 22px; }
.ps-nav--prev { left: -6px; }
.ps-nav--next { right: -6px; }
.ps-nav:hover { border-color: var(--accent-3); background: var(--surface); }
.ps-nav:active { transform: translateY(-50%) scale(.92); }

/* --- Pannello laterale --- */
.ps-panel { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
.ps-status { font-family: var(--font-head); font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: .34rem .8rem; border-radius: 999px; border: 1px solid var(--border); }
.ps-status.is-active { color: #06231b; background: var(--accent-3); border-color: transparent; }
.ps-status.is-pending { color: var(--text-muted); background: rgba(255,255,255,.06); }
.ps-name { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.05; margin: 0; }
.ps-topic { font-family: var(--font-head); font-size: .95rem; font-weight: 600; letter-spacing: .04em; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ps-desc { color: var(--text-muted); line-height: 1.7; margin: .2rem 0 .4rem; max-width: 42ch; }
.ps-action { min-height: 48px; }
.ps-cta { display: inline-flex; align-items: center; gap: .6rem; padding: .8rem 1.4rem; border-radius: var(--radius-sm); font-family: var(--font-head); font-weight: 600; font-size: .95rem; background: var(--grad-cta); color: #06231b; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.ps-cta svg { width: 18px; height: 18px; }
.ps-cta:hover { transform: translateX(3px); box-shadow: 0 0 30px -8px rgba(46,230,182,.6); }
.ps-cta--disabled { background: rgba(255,255,255,.06); color: var(--text-dim); border: 1px dashed var(--border); cursor: not-allowed; }
.ps-cta--disabled:hover { transform: none; box-shadow: none; }

.ps-dots { display: flex; gap: .5rem; margin-top: .6rem; }
.ps-dot { width: 9px; height: 9px; border-radius: 999px; padding: 0; border: none; background: rgba(255,255,255,.2); cursor: pointer; transition: width .3s var(--ease), background .3s; }
.ps-dot.is-on { width: 26px; background: var(--accent-3); }

.ps-panel--in .ps-name, .ps-panel--in .ps-topic, .ps-panel--in .ps-desc, .ps-panel--in .ps-status { animation: psIn .5s var(--ease) both; }
@keyframes psIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .ps-card { transition: none; }
  .ps-panel--in .ps-name, .ps-panel--in .ps-topic, .ps-panel--in .ps-desc, .ps-panel--in .ps-status { animation: none; }
}

@media (max-width: 860px) {
  .partner-selector { grid-template-columns: 1fr; gap: 1.5rem; }
  .ps-stage { height: 360px; }
  .ps-card { width: 240px; height: 290px; }
  .ps-logo { height: 74px; }
  .ps-logo__img { max-height: 74px; }
  .ps-logo__word { font-size: 1.3rem; }
  .ps-nav--prev { left: 2px; }
  .ps-nav--next { right: 2px; }
  .ps-panel { align-items: center; text-align: center; }
  .ps-desc { max-width: none; }
}
