/* Buntis per gli studi professionali. Base: css/styles.css di buntis.it, blocchi nuovi in fondo. */
:root {
  --color-bg: #FAFAF8;
  --color-bg-subtle: #F3F2EE;
  --color-bg-muted: #ECEAE3;
  --color-surface: #FFFFFF;
  --color-navy: #0F1B35;
  --color-navy-mid: #1A2D52;
  --color-navy-light: #2A4070;
  --color-emerald: #1D9E75;
  --color-emerald-dark: #0F6E56;
  --color-emerald-pale: #E1F5EE;
  --color-warning: #D97706;
  --color-warning-pale: #FDF1E3;
  --color-warning-ink: #9A4A03;
  --color-danger: #DC2626;
  --color-ink: #0F1B35;
  --color-ink-soft: #4A5568;
  --color-paper: #FAFAF8;
  --color-paper-soft: rgba(250, 250, 248, 0.82);
  --color-paper-veil: rgba(250, 250, 248, 0.12);
  --color-line: rgba(15, 27, 53, 0.10);
  --color-line-strong: rgba(15, 27, 53, 0.20);
  --grid-line: rgba(15, 27, 53, 0.05);
  --blot-emerald: rgba(29, 158, 117, 0.55);
  --blot-emerald-soft: rgba(29, 158, 117, 0.32);
  --blot-navy-light: rgba(42, 64, 112, 0.9);
  --blot-navy-mid: rgba(26, 45, 82, 0.95);

  --font-display: 'DM Sans', system-ui, sans-serif;
  --font-body: 'Geist', system-ui, sans-serif;

  --step-small: 0.875rem;                        /* 14 */
  --step-body: 1rem;                             /* 16 */
  --step-lead: 1.125rem;                         /* 18 */
  --step-sub: clamp(1.25rem, 1.6vw, 1.5rem);     /* 20-24 */
  --step-head: clamp(2rem, 3.4vw, 3rem);         /* 32-48 */
  --step-hero: clamp(2.5rem, 4.8vw, 4.25rem);    /* 40-68 */

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --margin: clamp(16px, 3vw, 40px);
  --max: 1240px;
  --section: clamp(96px, 11vw, 160px);
  --ease: cubic-bezier(.16, 1, .3, 1);

  /* Grana astratta (SVG feTurbulence) per hero e chiusura */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; scrollbar-color: var(--color-navy-light) var(--color-bg-muted); }
body { font-family: var(--font-body); font-size: var(--step-body); font-weight: 400; line-height: 1.6; color: var(--color-ink); background: var(--color-bg); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-underline-offset: 0.2em; }
ul, ol { list-style: none; }
b, strong { font-weight: 500; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--color-emerald-pale); color: var(--color-navy); }
:focus-visible { outline: 2px solid var(--color-emerald); outline-offset: 3px; border-radius: 4px; }
input, textarea { caret-color: var(--color-emerald); }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--color-navy); color: var(--color-paper); padding: 8px 16px; border-radius: var(--radius-sm); z-index: 100; }
.skip:focus { left: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.frame { max-width: var(--max); margin: 0 auto; padding: 0 var(--margin); }
.soft { color: var(--color-ink-soft); }
.small { font-size: var(--step-small); }

/* Tipografia (eyebrow: DM Sans maiuscolo, regola del brand, mai a pillola) */
.eyebrow { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-emerald-dark); margin-bottom: 16px; }
.h2, .wordmark { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.022em; }
.h2 { font-size: var(--step-head); line-height: 1.05; text-wrap: balance; }
.h3 { font-size: var(--step-sub); font-family: var(--font-display); font-weight: 500; line-height: 1.15; }
.lead { font-size: var(--step-lead); line-height: 1.55; color: var(--color-ink-soft); }

/* Bottoni: pillola del brand */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: var(--step-body); font-weight: 400; text-decoration: none; padding: 12px 26px; border-radius: var(--radius-full); border: 0; cursor: pointer; background: #188461; color: var(--color-paper); transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease); }
.btn:hover { background: var(--color-emerald-dark); color: var(--color-paper); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn--ink { background: var(--color-navy); color: var(--color-paper); }
/* Accedi nella testata: secondario, per chi è già cliente */
.top__login { background: transparent; color: var(--color-ink); border: 0.5px solid var(--color-line-strong); }
.top__login:hover { background: transparent; color: var(--color-ink); border-color: var(--color-navy); }
.btn--ink:hover { background: var(--color-navy-light); color: var(--color-paper); }
.btn--paper { background: var(--color-paper); color: var(--color-navy); }
.btn--paper:hover { background: var(--color-emerald); color: var(--color-navy); }
.link { text-decoration: underline; transition: color .2s var(--ease); }
.link:hover { color: var(--color-emerald-dark); }

.dash li { position: relative; padding-left: 1.5em; margin-bottom: 0.5em; }
.dash li::before { content: "—"; position: absolute; left: 0; color: var(--color-emerald-dark); }

/* Barra di navigazione */
.top { position: sticky; top: 0; z-index: 30; background: var(--color-bg); border-bottom: 0.5px solid transparent; transition: border-color .25s var(--ease); }
.top.is-scrolled { border-bottom-color: var(--color-line); }
.top__bar { display: flex; justify-content: space-between; align-items: center; gap: 24px; height: 72px; }
.top .wordmark { font-size: 1.75rem; line-height: 1; text-decoration: none; }
.top__links { display: flex; gap: 28px; align-items: center; font-size: var(--step-small); }
.top__links a { text-decoration: none; transition: color .2s var(--ease); }
.top__links a:not(.btn):hover, .top__links a[aria-current] { color: var(--color-emerald-dark); }
.top__links .btn { padding: 9px 20px; font-size: var(--step-small); }
.top__menu { display: none; background: none; border: 0.5px solid var(--color-line-strong); border-radius: var(--radius-full); padding: 6px 16px; font-size: var(--step-small); cursor: pointer; }

/* Superficie astratta: navy con macchie smeraldo e grana */
.abstract { position: relative; isolation: isolate; overflow: hidden; background: var(--color-navy); color: var(--color-paper); }
.abstract::before { content: ""; position: absolute; inset: -20%; z-index: -2;
  background:
    radial-gradient(40% 50% at 18% 30%, var(--blot-emerald), transparent 70%),
    radial-gradient(35% 45% at 82% 70%, var(--blot-emerald-soft), transparent 70%),
    radial-gradient(45% 55% at 60% 10%, var(--blot-navy-light), transparent 70%),
    radial-gradient(40% 50% at 30% 95%, var(--blot-navy-mid), transparent 70%);
  filter: blur(20px);
}
.abstract::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--grain); opacity: .18; mix-blend-mode: overlay; }
@media (prefers-reduced-motion: no-preference) {
  .abstract::before { animation: drift 24s ease-in-out infinite alternate; }
  @keyframes drift { to { transform: translate3d(3%, -2%, 0) scale(1.06); } }
}

