@import url("tokens/fonts.css");
@import url("tokens/typography.css");
@import url("tokens/spacing.css");

:root {
  --navy: #1e293d;
  --blue: #2563eb;
  --coral: #ffab40;
  --slate: #94a3b8;
  --wave: #e4ecfd;
  --white: #fff;
  --line: rgba(148, 163, 184, .6);
  --pad-x: clamp(20px, 4vw, 48px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--white);
  color: var(--navy);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { opacity: var(--hover-opacity); }
input, button { font-family: inherit; }
input[type=range] { accent-color: var(--blue); width: 100%; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }

.mono { font-family: var(--font-mono); }
.blue { color: var(--blue); }

/* ---------- Scroll wave ---------- */
.bg-wave { position: absolute; top: 0; left: 0; pointer-events: none; z-index: -1; overflow: visible; }
.bg-wave path { stroke-dasharray: 1; stroke-dashoffset: 1; }

/* ---------- Layout ---------- */
.container { max-width: var(--container); margin: 0 auto; padding-inline: var(--pad-x); }
.section { padding-top: 72px; display: flex; flex-direction: column; gap: 28px; }
.section-head { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.eyebrow { font-family: var(--font-mono); font-size: 13px; color: var(--blue); }
.h2 { font-weight: 800; font-size: clamp(40px, 5vw, 68px); line-height: .95; letter-spacing: -.045em; }
.lead { font-size: 18px; line-height: 1.5; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min, 280px)), 1fr)); }

.pill {
  font-family: var(--font-mono); font-size: 12px; align-self: flex-start;
  padding: 5px 11px; border-radius: var(--radius-pill);
}
.pill--coral { background: var(--coral); color: var(--navy); }
.pill--outline { border: 1.5px solid var(--navy); padding: 4px 10px; }

.btn {
  display: inline-block; border-radius: var(--radius-pill); font-weight: 600; font-size: 16px;
  padding: 16px 26px; cursor: pointer; border: none; text-align: center;
}
.btn--blue { background: var(--blue); color: var(--white); }
.btn--ghost { border: 1.5px solid var(--slate); color: var(--white); padding: 14.5px 24px; }

/* ---------- Hero ---------- */
.hero-wrap { background: var(--navy); color: var(--white); position: relative; overflow: hidden; }
.hero-ring { position: absolute; right: -180px; bottom: -220px; width: 560px; height: 560px; z-index: 0; overflow: visible; }
/* The ring draws itself on load: it starts where it leaves the bottom edge of the hero,
   on the left, and goes clockwise. */
.hero-ring circle {
  fill: none; stroke: var(--blue); stroke-width: 56;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transform: rotate(165deg); transform-origin: 50% 50%;
  animation: ring-draw 1.6s cubic-bezier(.65, 0, .25, 1) .2s forwards;
}
html.enter .hero-ring circle { animation-delay: .7s; }
/* At the very end the dash pattern is dropped, so no hairline seam is left where the stroke closes. */
@keyframes ring-draw { 99% { stroke-dashoffset: 0; stroke-dasharray: 1; } to { stroke-dashoffset: 0; stroke-dasharray: none; } }
@media (prefers-reduced-motion: reduce) {
  .hero-ring circle { animation: none; stroke-dasharray: none; }
}
.site-header {
  margin: 0; padding: 24px var(--pad-x);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  position: relative; z-index: 1;
}
.ss-logo { display: flex; align-items: center; gap: 9px; color: var(--white); }
.ss-logo span { font-family: var(--font-logo); font-weight: 700; font-size: 22px; letter-spacing: -.05em; }
.site-nav { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; font-size: 15px; }
.site-nav a { color: var(--white); }
.site-nav .nav-cta { background: var(--blue); padding: 11px 20px; border-radius: var(--radius-pill); font-weight: 600; }