/* HERO */
.hero { padding: 8px var(--margin) 0; }
.hero__card { max-width: calc(var(--max) + 120px); margin: 0 auto; border-radius: var(--radius-lg); min-height: min(76svh, 720px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: clamp(72px, 10vw, 128px) var(--margin); }
.hero__tag { display: inline-block; font-size: var(--step-small); background: var(--color-paper-veil); border-radius: var(--radius-full); padding: 6px 16px; margin-bottom: 28px; }
.hero h1 { font-family: var(--font-display); font-weight: 500; font-size: var(--step-hero); line-height: 1.02; letter-spacing: -0.025em; max-width: 16ch; text-wrap: balance; }
.hero__sub { margin-top: 24px; font-size: var(--step-lead); line-height: 1.55; max-width: 46ch; color: var(--color-paper-soft); }
.hero__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 24px; align-items: center; margin-top: 36px; }
.hero__cta .link { color: var(--color-paper); }
.hero__cta .link:hover { color: var(--color-emerald); }

/* Sezioni */
.section { padding-top: var(--section); }
.head-split { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: end; }
.head-center { text-align: center; max-width: 720px; margin: 0 auto; }
.head-center .lead { margin-top: 16px; }

/* PRODOTTO: passi a sinistra, illustrazione a destra */
.flow { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(32px, 5vw, 72px); margin-top: clamp(48px, 6vw, 80px); align-items: start; }
.flow__steps { display: flex; flex-direction: column; gap: 4px; }
.flow__step { text-align: left; background: none; border: 0; cursor: pointer; padding: 20px 20px 20px 24px; border-radius: var(--radius); position: relative; transition: background .3s var(--ease); }
.flow__step::before { content: ""; position: absolute; left: 0; top: 20px; bottom: 20px; width: 2px; border-radius: 2px; background: var(--color-line); transition: background .3s var(--ease); }
.flow__step:hover, .flow__step[aria-selected="true"] { background: var(--color-bg-subtle); }
.flow__step[aria-selected="true"]::before { background: var(--color-emerald); }
.flow__title { display: block; font-family: var(--font-display); font-size: var(--step-sub); font-weight: 500; line-height: 1.3; color: var(--color-ink-soft); transition: color .3s var(--ease); }
.flow__step[aria-selected="true"] .flow__title { color: var(--color-ink); }
.flow__text { display: block; margin-top: 8px; color: var(--color-ink-soft); max-height: 0; overflow: hidden; opacity: 0; transition: max-height .5s var(--ease), opacity .4s var(--ease); }
.flow__step[aria-selected="true"] .flow__text { max-height: 12em; opacity: 1; }
.flow__stage { position: sticky; top: 104px; border-radius: var(--radius-lg); background: var(--color-bg-subtle); min-height: 520px; display: grid; place-items: center; padding: clamp(24px, 4vw, 48px); overflow: hidden; }
.scene { grid-area: 1 / 1; width: 100%; max-width: 440px; opacity: 0; transform: translateY(16px) scale(.98); transition: opacity .5s var(--ease), transform .6s var(--ease); pointer-events: none; }
.scene.is-active { opacity: 1; transform: none; pointer-events: auto; }

/* Frammenti di interfaccia (le illustrazioni del processo) */
.ui { background: var(--color-surface); border: 0.5px solid var(--color-line-strong); border-radius: var(--radius); font-size: var(--step-small); color: var(--color-ink); text-align: left; }
.ui + .ui { margin-top: 12px; }
.ui__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 0.5px solid var(--color-line); }
.ui__title { font-weight: 500; }
.ui__meta { color: var(--color-ink-soft); }
.ui__body { padding: 6px 18px 14px; }
.ui__who { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
.ui__name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; line-height: 1.1; }
.ui__label { font-size: 0.75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--color-ink-soft); padding: 12px 0 4px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 0.5px solid var(--color-line); }
.row:last-child { border-bottom: 0; }
.row small { display: block; color: var(--color-ink-soft); font-size: 0.8125rem; }
.row--start { justify-content: flex-start; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-full); background: var(--color-emerald-pale); color: var(--color-emerald-dark); font-size: 0.8125rem; white-space: nowrap; }
.pill--wait { background: var(--color-bg-muted); color: var(--color-ink-soft); }
.pill--warn { background: var(--color-warning-pale); color: var(--color-warning-ink); }
.tick { width: 16px; height: 16px; border-radius: 4px; flex: none; display: inline-grid; place-items: center; background: var(--color-emerald); }
.tick::after { content: ""; width: 7px; height: 4px; border-left: 1.5px solid var(--color-paper); border-bottom: 1.5px solid var(--color-paper); transform: translateY(-1px) rotate(-45deg); }
.tick--empty { background: none; border: 1px solid var(--color-line-strong); }
.tick--empty::after { display: none; }
.ico { width: 40px; height: 40px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--color-surface); border: 0.5px solid var(--color-line-strong); color: var(--color-navy); }
.ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ico--emerald { color: var(--color-emerald-dark); }
.chat { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px; }
.bubble { padding: 10px 14px; border-radius: 12px; max-width: 88%; line-height: 1.45; }
.bubble--in { background: var(--color-bg-muted); border-bottom-left-radius: 4px; }
.bubble--out { background: var(--color-navy); color: var(--color-paper); border-bottom-right-radius: 4px; margin-left: auto; }
.track { display: flex; gap: 6px; margin: 12px 0 4px; }
.track span { flex: 1; height: 6px; border-radius: 3px; background: var(--color-bg-muted); }
.track span.on { background: var(--color-emerald); }
.amount { font-family: var(--font-display); font-size: 2rem; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.ui-btn { padding: 6px 14px; border-radius: var(--radius-full); border: 0; background: var(--color-navy); color: var(--color-paper); cursor: pointer; font-size: 0.8125rem; transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease); }
.ui-btn:hover { background: var(--color-emerald); color: var(--color-navy); }
.ui-btn:active { transform: scale(.95); }
.ui-btn[disabled] { background: var(--color-emerald-pale); color: var(--color-emerald-dark); cursor: default; }

/* PERCHÉ: quattro schede con illustrazione */
.why { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: clamp(40px, 5vw, 64px); }
.card { background: var(--color-surface); border: 0.5px solid var(--color-line); border-radius: var(--radius-lg); padding: 12px; transition: border-color .3s var(--ease); }
.card:hover { border-color: var(--color-line-strong); }
.card__art { border-radius: var(--radius); background-color: var(--color-bg-subtle); background-image: radial-gradient(var(--grid-line) 1px, transparent 1px); background-size: 16px 16px; height: 280px; display: grid; place-items: center; padding: 24px; overflow: hidden; }
.card__art > * { width: 100%; max-width: 340px; }
.card__text { padding: 20px 12px 12px; }
.card__text p { margin-top: 8px; color: var(--color-ink-soft); }
.chans { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.sync { margin: 18px auto 0; width: max-content; display: flex; align-items: center; gap: 8px; background: var(--color-surface); border: 0.5px solid var(--color-line-strong); border-radius: var(--radius-full); padding: 6px 14px; font-size: var(--step-small); }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--color-emerald); }

/* INTEGRAZIONI */
.tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 40px; }
.tool { display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 8px; background: var(--color-surface); border: 0.5px solid var(--color-line-strong); border-radius: var(--radius-full); font-size: var(--step-small); }
.tool .ico { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--color-bg-subtle); }
.tool .ico svg { width: 16px; height: 16px; }

/* DESIGN PARTNER */
.offer { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: clamp(40px, 5vw, 64px); }
.offer__item { background: var(--color-bg-subtle); border-radius: var(--radius-lg); padding: 32px 28px; }
.offer__k { font-family: var(--font-display); font-size: var(--step-head); font-weight: 500; line-height: 1; color: var(--color-emerald-dark); }
.offer__item h3 { font-size: var(--step-lead); font-weight: 500; margin: 20px 0 8px; }
.offer__item p { color: var(--color-ink-soft); }
.offer__cta { display: flex; justify-content: center; margin-top: 40px; }

/* DOMANDE: titolo a sinistra, fisarmonica a destra */
.faq-split { display: grid; grid-template-columns: 1fr 1.5fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.faq-split__head p { margin: 16px 0 24px; }
.acc details { background: var(--color-bg-subtle); border-radius: var(--radius); margin-bottom: 8px; transition: background .25s var(--ease); }
.acc details:hover { background: var(--color-bg-muted); }
.acc summary { list-style: none; cursor: pointer; padding: 20px 56px 20px 24px; position: relative; font-weight: 400; font-size: var(--step-lead); }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; position: absolute; right: 24px; top: 50%; translate: 0 -50%; font-size: 1.5rem; font-weight: 300; color: var(--color-emerald-dark); transition: rotate .3s var(--ease); }
.acc details[open] summary::after { rotate: 45deg; }
.acc details p { padding: 0 24px 22px; color: var(--color-ink-soft); max-width: 62ch; }

/* CHIUSURA: riquadro astratto */
.close { padding: var(--section) var(--margin) 0; }
.close__card { max-width: calc(var(--max) + 120px); margin: 0 auto; border-radius: var(--radius-lg); text-align: center; padding: clamp(80px, 10vw, 140px) var(--margin); display: flex; flex-direction: column; align-items: center; }
.close__card h2 { font-family: var(--font-display); font-weight: 500; font-size: var(--step-head); line-height: 1.05; max-width: 18ch; text-wrap: balance; }
.close__card p { margin-top: 16px; color: var(--color-paper-soft); max-width: 46ch; }
.close__card .btn { margin-top: 32px; }

/* FOOTER */
.foot { margin-top: var(--section); padding: 64px 0 32px; border-top: 0.5px solid var(--color-line); font-size: var(--step-small); }
.foot__row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.foot__brand .wordmark { font-size: 2rem; text-decoration: none; }
.foot__brand p { margin-top: 12px; max-width: 32ch; color: var(--color-ink-soft); }
.foot__col p { font-weight: 500; margin-bottom: 12px; }
.foot__col a { display: block; text-decoration: none; padding: 4px 0; color: var(--color-ink-soft); transition: color .2s var(--ease); }
.foot__col a:hover { color: var(--color-ink); }
.foot__legal { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; color: var(--color-ink-soft); }
.foot__legal a { text-decoration: none; }
.credits { margin-top: 16px; color: var(--color-ink-soft); }
.credits a { text-decoration: underline; }

/* PAGINE INTERNE */
.page { padding-top: clamp(64px, 9vw, 120px); }
.page__head { max-width: 860px; }
.page__head h1 { font-family: var(--font-display); font-weight: 500; font-size: var(--step-hero); line-height: 1.03; letter-spacing: -0.025em; text-wrap: balance; }
.page__head p { margin-top: 20px; font-size: var(--step-lead); color: var(--color-ink-soft); max-width: 56ch; }

/* Manifesto */
.essay { max-width: 64ch; margin: clamp(48px, 6vw, 80px) auto 0; font-size: 1.125rem; line-height: 1.7; }
.essay p { margin-bottom: 1.1em; }
.essay h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.75rem, 2.6vw, 2.25rem); line-height: 1.1; margin: 2em 0 0.6em; }
.essay__meta { color: var(--color-ink-soft); font-size: var(--step-small); }
.essay__sign { margin-top: 2em; font-family: var(--font-display); font-size: 2rem; font-weight: 500; }
.plate { margin: 2.5em 0 0; }
.plate img { width: 100%; height: auto; border-radius: var(--radius); background: var(--color-bg-subtle); }
.plate figcaption { margin-top: 10px; font-size: var(--step-small); color: var(--color-ink-soft); }
.plate--wide { max-width: var(--max); margin: clamp(48px, 6vw, 80px) auto 0; padding: 0 var(--margin); }
.plate--wide img { height: clamp(320px, 52svh, 560px); object-fit: cover; object-position: 50% 45%; }

/* Sicurezza */
.guard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: clamp(40px, 5vw, 64px); }
.guard > div { background: var(--color-bg-subtle); border-radius: var(--radius-lg); padding: 28px; }
.guard h3 { font-family: var(--font-display); font-size: var(--step-sub); font-weight: 500; line-height: 1.15; margin: 0 0 8px; }
.guard p { color: var(--color-ink-soft); }
.doclist { margin-top: 40px; max-width: 860px; }
.doclist li { display: flex; justify-content: space-between; gap: 24px; padding: 18px 0; border-bottom: 0.5px solid var(--color-line); }