.hero {
  margin: 0; padding: 56px var(--pad-x) 88px calc(var(--pad-x) + clamp(0px, 3vw, 64px));
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 64px; align-items: center; position: relative; z-index: 1;
}
.hero-copy { display: flex; flex-direction: column; gap: 28px; }
.hero-copy .kicker { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 13px; color: var(--coral); letter-spacing: .02em; }
.kicker-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-logo); font-weight: 700; font-size: 18px; letter-spacing: -.04em; color: var(--white); }
.kicker-logo { display: block; width: 26px; height: 26px; }
.hero-copy h1 {
  font-weight: 800; font-size: clamp(52px, 7.4vw, 108px); line-height: .9;
  letter-spacing: -.05em; text-wrap: balance;
}
.hero-copy p { font-size: 20px; line-height: 1.5; max-width: 520px; text-wrap: pretty; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { font-family: var(--font-mono); font-size: 13px; color: var(--slate); }

.hero-visual { display: flex; justify-content: center; }
/* ---------- Demo interattiva dell'app nella home ---------- */
.hero-visual { flex-direction: column; align-items: center; gap: 18px; }
.phone-hint {
  position: relative; z-index: 2; font-family: var(--font-mono); font-size: 12px; color: #cbd5e1;
  padding: 6px 12px; border-radius: 999px; background: rgba(15, 23, 41, .72);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.phone {
  --ph-blue: #2f6bff; --ph-tint: #eaf1fd; --ph-ink: #0f1729; --ph-muted: #5b6475; --ph-green: #157f4b;
  position: relative; width: 316px; max-width: 100%; aspect-ratio: 316 / 660;
  padding: 10px; border-radius: 52px; background: #0b0f17;
  box-shadow: inset 0 0 0 1.5px #3b414d, 0 30px 60px rgba(0, 0, 0, .35);
  color: var(--ph-ink); font-family: -apple-system, "SF Pro Text", system-ui, sans-serif;
}
.phone__screen { position: relative; height: 100%; border-radius: 42px; overflow: hidden; background: #f4f6fb; }
.ph-ico { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ph-ico--blue { color: var(--ph-blue); }

.ph-status { position: relative; display: flex; justify-content: space-between; align-items: center; height: 46px; padding: 10px 22px 0 30px; font-size: 14px; font-weight: 600; }
.ph-island { position: absolute; left: 50%; top: 11px; width: 80px; height: 25px; transform: translateX(-50%); border-radius: 20px; background: #0b0f17; }
.ph-status__icons { display: flex; align-items: center; gap: 4px; }
.ph-status__icons svg { height: 10px; width: auto; }
.ph-status__icons svg { fill: currentColor; }

.ph-home { display: flex; flex-direction: column; gap: 11px; padding: 6px 16px 0; }
.ph-head { display: flex; justify-content: space-between; align-items: flex-start; }
.ph-head > div { display: flex; flex-direction: column; gap: 4px; }
.ph-hello { font-size: 25px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.ph-date { font-size: 13px; color: var(--ph-muted); }
.ph-bell { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--white); }
.ph-bell svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.ph-clock { display: grid; grid-template-columns: 1fr 1.08fr; background: var(--ph-tint); border-radius: 20px; padding: 14px 12px; }
.ph-clock__now { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-right: 10px; border-right: 1px solid rgba(91, 100, 117, .25); justify-content: center; }
.ph-clock__now .ph-ico { width: 20px; height: 20px; }
.ph-clock__time { font-family: var(--font-mono); font-size: 21px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ph-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; background: #dbe6fd; color: var(--ph-blue); font-size: 11px; font-weight: 600; transition: background .25s ease, color .25s ease; }
.ph-pill__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ph-pill.is-on { background: #dcf3e6; color: var(--ph-green); }
.ph-pill.is-on .ph-pill__dot { animation: ph-blink 1.6s ease-in-out infinite; }
.ph-clock__plan { display: flex; flex-direction: column; padding-left: 10px; min-width: 0; }
.ph-label { font-size: 9.5px; color: var(--ph-muted); margin-top: 6px; }
.ph-label:first-child { margin-top: 0; }
.ph-value { font-family: var(--font-mono); font-size: 13px; margin-top: 2px; }
.ph-job { font-size: 10.5px; font-weight: 700; margin-top: 2px; white-space: nowrap; }

.ph-stamp {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 16px; border: none; border-radius: 16px;
  background: var(--ph-blue); color: var(--white); font: inherit; font-size: 16px; font-weight: 700; text-align: left; cursor: pointer;
  transition: background .25s ease, color .25s ease, transform .1s ease;
}
.ph-stamp span { flex: 1; }
.ph-stamp:active { transform: scale(.98); }
.ph-stamp.is-out { background: var(--coral); color: var(--navy); }
.ph-stamp:disabled { cursor: default; opacity: .7; }

.ph-card { display: flex; flex-direction: column; gap: 10px; background: var(--white); border-radius: 18px; padding: 13px 14px; }
.ph-card__head { display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 700; }
.ph-link { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--ph-blue); }
.ph-link .ph-ico { width: 14px; height: 14px; }
.ph-recent { display: flex; align-items: center; gap: 8px; border-radius: 10px; transition: background .4s ease; }
.ph-recent.is-fresh { animation: ph-fresh 1.6s ease; }
.ph-recent__main { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ph-recent__main b { font-size: 13px; }
.ph-recent__main > span { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ph-muted); }
.ph-recent__main .ph-ico { width: 13px; height: 13px; }
.ph-recent__status { font-size: 11px; font-weight: 600; color: var(--ph-green); }
.ph-recent__status.is-open { color: var(--ph-blue); }
.ph-chevron { width: 15px; height: 15px; color: var(--ph-muted); }
.ph-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ph-tile { display: flex; align-items: center; gap: 7px; padding: 10px 8px; border-radius: 14px; background: var(--ph-tint); }
.ph-tile span { display: flex; flex-direction: column; font-size: 10px; color: var(--ph-muted); line-height: 1.25; }
.ph-tile b { font-size: 12px; color: var(--ph-ink); }

.ph-nav {
  position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 8px 6px 22px; background: var(--white); border-top: 1px solid #e3e7ef;
}
.ph-nav span { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: #3d4556; }
.ph-nav i { display: grid; place-items: center; width: 42px; height: 24px; border-radius: 12px; }
.ph-nav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.ph-nav .is-active { color: var(--ph-blue); }
.ph-nav .is-active i { background: var(--ph-tint); }
.ph-nav .is-active svg { fill: currentColor; }

.ph-scan {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center;
  background: rgba(11, 15, 23, .94); color: var(--white); animation: ph-fade .2s ease;
}
.ph-scan__view, .ph-scan__done { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.ph-scan__title { font-size: 17px; font-weight: 700; }
.ph-scan__hint { font-family: var(--font-mono); font-size: 12px; color: #c5cee0; }
.ph-finder { position: relative; width: 172px; height: 172px; display: grid; place-items: center; border-radius: 22px; overflow: hidden; }
.ph-finder::before {
  content: ""; position: absolute; inset: 0; border-radius: 22px; pointer-events: none;
  border: 4px solid var(--coral);
  -webkit-mask: linear-gradient(#000 0 0) top left / 34px 34px no-repeat, linear-gradient(#000 0 0) top right / 34px 34px no-repeat, linear-gradient(#000 0 0) bottom left / 34px 34px no-repeat, linear-gradient(#000 0 0) bottom right / 34px 34px no-repeat;
          mask: linear-gradient(#000 0 0) top left / 34px 34px no-repeat, linear-gradient(#000 0 0) top right / 34px 34px no-repeat, linear-gradient(#000 0 0) bottom left / 34px 34px no-repeat, linear-gradient(#000 0 0) bottom right / 34px 34px no-repeat;
}
.ph-finder__qr { display: grid; grid-template-columns: repeat(21, 1fr); width: 112px; height: 112px; padding: 6px; border-radius: 8px; background: var(--white); }
.ph-finder__qr .on { background: var(--navy); }
.ph-finder__line {
  position: absolute; left: 12%; right: 12%; top: 18%; height: 3px; border-radius: 3px;
  background: var(--coral); box-shadow: 0 0 12px var(--coral); animation: ph-sweep 1.1s ease-in-out infinite alternate;
}
.ph-scan.is-found .ph-finder__line { animation: none; opacity: 0; }
.ph-scan.is-found .ph-finder::before { border-color: #4ade80; }
.ph-check { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--ph-blue); animation: ph-pop .35s cubic-bezier(.2, .9, .3, 1.4); }
.ph-check svg { width: 44px; height: 44px; fill: none; stroke: #fff; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.ph-scan__done b { font-size: 19px; letter-spacing: -.02em; }
.ph-scan__done > span:last-child { font-family: var(--font-mono); font-size: 13px; color: #c5cee0; }

@keyframes ph-sweep { to { top: 80%; } }
@keyframes ph-fade { from { opacity: 0; } }
@keyframes ph-pop { from { transform: scale(.4); opacity: 0; } }
@keyframes ph-blink { 50% { opacity: .35; } }
@keyframes ph-fresh { from { background: #dbe6fd; } }

@media (prefers-reduced-motion: reduce) {
  .ph-finder__line, .ph-check, .ph-scan, .ph-pill.is-on .ph-pill__dot, .ph-recent.is-fresh { animation: none; }
}

/* ---------- Come funziona ---------- */
.step-card {
  border: 1px solid var(--line); border-radius: var(--radius-card); padding: 32px;
  display: flex; flex-direction: column; gap: 14px;
}
.step-card--blue { background: var(--blue); color: var(--white); border-color: var(--blue); }
.step-card .num { font-family: var(--font-mono); font-size: 15px; color: var(--blue); padding-bottom: 8px; }
.step-card--blue .num { color: var(--white); }
.step-card h3, .card-title { font-weight: 800; font-size: 30px; line-height: 1; letter-spacing: -.03em; }
.step-card p, .feature p, .timeline p { font-size: 16px; line-height: 1.5; }

/* ---------- Funzioni ---------- */
.feature {
  background: color-mix(in oklch, var(--slate) 14%, white); border-radius: var(--radius-card); padding: 32px;
  display: flex; flex-direction: column; gap: 12px;
}
.feature--navy { background: var(--navy); color: var(--white); }
.feature h3, .timeline h3 { font-weight: 800; font-size: 26px; line-height: 1.05; letter-spacing: -.03em; }
.feature h3 { margin-top: 8px; }

/* ---------- Prezzi ---------- */
.plan {
  border: 1px solid var(--line); border-radius: var(--radius-card); padding: 36px;
  display: flex; flex-direction: column; gap: 24px;
}
.plan--pro { background: var(--blue); color: var(--white); border-color: var(--blue); }
.plan__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.plan__head h3 { font-weight: 800; font-size: 44px; letter-spacing: -.04em; line-height: 1; }
.plan__head .pill { align-self: auto; }
.plan__price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 16px; }
.plan__price .mono { font-size: 40px; font-weight: 500; letter-spacing: -.03em; }
.plan__features { display: flex; flex-direction: column; gap: 10px; font-size: 16px; list-style: none; margin: 0; padding: 0; }
.plan__features li::before { content: ">"; font-family: var(--font-mono); color: var(--blue); margin-right: .45em; }
.plan--pro .plan__features li::before { color: var(--white); }
.tiers { display: flex; flex-direction: column; font-family: var(--font-mono); font-size: 13px; border-top: 1px solid var(--line); margin-top: auto; }
.tiers div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(148, 163, 184, .35); }
.tiers div:last-child { border-bottom: none; }
.plan--pro .tiers { border-top-color: rgba(255, 255, 255, .5); }
.plan--pro .tiers div { border-bottom-color: rgba(255, 255, 255, .3); }
.plan--pro .tiers div:last-child { border-bottom: none; }
.plan .btn { padding: 15px 24px; }
.plan--base .btn { background: var(--white); color: var(--navy); border: 1.5px solid var(--navy); }
.plan--pro .btn { background: var(--white); color: var(--blue); padding: 16.5px 24px; }

.calc {
  background: var(--navy); color: var(--white); border-radius: var(--radius-card); padding: clamp(28px, 4vw, 48px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 40px; align-items: center;
}
.calc__input { display: flex; flex-direction: column; gap: 22px; }
.calc .muted { color: var(--slate); }
.toggle { display: flex; gap: 6px; background: rgba(148, 163, 184, .18); padding: 5px; border-radius: var(--radius-pill); align-self: flex-start; }
.toggle button {
  border: none; cursor: pointer; padding: 10px 22px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: 15px; background: transparent; color: var(--white);
}
.toggle button[aria-pressed="true"] { background: var(--blue); }
.employees { display: flex; flex-direction: column; gap: 12px; }
.employees__row { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; }
.employees__row input {
  width: 130px; text-align: right; background: transparent; border: 1.5px solid var(--line);
  border-radius: var(--radius-field); padding: 6px 12px; color: var(--white);
  font-family: var(--font-mono); font-size: 26px; font-weight: 500; outline: none;
}
.employees__scale { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; color: var(--slate); }
.calc__out { display: flex; flex-direction: column; gap: 14px; font-family: var(--font-mono); font-size: 15px; }
.calc__out .line { display: flex; justify-content: space-between; gap: 16px; }
.calc__total {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  border-top: 1px solid rgba(148, 163, 184, .5); padding-top: 18px; margin-top: 4px;
}
.calc__total > span:first-child { font-family: var(--font-display); font-size: 18px; }
.calc__total output { font-size: clamp(36px, 4.4vw, 52px); font-weight: 500; letter-spacing: -.04em; color: var(--coral); }
.calc__note { font-size: 12px; color: var(--slate); }

/* ---------- Prova gratuita (timeline) ---------- */
.timeline { --bar: var(--blue); position: relative; display: flex; flex-direction: column; gap: 12px; padding-top: 22px; }
.timeline::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--bar); transform-origin: left; }
.timeline .tag { font-family: var(--font-mono); font-size: 13px; color: var(--blue); }
.timeline--coral { --bar: var(--coral); }
.timeline--slate { --bar: var(--slate); }
.timeline--coral .tag, .timeline--slate .tag { color: inherit; }

/* ---------- CTA ---------- */
.cta {
  background: var(--blue); color: var(--white); border-radius: var(--radius-card); padding: clamp(28px, 5vw, 64px);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap;
}
.cta__copy { display: flex; flex-direction: column; gap: 20px; max-width: 720px; }
.cta__copy .eyebrow { color: var(--white); }
.cta__copy p { max-width: 560px; }
.cta .btn { background: var(--coral); color: var(--navy); padding: 18px 30px; font-size: 17px; }

/* ---------- FAQ ---------- */
.faq {
  padding-block: 72px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 40px;
}
.faq__intro { display: flex; flex-direction: column; gap: 16px; }
.faq__intro .lead { max-width: 420px; }
.contact-card {
  background: var(--blue); color: var(--white); border-radius: var(--radius-card); padding: 32px;
  display: flex; flex-direction: column; gap: 14px; margin-top: 16px; max-width: 460px;
}
.contact-card .mono { font-size: 13px; }
.contact-card__lines { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-mono); font-size: 15px; margin-top: 6px; }
.contact-card__lines a { color: var(--white); }
.contact-card .btn { background: var(--white); color: var(--blue); padding: 14px 22px; align-self: flex-start; margin-top: 6px; }

.faq__list { display: flex; flex-direction: column; align-self: center; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item button {
  width: 100%; background: none; border: none; cursor: pointer; color: var(--navy); text-align: left;
  padding: 22px 0; display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.faq-item .q { font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.faq-item .sign { font-family: var(--font-mono); font-size: 18px; color: var(--blue); }
.faq-item p { margin: 0 0 22px; font-size: 16px; line-height: 1.5; max-width: 620px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: var(--white); }
.site-footer .container { padding-block: 64px 40px; display: flex; flex-direction: column; gap: 48px; }
.footer-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.footer-brand { display: flex; flex-direction: column; gap: 20px; }
.footer-brand .product-logo { align-self: flex-start; }
.product-logo { display: flex; align-items: center; gap: 12px; color: var(--white); font-family: var(--font-logo); font-weight: 700; font-size: 30px; letter-spacing: -.05em; }
.product-logo img { display: block; width: 44px; height: 44px; }
.footer-brand p { font-size: 18px; line-height: 1.45; max-width: 380px; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid rgba(148, 163, 184, .4); padding-top: 24px;
  font-family: var(--font-mono); font-size: 12px; color: var(--slate);
}

.footer-bottom a, .footer-link { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom a:hover, .footer-link:hover { color: var(--white); }

/* ---------- Transizione verso la pagina di prova ---------- */
.page-transition { position: fixed; inset: 0; z-index: 1000; pointer-events: all; overflow: hidden; }
.page-transition__circle {
  position: absolute; border-radius: 50%; background: var(--navy);
  transform: translate(-50%, -50%) scale(0);
  transition: transform .7s cubic-bezier(.7, 0, .2, 1);
}
.page-transition__logo {
  position: absolute; left: 50%; top: 50%; width: min(140px, 40vw); height: auto;
  transform: translate(-50%, calc(-50% + 16px)); opacity: 0;
  transition: opacity .35s ease .4s, transform .45s cubic-bezier(.2, .8, .2, 1) .4s;
}
.page-transition.is-active .page-transition__circle { transform: translate(-50%, -50%) scale(1); }
.page-transition.is-active .page-transition__logo { opacity: 1; transform: translate(-50%, -50%); }

/* Verso la home SoftSignals: navy del sito madre, l'onda si disegna e poi arriva il nome */
.page-transition--ss .page-transition__circle { background: #0B1A2E; }
.page-transition--ss .ss-mark {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 16px; color: #F5F7FA;
}
.page-transition--ss .ss-mark svg { width: 76px; height: 54px; overflow: visible; }
.page-transition--ss .ss-mark path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.page-transition--ss .ss-mark span {
  font-family: var(--font-logo); font-weight: 700; font-size: 44px; letter-spacing: -.05em;
  opacity: 0; transform: translateX(-12px);
}
.page-transition--ss.is-active .ss-mark path { stroke-dashoffset: 0; transition: stroke-dashoffset .6s cubic-bezier(.6, 0, .2, 1) .4s; }
.page-transition--ss.is-active .ss-mark span { opacity: 1; transform: none; transition: opacity .35s ease .75s, transform .45s cubic-bezier(.2, .8, .2, 1) .75s; }
@media (max-width: 480px) {
  .page-transition--ss .ss-mark { gap: 12px; }
  .page-transition--ss .ss-mark svg { width: 56px; height: 40px; }
  .page-transition--ss .ss-mark span { font-size: 32px; }
}

/* Arrivo da un'altra pagina: il pannello blu col logo scorre via verso l'alto */
html.enter body::after {
  content: ""; position: fixed; inset: 0; z-index: 1000; pointer-events: none;
  background: var(--navy) url("../assets/qrario-icona.svg") center / min(140px, 40vw) auto no-repeat;
  animation: cover-out .7s cubic-bezier(.7, 0, .2, 1) .15s forwards;
}

@keyframes cover-out { to { transform: translateY(-100%); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(24px); } }

@media (prefers-reduced-motion: reduce) {
  html.enter body::after { display: none; }
}

/* ---------- Animazioni della pagina ---------- */

/* Ingresso della parte alta, a ogni caricamento. Se si arriva dalla pagina di
   prova parte dopo che il pannello blu e scivolato via. */
:root { --intro-delay: 0s; }
html.enter { --intro-delay: .45s; }
.hero-copy > *, .hero-visual { animation: rise-in .7s cubic-bezier(.2, .8, .2, 1) both; }
.hero-copy > :nth-child(1) { animation-delay: calc(var(--intro-delay) + .05s); }
.hero-copy > :nth-child(2) { animation-delay: calc(var(--intro-delay) + .12s); }
.hero-copy > :nth-child(3) { animation-delay: calc(var(--intro-delay) + .22s); }
.hero-copy > :nth-child(4) { animation-delay: calc(var(--intro-delay) + .3s); }
.hero-copy > :nth-child(5) { animation-delay: calc(var(--intro-delay) + .38s); }
.hero-visual { animation-delay: calc(var(--intro-delay) + .25s); animation-duration: .9s; }
.site-header { animation: fade-in .6s ease both; animation-delay: var(--intro-delay); }

/* Rivelazione allo scroll. La classe has-reveal la mette lo script: senza
   JavaScript tutto resta visibile. "translate" e separato da "transform", cosi
   l'hover delle card non si scontra con la rivelazione. */
html.has-reveal [data-reveal] {
  opacity: 0; translate: 0 28px;
  transition: opacity .7s ease var(--d, 0ms), translate .8s cubic-bezier(.2, .8, .2, 1) var(--d, 0ms),
              transform .25s ease, box-shadow .25s ease;
}
html.has-reveal [data-reveal].is-visible { opacity: 1; translate: 0 0; }
html.has-reveal .timeline::before { transform: scaleX(0); transition: transform .9s cubic-bezier(.65, 0, .25, 1) calc(var(--d, 0ms) + .15s); }
html.has-reveal .timeline.is-visible::before { transform: scaleX(1); }

/* Hover delle card */
.step-card, .feature, .plan { transition: transform .25s ease, box-shadow .25s ease; }
.step-card:hover, .feature:hover, .plan:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(30, 41, 61, .12); }

/* Risposta delle FAQ */
.faq-item p:not([hidden]) { animation: rise-in .35s cubic-bezier(.2, .8, .2, 1) both; }

@keyframes fade-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .hero-copy > *, .hero-visual, .site-header, .faq-item p:not([hidden]) { animation: none; }
  html.has-reveal [data-reveal] { opacity: 1; translate: none; transition: none; }
  html.has-reveal .timeline::before { transform: none; transition: none; }
  .step-card:hover, .feature:hover, .plan:hover { transform: none; }
}

/* ---------- Animazioni, secondo livello ---------- */

/* Titoli parola per parola: lo script avvolge ogni parola in .w > .w__i. */
/* La maschera lascia spazio ai lati e sotto (lettere strette, code di g e p) e
   viene tolta del tutto a fine animazione (.is-done), cosi nulla resta tagliato. */
.w { display: inline-block; vertical-align: top; clip-path: inset(-.4em -.4em -.28em -.4em); }
.w.is-done { clip-path: none; }
.w__i { display: inline-block; }
.hero-copy > h1 { animation: none; }
.hero-copy h1 .w__i { animation: word-up .9s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--intro-delay) + .12s + var(--i) * 70ms); }
html.has-reveal .section-head h2 .w__i, html.has-reveal .cta h2 .w__i, html.has-reveal .faq__intro h2 .w__i {
  translate: 0 145%; transition: translate .8s cubic-bezier(.2, .8, .2, 1) calc(var(--i) * 45ms + 80ms);
}
html.has-reveal .is-visible h2 .w__i, html.has-reveal h2.is-visible .w__i { translate: 0 0; }
@keyframes word-up { from { transform: translateY(145%); } }

/* "da sole." si sottolinea da solo dopo l'ingresso del titolo */
.hero-copy h1 .blue { position: relative; }
.hero-copy h1 .blue::after {
  content: ""; position: absolute; left: 0; right: .25em; bottom: .02em; height: .07em; border-radius: 1em;
  background: var(--coral); transform: scaleX(0); transform-origin: left;
  animation: underline-in .8s cubic-bezier(.65, 0, .25, 1) forwards; animation-delay: calc(var(--intro-delay) + 1.05s);
}
@keyframes underline-in { to { transform: scaleX(1); } }

/* Telefono: fluttua, si inclina seguendo il mouse, bolle di timbrature intorno */
.hero-visual { perspective: 1200px; }
.phone-stage { position: relative; transform-style: preserve-3d; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.phone-stage .phone { animation: phone-float 6s ease-in-out infinite; animation-delay: calc(var(--intro-delay) + 1.2s); }
@keyframes phone-float { 50% { translate: 0 -12px; } }

.stamp-bubbles { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.stamp-bubble {
  position: absolute; display: flex; align-items: center; gap: 10px; padding: 9px 14px 9px 9px;
  border-radius: 999px; background: var(--white); color: var(--navy); white-space: nowrap;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
  opacity: 0; scale: .7; translate: 0 10px;
  transition: opacity .35s ease, scale .45s cubic-bezier(.2, .9, .3, 1.3), translate .45s cubic-bezier(.2, .9, .3, 1.3);
}
.stamp-bubble.is-on { opacity: 1; scale: 1; translate: 0 0; }
.stamp-bubble__av {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  font-family: var(--font-mono); font-size: 11px; background: var(--blue); color: var(--white);
}
.stamp-bubble.is-out .stamp-bubble__av { background: var(--coral); color: var(--navy); }
.stamp-bubble b { display: block; font-size: 13px; }
.stamp-bubble small { display: block; font-family: var(--font-mono); font-size: 11px; color: #475569; }
/* Sul lato sinistro del telefono, a zig-zag: a destra c'e poco spazio prima del bordo. */
.stamp-bubble--a { right: calc(100% - 22px); top: 120px; }
.stamp-bubble--b { right: calc(100% + 26px); top: 290px; }
.stamp-bubble--c { right: calc(100% - 28px); bottom: 100px; }
@media (max-width: 760px) { .stamp-bubbles { display: none; } }

/* Pulsanti principali: un riflesso di luce passa ogni tanto */
.btn--blue, .cta .btn, .nav-cta { position: relative; overflow: hidden; isolation: isolate; }
.btn--blue::after, .cta .btn::after, .nav-cta::after {
  content: ""; position: absolute; inset: 0 auto 0 -60%; width: 45%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-20deg); animation: shine 5s ease-in-out infinite; animation-delay: calc(var(--intro-delay) + 2s);
}
@keyframes shine { 0%, 65% { left: -60%; } 100% { left: 130%; } }

/* Riquadro "Inizia oggi": orbita tratteggiata che gira e anello che pulsa */
.cta { position: relative; overflow: hidden; }
.cta > :not(.cta__orbit):not(.cta__pulse) { position: relative; z-index: 1; }
.cta__orbit, .cta__pulse { position: absolute; border-radius: 50%; pointer-events: none; }
.cta__orbit { right: -140px; top: -180px; width: 460px; height: 460px; border: 2px dashed rgba(255, 255, 255, .4); animation: spin 40s linear infinite; }
.cta__pulse { right: -60px; top: -100px; width: 300px; height: 300px; border: 34px solid rgba(255, 171, 64, .9); animation: pulse-ring 4.5s ease-in-out infinite; }
@keyframes spin { to { rotate: 360deg; } }
@keyframes pulse-ring { 50% { scale: 1.08; opacity: .75; } }

@media (prefers-reduced-motion: reduce) {
  .hero-copy h1 .w__i, .phone-stage .phone, .btn--blue::after, .cta .btn::after, .nav-cta::after,
  .cta__orbit, .cta__pulse { animation: none; }
  .hero-copy h1 .blue::after { animation: none; transform: scaleX(1); }
  html.has-reveal .section-head h2 .w__i, html.has-reveal .cta h2 .w__i, html.has-reveal .faq__intro h2 .w__i { translate: none; transition: none; }
  .stamp-bubbles { display: none; }
  .phone-stage { transition: none; }
}

/* ---------- Telefono, tablet e schermi stretti ---------- */

/* Le bolle vanno di lato al telefono: servono le due colonne della hero. */
@media (max-width: 1100px) { .stamp-bubbles { display: none; } }

@media (max-width: 720px) {
  /* Menu: in riga ci stanno solo il logo e "Prova gratis". */
  .site-header { flex-wrap: nowrap; padding-block: 18px; }
  .site-nav a:not(.nav-cta):not(.lang-switch) { display: none; }
  .site-nav .nav-cta { white-space: nowrap; padding: 10px 16px; }
  .site-nav { flex-wrap: nowrap; gap: 10px; }
  .lang-switch { padding: 5px 8px; font-size: 12px; }
  .hero { padding-left: var(--pad-x); padding-top: 32px; gap: 40px; }
  .hero-copy .kicker { flex-wrap: wrap; row-gap: 6px; }

  .plan { padding: 28px 22px; }
  .plan__head h3 { font-size: 38px; }
  .tiers div { gap: 12px; }
  .tiers div span:last-child { white-space: nowrap; }
  .calc { padding: 28px 22px; gap: 28px; }
  .calc__total { flex-wrap: wrap; }
  .calc__total output { white-space: nowrap; }

  /* Anello e orbita del riquadro finale: in basso a destra, lontani dal testo. */
  .cta__orbit { width: 300px; height: 300px; top: -190px; right: -190px; }
  .cta__pulse { width: 160px; height: 160px; border-width: 20px; top: -96px; right: -96px; }
  .cta .btn { width: 100%; padding: 17px 20px; font-size: 16px; }
}

@media (max-width: 420px) {
  .hero-copy h1 { font-size: clamp(40px, 13.5vw, 56px); }
  .hero-copy p { font-size: 18px; }
  /* Il logo va su una riga sua: il puntino separatore resterebbe isolato. */
  .hero-copy .kicker > span[aria-hidden] { display: none; }
  .hero-copy .kicker { flex-direction: column; align-items: flex-start; gap: 8px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .tiers { font-size: 12px; }
  .site-header { gap: 12px; }
  .ss-logo { gap: 7px; }
  .ss-logo svg { width: 30px; height: 21px; }
  .ss-logo span { font-size: 19px; }
  .site-nav .nav-cta { padding: 9px 14px; font-size: 14px; }
}

/* Telefoni molto stretti: il telefono dimostrativo si rimpicciolisce un poco. */
@media (max-width: 359px) {
  .phone-stage { zoom: .86; }
  /* Resta il solo simbolo del logo, per far stare selettore lingua e "Prova gratis". */
  .ss-logo span { display: none; }
}

/* Selettore lingua IT / EN */
.lang-switch {
  font-family: var(--font-mono); font-size: 13px; color: #cbd5e1 !important;
  padding: 6px 10px; border: 1px solid rgba(148, 163, 184, .45); border-radius: 999px;
}
.lang-switch:hover { border-color: var(--slate); }