/* Calcolatore */
.calc { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(32px, 6vw, 96px); margin-top: clamp(48px, 6vw, 80px); align-items: start; }
.calc__how .h3 { margin-bottom: 12px; }
.calc__how p { color: var(--color-ink-soft); }
.calc__how p + p { margin-top: 14px; }
.calc__tool .ui__body { padding: 24px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 24px; border: 0; }
.seg label { cursor: pointer; display: flex; }
.seg label > span { flex: 1; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--color-bg-subtle); transition: background .2s var(--ease), color .2s var(--ease); }
.seg span b { display: block; font-weight: 500; }
.seg input:checked + span { background: var(--color-navy); color: var(--color-paper); }
.seg input:focus-visible + span { outline: 2px solid var(--color-emerald); outline-offset: 2px; }
.calc__inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.calc__out { margin-top: 24px; padding: 24px; border-radius: var(--radius); background: var(--color-navy); color: var(--color-paper); display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.calc__num { font-family: var(--font-display); font-size: clamp(2.5rem, 4vw, 3.25rem); font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.calc__lab { color: var(--color-paper-soft); font-size: var(--step-small); margin-top: 6px; }
.calc__formula { margin-top: 16px; color: var(--color-ink-soft); }
.calc__print { margin-top: 20px; }

/* Form */
.form-wrap { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(32px, 6vw, 96px); margin-top: clamp(48px, 6vw, 80px); align-items: start; }
.form-wrap__side .h3 { margin-bottom: 16px; }
.form { background: var(--color-surface); border-radius: var(--radius-lg); padding: clamp(24px, 4vw, 40px); border: 0.5px solid var(--color-line-strong); }
.field-in { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-in label { font-size: var(--step-small); font-weight: 400; }
.field-in input, .field-in select, .field-in textarea { width: 100%; padding: 12px 14px; background: var(--color-bg); border: 0.5px solid var(--color-line-strong); border-radius: var(--radius-sm); transition: border-color .2s var(--ease), background .2s var(--ease); }
.field-in input:focus, .field-in select:focus, .field-in textarea:focus { outline: none; border-color: var(--color-emerald); background: var(--color-surface); }
.field-in [aria-invalid="true"] { border-color: var(--color-danger); }
.field-in textarea { resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--step-small); margin: 4px 0 24px; }
.check input { margin-top: 4px; accent-color: var(--color-emerald); }
.hp { position: absolute; left: -9999px; }
.form__msg { margin-top: 14px; font-size: var(--step-small); min-height: 1.4em; }
.form__msg.is-ok { color: var(--color-emerald-dark); }
.form__msg.is-error { color: var(--color-danger); }

/* Ingresso a cascata */
.in > * { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.in.is-in > * { opacity: 1; transform: none; }
.no-js .in > * { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .in > *, .scene, .flow__text { transition: none; transform: none; }
  .in > * { opacity: 1; }
}

@media print {
  .top, .foot, .calc__how, .calc__print, .close, .page__head p { display: none !important; }
  .calc { grid-template-columns: 1fr; }
  .calc__out { background: none; color: var(--color-ink); border: 0.5px solid var(--color-line-strong); }
  .calc__lab { color: var(--color-ink-soft); }
}

/* Tablet */
@media (max-width: 1000px) {
  .head-split, .flow, .faq-split, .calc, .form-wrap { grid-template-columns: 1fr; }
  .flow__stage { position: relative; top: 0; min-height: 460px; }
  .guard { grid-template-columns: 1fr 1fr; }
  .foot__row { grid-template-columns: 1fr 1fr 1fr; }
  .foot__brand { grid-column: 1 / -1; }
}

/* Telefono */
@media (max-width: 720px) {
  .top__menu { display: inline-block; }
  .top__links { display: none; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 16px; background: var(--color-bg); padding: 16px var(--margin) 24px; border-bottom: 0.5px solid var(--color-line); }
  .top.is-open .top__links { display: flex; }
  .hero__card { min-height: 0; padding: 72px 20px; }
  .flow__stage { min-height: 420px; padding: 16px; }
  .why, .offer, .guard { grid-template-columns: 1fr; }
  .card__art { height: 240px; padding: 16px; }
  .field-row, .seg, .calc__inputs, .calc__out { grid-template-columns: 1fr; }
  .foot__row { grid-template-columns: 1fr 1fr; }
  .foot__legal { flex-direction: column; }
  .doclist li { flex-direction: column; gap: 4px; }
}

/* niente scroll orizzontale dalle animazioni della sezione */
#integrazioni { overflow-x: clip; }

/* Utilità aggiunte */
.lead--narrow { margin-top: 16px; max-width: 56ch; }
.row__lead { display: flex; gap: 12px; align-items: center; }
.ico--logo img { width: 22px; height: 22px; object-fit: contain; }

/* Menu Company (a tendina) */
.drop { position: relative; }
.drop__btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer; font-size: var(--step-small); padding: 8px 0; transition: color .2s var(--ease); }
.drop__btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; transition: rotate .25s var(--ease); }
.drop__btn:hover, .drop__btn[aria-current] { color: var(--color-emerald-dark); }
.drop__menu { position: absolute; top: calc(100% + 10px); left: 50%; translate: -50% 0; width: 280px; background: var(--color-surface); border: 0.5px solid var(--color-line-strong); border-radius: var(--radius); padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .2s var(--ease), transform .25s var(--ease), visibility 0s .25s; z-index: 40; }
.drop__menu::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.drop__menu a { display: block; padding: 10px 12px; border-radius: var(--radius-sm); }
.drop__menu a:hover { background: var(--color-bg-subtle); color: var(--color-ink) !important; }
.drop__menu b { display: block; font-weight: 500; }
.drop__menu span { display: block; color: var(--color-ink-soft); font-size: 0.8125rem; }
.drop.is-open .drop__menu, .drop:hover .drop__menu, .drop:focus-within .drop__menu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.drop.is-open .drop__btn svg, .drop:hover .drop__btn svg { rotate: 180deg; }

/* Superficie dipinta: il quadro dell'ufficio con un velo navy per leggere il testo */
.painted { position: relative; isolation: isolate; overflow: hidden; color: var(--color-paper); background: var(--color-navy); }
.painted__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; z-index: -2; }
.painted::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(70% 70% at 50% 55%, rgba(15, 27, 53, .72), rgba(15, 27, 53, .42) 75%),
    linear-gradient(rgba(15, 27, 53, .25), rgba(15, 27, 53, .45));
}
.painted--window .painted__img { object-position: 78% 40%; filter: saturate(.9); }
.painted--window::after { background: radial-gradient(75% 85% at 50% 50%, rgba(15, 27, 53, .78), rgba(15, 27, 53, .5)); }
.hero__card .hero__tag { background: rgba(250, 250, 248, .16); }
@media (prefers-reduced-motion: no-preference) {
  .hero .painted__img { animation: breathe 30s ease-in-out infinite alternate; }
  @keyframes breathe { to { scale: 1.06; translate: -1% -1%; } }
}

/* INTEGRAZIONI: i loghi mandano eventi che convergono nel cruscotto */
.hub { position: relative; display: grid; grid-template-columns: 1fr minmax(320px, 420px) 1fr; align-items: center; gap: clamp(24px, 4vw, 64px); margin-top: clamp(40px, 5vw, 64px); min-height: 520px; }
.hub__wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.hub__wires path { fill: none; stroke: var(--color-line-strong); stroke-width: 1; stroke-dasharray: 3 6; }
.hub__wires path.is-hot { stroke: var(--color-emerald); stroke-dasharray: none; stroke-width: 1.25; }
.hub__wires circle { fill: var(--color-emerald); }
.hub__side { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 64px); gap: 18px 22px; justify-content: center; }
.hub__side--l li:nth-child(3n+2), .hub__side--r li:nth-child(3n+2) { translate: 0 22px; }
.hub__side li { width: 64px; height: 64px; display: grid; place-items: center; background: var(--color-surface); border: 0.5px solid var(--color-line-strong); border-radius: 16px; transition: border-color .3s var(--ease), scale .3s var(--ease), background .3s var(--ease); }
.hub__side li img { width: 30px; height: 30px; object-fit: contain; }
.hub__side li img.is-wide { width: 48px; }
.hub__side li.is-firing { border-color: var(--color-emerald); background: var(--color-emerald-pale); scale: 1.08; }
.hub__name { font-family: var(--font-display); font-size: 0.6875rem; font-weight: 500; letter-spacing: -0.01em; color: var(--color-navy); padding: 0 4px; text-align: center; }
.hub__panel { position: relative; z-index: 2; background: var(--color-surface); border: 0.5px solid var(--color-line-strong); border-radius: var(--radius-lg); overflow: hidden; }
.hub__bar { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: var(--color-navy); color: var(--color-paper); }
.hub__bar .wordmark { font-size: 1.25rem; }
.hub__count { font-size: var(--step-small); color: var(--color-paper-soft); }
.hub__count b { color: var(--color-emerald); font-weight: 500; font-variant-numeric: tabular-nums; }
.hub__feed { min-height: 344px; padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.feed { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius); background: var(--color-bg-subtle); font-size: var(--step-small); animation: feedIn .6s var(--ease) both; }
.feed__src { width: 32px; height: 32px; border-radius: 10px; background: var(--color-surface); display: grid; place-items: center; border: 0.5px solid var(--color-line); }
.feed__src img { width: 18px; height: 18px; object-fit: contain; }
.feed__src .hub__name { font-size: 0.5rem; }
.feed__what b { display: block; font-weight: 500; }
.feed__what span { color: var(--color-ink-soft); font-size: 0.8125rem; }
.feed.is-leaving { animation: feedOut .4s var(--ease) both; }
@keyframes feedIn { from { opacity: 0; transform: translateY(-12px) scale(.98); } }
@keyframes feedOut { to { opacity: 0; transform: translateY(8px); } }
.hub__note { text-align: center; margin: 24px auto 0; max-width: 60ch; }
@media (prefers-reduced-motion: no-preference) {
  .hub.is-in .hub__side li { animation: bob 6s ease-in-out infinite; animation-delay: calc(var(--k, 0) * -0.7s); }
  @keyframes bob { 50% { transform: translateY(-5px); } }
  .hub.is-in .hub__wires path:not(.is-hot) { animation: flow 1.6s linear infinite; }
  @keyframes flow { to { stroke-dashoffset: -18; } }
}

/* Sigilli di protezione dati */
.seals { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.seal { width: 104px; display: flex; flex-direction: column; align-items: center; text-align: center; background: var(--color-surface); border: 0.5px solid var(--color-line-strong); border-radius: var(--radius); padding: 14px 8px 12px; }
.seal svg { width: 52px; height: 52px; margin-bottom: 8px; }
.seal__stars circle { fill: var(--color-emerald); }
.seal__ring { fill: none; stroke: var(--color-line-strong); stroke-width: 1.5; }
.seal__line { fill: none; stroke: var(--color-navy); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.seal b { font-family: var(--font-display); font-weight: 500; font-size: 0.9375rem; line-height: 1.1; }
.seal span { font-size: 0.75rem; color: var(--color-ink-soft); line-height: 1.3; margin-top: 2px; }
.seals--page { justify-content: flex-start; margin-top: 40px; }
.seals--page .seal { width: 150px; padding: 20px 12px 16px; }

/* Footer: social */
.social { display: flex; gap: 10px; margin-top: 20px; }
.social a { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--color-bg-subtle); color: var(--color-navy); transition: background .2s var(--ease), color .2s var(--ease); }
.social a:hover { background: var(--color-navy); color: var(--color-paper); }
.social svg { width: 17px; height: 17px; fill: currentColor; }
.social svg.stroke { fill: none; stroke: currentColor; stroke-width: 1.8; }
.foot__row { grid-template-columns: 2fr repeat(4, 1fr); }

/* Prodotto su telefono: ogni passo con la sua illustrazione, in sequenza */
.flow__mini { display: none; }

/* Chi siamo */
.founders { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: clamp(48px, 6vw, 72px); }
.founder { background: var(--color-bg-subtle); border-radius: var(--radius-lg); padding: clamp(28px, 3vw, 40px); display: flex; flex-direction: column; }
.founder__photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: block; background: var(--color-bg-subtle); }
.founder__initials { width: 56px; height: 56px; border-radius: 50%; background: var(--color-navy); color: var(--color-paper); display: grid; place-items: center; font-family: var(--font-display); font-weight: 500; font-size: 1.125rem; letter-spacing: .02em; }
.founder h2 { font-family: var(--font-display); font-weight: 500; font-size: var(--step-sub); margin-top: 20px; letter-spacing: -0.02em; }
.founder__role { color: var(--color-emerald-dark); font-size: var(--step-small); margin-top: 2px; }
.founder p { margin-top: 16px; color: var(--color-ink-soft); }
.founder__facts { margin-top: auto; padding-top: 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.fact { border-top: 0.5px solid var(--color-line-strong); padding-top: 16px; }
.fact b { display: block; font-family: var(--font-display); font-weight: 500; font-size: var(--step-head); line-height: 1; letter-spacing: -0.03em; }
.fact span { display: block; margin-top: 8px; color: var(--color-ink-soft); font-size: var(--step-small); }
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: clamp(40px, 5vw, 56px); }
.values h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--step-sub); }
.values p { margin-top: 8px; color: var(--color-ink-soft); }

/* Pagine legali */
.legal { max-width: 760px; margin: clamp(40px, 5vw, 64px) auto 0; }
.legal__meta { color: var(--color-ink-soft); font-size: var(--step-small); }
.legal h2 { font-family: var(--font-display); font-weight: 500; font-size: var(--step-sub); margin: 2.2em 0 .6em; scroll-margin-top: 96px; }
.legal h3 { font-weight: 500; font-size: var(--step-lead); margin: 1.4em 0 .4em; }
.legal p + p { margin-top: .8em; }
.legal ul { margin: .6em 0; }
.legal ul li { position: relative; padding-left: 1.5em; margin-bottom: .5em; }
.legal ul li::before { content: "—"; position: absolute; left: 0; color: var(--color-emerald-dark); }
.legal a { text-decoration: underline; }
.legal__toc { background: var(--color-bg-subtle); border-radius: var(--radius); padding: 20px 24px; margin-top: 28px; }
.legal__toc ol { list-style: decimal; padding-left: 1.2em; margin-top: 8px; columns: 2; column-gap: 32px; }
.legal__toc li { margin-bottom: 4px; break-inside: avoid; }
.legal__table { overflow-x: auto; margin: 1em 0; }
.legal table { width: 100%; border-collapse: collapse; font-size: var(--step-small); }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 0.5px solid var(--color-line-strong); }
.legal th { font-weight: 500; background: var(--color-bg-subtle); }
.legal__todo { background: var(--color-warning-pale); color: var(--color-warning-ink); border-radius: var(--radius-sm); padding: 12px 16px; font-size: var(--step-small); margin-top: 20px; }

@media (max-width: 1000px) {
  /* il racconto a passi diventa una sequenza: testo sempre visibile, illustrazione sotto ogni passo */
  .flow__stage { display: none; }
  .flow__step { cursor: default; background: none !important; padding: 0 0 0 20px; margin-bottom: 40px; }
  .flow__step::before { background: var(--color-emerald) !important; top: 4px; bottom: auto; height: 28px; }
  .flow__step .flow__title { color: var(--color-ink); }
  .flow__step .flow__text { max-height: none; opacity: 1; }
  .flow__mini { display: block; margin-top: 20px; border-radius: var(--radius-lg); background: var(--color-bg-subtle); padding: 16px; }
  .flow__mini .scene { opacity: 1; transform: none; max-width: none; pointer-events: auto; }
  .hub { grid-template-columns: 1fr; min-height: 0; gap: 20px; }
  .hub__wires { display: none; }
  .hub__side { grid-template-columns: none; grid-auto-flow: column; justify-content: start; gap: 12px; width: max-content; }
  .hub__side li { translate: none !important; width: 56px; height: 56px; }
  .hub__side--l { order: 1; } .hub__panel { order: 2; } .hub__side--r { order: 3; }
  .founders, .values { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .foot__row { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 1000px) and (prefers-reduced-motion: no-preference) {
  .hub.is-in .hub__side { animation: marquee 28s linear infinite; }
  .hub.is-in .hub__side--r { animation-direction: reverse; }
  .hub.is-in .hub__side li { animation: none; }
  @keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
}
@media (max-width: 720px) {
  .drop__menu { position: static; translate: none; width: auto; opacity: 1; visibility: visible; transform: none; border: 0; padding: 4px 12px 0; background: none; }
  .drop__btn svg { display: none; }
  .drop__menu span { display: none; }
  .drop__menu a { padding: 6px 0; }
  .hub__feed { min-height: 300px; }
  .feed { grid-template-columns: 28px 1fr; }
  .feed .pill { grid-column: 2; justify-self: start; }
  .seal { width: 92px; }
  .foot__row { grid-template-columns: 1fr 1fr; }
  .legal__toc ol { columns: 1; }
}

.hub__side li.is-dup { display: none; }
@media (max-width: 1000px) { .hub__side li.is-dup { display: grid; } }

/* Telefono: illustrazioni delle schede senza tagli */
.amount { white-space: nowrap; }
@media (max-width: 720px) {
  .card__art { height: auto; min-height: 220px; padding: 20px 14px; }
  .seals { gap: 8px; flex-wrap: nowrap; }
  .card__art .seal { width: 84px; padding: 10px 4px; }
  .card__art .seal svg { width: 40px; height: 40px; }
  .seals--page { flex-wrap: wrap; }
  .amount { font-size: 1.5rem; }
}

/* Logo: marchio + nome */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--color-navy); }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand .wordmark { font-size: 1.5rem; line-height: 1; }
.brand--light { color: var(--color-paper); gap: 8px; }
.brand--light .brand__mark { width: 24px; height: 24px; }
.brand--light .wordmark { font-size: 1.125rem; }
.foot__brand .brand .wordmark { font-size: 1.75rem; }
.foot__brand .brand__mark { width: 34px; height: 34px; }

/* PRODOTTO: quadro monocromatico dietro la demo, inquadratura diversa a ogni passo */
.flow__stage { background: var(--color-emerald-dark); isolation: isolate; min-height: 560px; }
.stage__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; filter: grayscale(1) contrast(1.05) brightness(1.15); transform: scale(1.35); object-position: 10% 30%; transition: object-position 1.2s var(--ease), transform 1.2s var(--ease); }
.flow__stage::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(160deg, rgba(15, 110, 86, .78), rgba(15, 27, 53, .72)); mix-blend-mode: multiply; }
.flow__stage[data-step="2"] .stage__bg { object-position: 0% 70%; transform: scale(1.5); }
.flow__stage[data-step="3"] .stage__bg { object-position: 85% 35%; transform: scale(1.4); }
.flow__stage[data-step="4"] .stage__bg { object-position: 95% 80%; transform: scale(1.3); }
.flow__stage .scene { max-width: 500px; position: relative; padding-bottom: 36px; }

/* Finestra dell'app */
.app { background: var(--color-surface); border-radius: var(--radius); overflow: hidden; font-size: 0.8125rem; color: var(--color-ink); text-align: left; }
.app__top { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 0.5px solid var(--color-line); }
.app__top .brand__mark { width: 20px; height: 20px; }
.app__top b { font-family: var(--font-display); font-weight: 500; font-size: 0.9375rem; }
.app__search { flex: 1; margin-left: 10px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--color-bg-subtle); color: var(--color-ink-soft); font-size: 0.75rem; }
.app__me { width: 26px; height: 26px; border-radius: 50%; background: var(--color-emerald-pale); color: var(--color-emerald-dark); display: grid; place-items: center; font-size: 0.6875rem; font-weight: 500; }
.app__body { display: grid; grid-template-columns: 112px 1fr; min-height: 270px; }
.app__nav { padding: 10px 8px; background: var(--color-bg-subtle); display: flex; flex-direction: column; gap: 2px; }
.app__nav li { display: flex; justify-content: space-between; align-items: center; padding: 7px 8px; border-radius: 6px; color: var(--color-ink-soft); }
.app__nav li.is-on { background: var(--color-surface); color: var(--color-ink); font-weight: 500; }
.app__nav i { font-style: normal; min-width: 18px; height: 18px; border-radius: 9px; background: var(--color-emerald); color: var(--color-navy); font-size: 0.6875rem; font-weight: 500; display: grid; place-items: center; padding: 0 5px; }
.app__main { padding: 14px 16px; }
.app__h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 500; font-size: 0.9375rem; margin-bottom: 10px; }
.app__h .amount { font-size: 1.25rem; }
.app .row { padding: 8px 0; }
.item { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: var(--radius-sm); margin-bottom: 6px; background: var(--color-bg-subtle); }
.item--hot { background: var(--color-emerald-pale); }
.item__src { width: 28px; height: 28px; border-radius: 8px; background: var(--color-surface); display: grid; place-items: center; }
.item__what b { display: block; font-weight: 500; }
.item__what small { color: var(--color-ink-soft); font-size: 0.75rem; }
.bar { height: 6px; border-radius: 3px; background: var(--color-bg-muted); margin-bottom: 8px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--color-emerald); border-radius: 3px; }
.steps { position: relative; padding-left: 22px; }
.steps::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--color-bg-muted); }
.steps li { position: relative; padding: 6px 0 10px; }
.steps li::before { content: ""; position: absolute; left: -22px; top: 9px; width: 14px; height: 14px; border-radius: 50%; background: var(--color-surface); border: 2px solid var(--color-bg-muted); }
.steps li.is-done::before { background: var(--color-emerald); border-color: var(--color-emerald); }
.steps li.is-now::before { border-color: var(--color-emerald); }
.steps b { display: block; font-weight: 500; }
.steps small { color: var(--color-ink-soft); font-size: 0.75rem; }
.toast { position: absolute; right: -18px; bottom: 0; max-width: 280px; display: flex; gap: 10px; align-items: flex-start; background: var(--color-navy); color: var(--color-paper); border-radius: var(--radius); padding: 12px 14px; font-size: 0.8125rem; line-height: 1.4; }
.toast img, .toast .brand__mark { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.toast b { display: block; font-weight: 500; }
.toast span { color: var(--color-paper-soft); }
.toast span b { color: var(--color-paper); }
@media (prefers-reduced-motion: no-preference) {
  .scene .toast { opacity: 0; transform: translateY(12px); transition: opacity .5s var(--ease) .5s, transform .6s var(--ease) .5s; }
  .scene.is-active .toast, .flow__mini .toast { opacity: 1; transform: none; }
}

/* PERCHÉ BUNTIS: quattro schede, una aperta alla volta */
.cards4 { display: flex; gap: 12px; margin-top: clamp(40px, 5vw, 64px); min-height: 460px; }
.c4 { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; border-radius: var(--radius-lg); background: var(--color-bg-subtle); padding: 12px; cursor: pointer; overflow: hidden; transition: flex-grow .6s var(--ease), background .4s var(--ease); outline-offset: 4px; }
.c4.is-open { flex-grow: 1.9; background: var(--color-surface); box-shadow: inset 0 0 0 0.5px var(--color-line-strong); cursor: default; }
.c4__n { position: absolute; left: 24px; top: 16px; font-family: var(--font-display); font-weight: 500; font-size: 3.25rem; line-height: 1; letter-spacing: -0.04em; color: rgba(15, 27, 53, .58); z-index: 2; transition: opacity .3s var(--ease); }
.c4.is-open .c4__n { opacity: 0; }
.c4__art { position: relative; flex: 1; border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; padding: 20px; background-image: url("../media/ufficio-sole.webp"); background-size: 300%; filter: none; }
.c4__art::before { content: ""; position: absolute; inset: 0; background: rgba(243, 242, 238, .55); transition: background .5s var(--ease); }
.c4.is-open .c4__art::before { background: rgba(243, 242, 238, .35); }
.c4__art--a { background-position: 2% 35%; }
.c4__art--b { background-position: 55% 90%; }
.c4__art--c { background-position: 95% 35%; }
.c4__art--d { background-position: 40% 25%; }
.c4__ui { position: relative; width: 100%; max-width: 330px; opacity: 0; transform: translateY(16px) scale(.97); transition: opacity .4s var(--ease), transform .6s var(--ease); pointer-events: none; }
.c4.is-open .c4__ui { opacity: 1; transform: none; transition-delay: .2s; pointer-events: auto; }
.c4__text { padding: 20px 12px 8px; }
.c4__text p { margin-top: 8px; color: var(--color-ink-soft); max-height: 0; opacity: 0; overflow: hidden; transition: max-height .5s var(--ease), opacity .4s var(--ease); }
.c4.is-open .c4__text p { max-height: 10em; opacity: 1; transition-delay: .15s; }
.c4:not(.is-open):hover { background: var(--color-bg-muted); }

@media (max-width: 1000px) {
  .cards4 { flex-direction: column; min-height: 0; }
  .c4, .c4.is-open { flex: none; background: var(--color-surface); box-shadow: inset 0 0 0 0.5px var(--color-line-strong); cursor: default; }
  .c4__n { display: none; }
  .c4__art { min-height: 240px; }
  .c4__ui { opacity: 1; transform: none; pointer-events: auto; }
  .c4__text .h3 { white-space: normal; }
  .c4__text p { max-height: none; opacity: 1; }
  .flow__mini { background: var(--color-emerald-dark); position: relative; overflow: hidden; isolation: isolate; }
  .flow__mini .scene { padding-bottom: 0; }
  .flow__mini .toast { position: static; max-width: none; margin-top: 10px; }
  .flow__mini .app__body { grid-template-columns: 1fr; }
  .flow__mini .app__nav { display: none; }
  .toast { right: 0; }
}

/* CTA finale: ufficio in luce dorata */
.painted--gold .painted__img { object-position: 50% 45%; }
.painted--gold::after { background: radial-gradient(75% 85% at 50% 50%, rgba(15, 27, 53, .76), rgba(15, 27, 53, .46)); }

/* Selettore lingua IT / EN */
.lang { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--radius-full); border: 0.5px solid var(--color-line-strong); font-size: 0.75rem; letter-spacing: .04em; text-decoration: none; transition: border-color .2s var(--ease); }
.lang span, .lang b { padding: 4px 9px; border-radius: var(--radius-full); line-height: 1; }
.lang b { background: var(--color-navy); color: var(--color-paper); font-weight: 500; }
.lang span { color: var(--color-ink-soft); transition: color .2s var(--ease); }
.lang:hover { border-color: var(--color-navy); }
.lang:hover span { color: var(--color-ink); }

/* Con il selettore lingua la barra non entra sotto i 960px: menu compatto anche su tablet */
@media (max-width: 960px) {
  .top__menu { display: inline-block; }
  .top__links { display: none; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 16px; background: var(--color-bg); padding: 16px var(--margin) 24px; border-bottom: 0.5px solid var(--color-line); }
  .top.is-open .top__links { display: flex; }
  .drop__menu { position: static; translate: none; width: auto; opacity: 1; visibility: visible; transform: none; border: 0; padding: 4px 12px 0; background: none; }
  .drop__btn svg { display: none; }
  .drop__menu span { display: none; }
  .drop__menu a { padding: 6px 0; }
  .top__links .lang { margin-top: 4px; }
}

/* Chi siamo: link al profilo LinkedIn dei founder */
.founder__in { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; align-self: flex-start; padding: 8px 14px; border-radius: var(--radius-full); background: var(--color-surface); color: var(--color-navy); font-size: var(--step-small); font-weight: 500; text-decoration: none; transition: background .2s var(--ease), color .2s var(--ease); }
.founder__in svg { width: 15px; height: 15px; fill: currentColor; }
.founder__in:hover { background: var(--color-navy); color: var(--color-paper); }


/* ===== Pivot: blocchi nuovi ===== */

/* Selettore della professione */
.prof { margin-top: clamp(32px, 4vw, 48px); border: 0; padding: 0; min-width: 0; }
.prof legend { font-size: var(--step-small); color: var(--color-ink-soft); margin-bottom: 10px; }
.prof__list { display: flex; flex-wrap: wrap; gap: 6px; }
.prof label { cursor: pointer; }
.prof input { position: absolute; opacity: 0; }
.prof span { display: block; padding: 8px 15px; border-radius: var(--radius-full); background: var(--color-bg-subtle); font-size: var(--step-small); white-space: nowrap; transition: background .2s var(--ease), color .2s var(--ease); }
.prof label:hover span { background: var(--color-bg-muted); }
.prof input:checked + span { background: var(--color-navy); color: var(--color-paper); }
.prof input:focus-visible + span { outline: 2px solid var(--color-emerald); outline-offset: 2px; }

/* Scrollytelling: testo che scorre, quadro fermo */
.story { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(32px, 5vw, 72px); margin-top: clamp(24px, 3vw, 40px); align-items: start; }
.story__step { min-height: 78svh; display: flex; flex-direction: column; justify-content: center; opacity: .38; transition: opacity .35s var(--ease); }
.story__step.is-on { opacity: 1; }
.story__step > div > h3 { font-family: var(--font-display); font-size: clamp(1.5rem, 2.4vw, 2.125rem); font-weight: 500; line-height: 1.12; letter-spacing: -.015em; }
.story__step > div > p { margin-top: 12px; font-size: var(--step-lead); line-height: 1.55; color: var(--color-ink-soft); }
.story__chans { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.story__chans li { padding: 5px 12px; border-radius: var(--radius-full); background: var(--color-bg-subtle); font-size: var(--step-small); }
.story__stage { align-self: stretch; }
.story .flow__stage { height: calc(100svh - 136px); min-height: 560px; }
.flow__stage .scene { max-width: 480px; }
.no-js .story { grid-template-columns: 1fr; }
.no-js .story__stage { display: none; }
.no-js .story__step { opacity: 1; min-height: 0; margin-bottom: 40px; }
.no-js .story__step .scene { opacity: 1; transform: none; }

/* Inbox: le righe nascono sparse e --e le riporta al loro posto */
.inbox { position: relative; color: var(--color-ink); font-size: .8125rem; --e: 1; --c: 1; }
.inbox__bg { position: absolute; inset: 0; background: var(--color-surface); border-radius: var(--radius); opacity: var(--c); }
.inbox__top { position: relative; background: var(--color-surface); border-radius: var(--radius) var(--radius) 0 0; display: flex; align-items: center; gap: 8px; padding: 12px 16px; opacity: var(--c); }
.inbox__top .brand__mark { width: 20px; height: 20px; }
.inbox__top b { font-family: var(--font-display); font-size: .9375rem; }
.inbox__n { margin-left: auto; color: var(--color-ink-soft); }
.inbox__list { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 0 10px 10px; }
.msg { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 11px 12px; border-radius: var(--radius-sm); background: var(--color-surface); will-change: transform;
  width: calc(100% - var(--w, 0px) * (1 - var(--e)));
  transform: translate(calc(var(--x) * var(--s, 1) * (1 - var(--e))), calc(var(--y) * var(--s, 1) * (1 - var(--e)))) rotate(calc(var(--r) * (1 - var(--e)))); }
.inbox:not([data-scatter]) .msg { background: var(--color-bg-subtle); }
.msg__src { width: 32px; height: 32px; border-radius: 9px; background: var(--color-surface); display: grid; place-items: center; }
.inbox[data-scatter] .msg__src { background: var(--color-bg-subtle); }
.msg__what { min-width: 0; }
.msg__what b { display: block; font-weight: 500; font-size: var(--step-small); line-height: 1.3; }
.msg__what small { display: block; color: var(--color-ink-soft); font-size: .8125rem; line-height: 1.35; }
.msg .pill { opacity: var(--c); }
.inbox[data-scatter] .msg .pill { display: none; }

/* Foglio del documento controllato */
.sheet { width: 100%; background: var(--color-surface); color: var(--color-ink); border-radius: var(--radius); padding: 20px; font-size: var(--step-small); text-align: left; }
.sheet__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet__name { font-family: var(--font-display); font-weight: 500; font-size: 1.125rem; line-height: 1.2; }
.sheet__meta { color: var(--color-ink-soft); font-size: .8125rem; margin-top: 2px; }
.fields { margin-top: 12px; }
.fields > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 10px; margin: 0 -10px; border-bottom: .5px solid var(--color-line); border-radius: 6px; transition: background .4s var(--ease), color .4s var(--ease); }
.fields dt { color: var(--color-ink-soft); }
.fields dd { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.fields .is-bad { background: var(--color-warning-pale); border-bottom-color: transparent; }
.fields .is-bad dd, .fields .is-bad dt { color: var(--color-warning-ink); }
.fields .is-fixed { background: var(--color-emerald-pale); border-bottom-color: transparent; }
.fields .is-fixed dd, .fields .is-fixed dt { color: var(--color-emerald-dark); }
.sheet__msg { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--color-navy); color: var(--color-paper); line-height: 1.45; min-height: 100px; }
.sheet__to { color: var(--color-paper-soft); font-size: .8125rem; margin-bottom: 4px; }
.sheet .ui-btn { margin-top: 12px; width: 100%; min-height: 44px; background: #188461; color: #fff; }
.sheet .ui-btn:hover { background: var(--color-emerald-dark); color: #fff; }

/* Bozza, preventivo, pratica, fatture dentro il quadro */
.card-ui { background: var(--color-surface); color: var(--color-ink); border-radius: var(--radius); padding: 18px 20px; font-size: var(--step-small); text-align: left; }
.card-ui__h { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 500; font-size: 1.0625rem; line-height: 1.25; margin-bottom: 10px; }
.card-ui__h .amount { font-size: 1.375rem; }
.card-ui__quote { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--color-bg-subtle); color: var(--color-ink-soft); margin-bottom: 8px; }
.card-ui__draft { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--color-emerald-pale); color: var(--color-navy); line-height: 1.45; margin-bottom: 4px; }
.card-ui__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

/* Area clienti */
.area { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(32px, 5vw, 80px); align-items: center; }
.area__stage { border-radius: var(--radius-lg); min-height: 640px; display: grid; place-items: center; padding: 40px 16px; }
.area__stage .painted__img { object-position: 62% 50%; }
.area__stage.painted::after { background: rgba(15, 27, 53, .22); }
.phone { width: min(320px, 100%); background: var(--color-surface); color: var(--color-ink); border-radius: var(--radius-lg); overflow: hidden; font-size: var(--step-small); text-align: left; --studio: #0F1B35; }
.phone__top { display: flex; align-items: center; gap: 10px; padding: 16px 18px; background: var(--studio); color: var(--color-paper); transition: background .4s var(--ease); }
.phone__mark { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--color-paper); color: var(--studio); display: grid; place-items: center; font-family: var(--font-display); font-weight: 500; }
.phone__top b { font-family: var(--font-display); font-size: 1rem; line-height: 1.2; }
.phone__body { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.phone__state { display: flex; justify-content: space-between; gap: 12px; }
.phone__state span { color: var(--color-ink-soft); white-space: nowrap; }
.phone .bar span { background: var(--studio); transition: width .4s var(--ease), background .4s var(--ease); }
.phone .bubble--in { align-self: flex-end; border-bottom-left-radius: 12px; border-bottom-right-radius: 4px; }
.phone .bubble--out { background: var(--studio); margin-left: 0; border-bottom-right-radius: 12px; border-bottom-left-radius: 4px; }
.phone__foot { color: var(--color-ink-soft); font-size: .8125rem; }
.area__text .lead { margin: 20px 0 24px; }

/* Per chi */
.who { display: grid; grid-template-columns: 4fr 8fr; gap: clamp(32px, 5vw, 80px); align-items: start; }
.who__head .lead { margin-top: 16px; }
.who__cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px 28px; }
.who__cols li { color: var(--color-ink-soft); }
.who__cols li:first-child { font-family: var(--font-display); font-weight: 500; font-size: 1.25rem; line-height: 1.25; color: var(--color-ink); margin-bottom: 4px; }

/* Chiusura con il form */
.close__card--form { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: center; text-align: left; padding: clamp(24px, 5vw, 72px); }
.close__card--form h2 { max-width: none; }
.close__card--form .form { color: var(--color-ink); padding: clamp(20px, 3vw, 32px); border: 0; }
.close__card--form .form .field-in { margin-bottom: 14px; }
.close__card--form .field-row { gap: 14px; }

.select-arrow select, .form select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%230F1B35' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }

/* Ancore sotto la barra fissa */
html { scroll-padding-top: 96px; }

@media (min-width: 1001px) {
  .story__step:first-child { min-height: 110svh; }
}
@media (max-width: 1000px) {
  .story { grid-template-columns: 1fr; }
  .story__stage { display: none; }
  .story__step { min-height: 0; opacity: 1; margin-bottom: 56px; }
  .story__step .scene { position: relative; opacity: 1; transform: none; max-width: none; pointer-events: auto; margin-top: 20px; padding: 16px; border-radius: var(--radius-lg); background: var(--color-emerald-dark); overflow: hidden; }
  .story__step .toast { position: static; max-width: none; margin-top: 10px; opacity: 1; transform: none; }
  .inbox { --s: .6; }
  .close__card--form, .area, .who { grid-template-columns: 1fr; }
  .area__stage { order: 2; min-height: 560px; }
  .who__cols { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .inbox { --s: .32; }
  .msg { grid-template-columns: 32px 1fr; padding: 8px 6px; background: var(--color-surface) !important; }
  .msg:nth-child(1) { --w: 36px; } .msg:nth-child(3) { --w: 64px; } .msg:nth-child(4) { --w: 18px; }
  .msg .pill { grid-column: 2; justify-self: start; }
  .msg__src { background: var(--color-bg-subtle); }
  .prof span { padding: 11px 16px; }
  .who__cols { grid-template-columns: repeat(2, 1fr); gap: 28px 20px; }
  .fields > div { padding: 7px 8px; margin: 0 -8px; }
  .hero__cta .link, .foot__col a { display: inline-block; padding: 10px 0; }
}
