:root {
  --bg: #f7f4ef;
  --bg-deep: #ece7df;
  --bg-deeper: #e8e2d8;
  --ink: #0b1f33;
  --ink-soft: #16324a;
  --muted: #3a4a5a;
  --soft: #4a5a6a;
  --line: #d4cdc2;
  --line-soft: #e4ded4;
  --card: #fff;
  --on: #f7f4ef;
  --accent: #cdb056;
  --accent-soft: #f5efd8;
  --demo: #8b1e1e;
  --demo-soft: #f5e6e6;
  --ok: #1f5c3a;
  --ok-soft: #e3f0e8;
  --wait-ink: #5a4820;
  --sans: -apple-system, "SF Pro Text", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --doc: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --k: 1; /* fattore di scala del device (impostato da JS) */
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
html {
  color-scheme: light;
  cursor: url("/assets/cursor-appare.png") 12 4, auto;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(1200px 640px at 50% -8%, #fff 0%, var(--bg) 52%, var(--bg-deeper) 100%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); }
a,
button,
[role="button"],
[data-tap],
.tab,
.ghost,
.cta,
.btn-home,
.btn-ink {
  cursor: url("/assets/cursor-viewfinder.png") 12 12, pointer;
}
img,
svg,
a,
.brand {
  -webkit-user-drag: none;
}
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
svg { display: inline-block; vertical-align: middle; }

/* ---------- Page chrome ---------- */
.stage {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 10px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.chrome {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-height: 48px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-soft);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 14px;
  min-height: 44px;
}
.chip {
  background: var(--demo-soft);
  color: var(--demo);
  border: 1px solid #e8c8c8;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.chrome-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}
.btn-home:hover,
.btn-home:focus-visible {
  border-color: var(--ink);
  background: var(--bg-deep);
  outline: none;
}
.btn-home svg,
.cta svg {
  flex-shrink: 0;
}
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--on);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}
.cta:hover,
.cta:focus-visible {
  background: var(--ink-soft);
  outline: none;
}
@media (max-width: 28em) {
  .btn-home span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  .btn-home {
    width: 40px;
    padding: 0;
  }
}

.caption-wrap {
  display: grid;
  gap: 2px;
  justify-items: center;
  min-height: 60px;
  max-width: 34rem;
}
.step {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
}
.caption {
  margin: 0;
  text-align: center;
  font-size: clamp(17px, 2.4vw, 24px);
  font-weight: 700;
  color: var(--ink-soft);
  line-height: 1.25;
  transition: opacity 160ms ease, transform 160ms ease;
}
.caption.is-swap { opacity: 0; transform: translateY(3px); }
.disclaimer {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--soft);
}

/* ---------- Device (design fisso 360×780, scalato con --k) ---------- */
.device-wrap {
  position: relative;
  width: calc(360px * var(--k));
  height: calc(780px * var(--k));
  flex: none;
}
.device {
  position: absolute;
  left: 50%;
  top: 0;
  width: 360px;
  height: 780px;
  margin-left: -180px;
  transform: scale(var(--k));
  transform-origin: top center;
  background: #0a1a2b;
  border-radius: 46px;
  padding: 9px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 24px 60px rgba(11, 31, 51, 0.22),
    0 2px 6px rgba(11, 31, 51, 0.12);
}
.island {
  position: absolute;
  left: 50%;
  top: 19px;
  width: 108px;
  height: 30px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #0a1a2b;
  z-index: 5;
}
.screen {
  position: relative;
  height: 100%;
  background: var(--bg);
  border-radius: 38px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 15px;
}

.statusbar {
  flex: none;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 0 28px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.sb-right { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.sb-cell { display: inline-flex; align-items: flex-end; gap: 1.5px; height: 11px; }
.sb-cell b { width: 3px; background: var(--ink); border-radius: 1px; display: block; }
.sb-cell b:nth-child(1) { height: 4px; } .sb-cell b:nth-child(2) { height: 6px; }
.sb-cell b:nth-child(3) { height: 8px; } .sb-cell b:nth-child(4) { height: 11px; }
.sb-batt {
  width: 25px; height: 12px;
  border: 1.5px solid var(--ink); border-radius: 4px;
  padding: 1.5px; position: relative; display: inline-block;
}
.sb-batt b { display: block; height: 100%; width: 86%; background: var(--ink); border-radius: 1.5px; }
.sb-batt::after { content: ""; position: absolute; right: -4px; top: 3px; width: 2px; height: 4px; background: var(--ink); border-radius: 0 1px 1px 0; }

.apphd {
  flex: none;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line-soft);
}
.apphd-mark { color: var(--ink); }
.apphd-title { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.apphd-ex {
  margin-left: auto;
  color: var(--demo);
  background: var(--demo-soft);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.screen.is-clean .apphd,
.screen.is-clean .tabbar { display: none; }

.stage-app { position: relative; flex: 1; min-height: 0; }

/* ---------- Panes & transitions ---------- */
.pane {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px 14px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
}
.pane.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 320ms var(--ease), transform 360ms var(--ease), visibility 0s;
}
.pane-push { transform: translateX(28px); }
.pane-sheet { transform: translateY(44px); }
.pane-fade { transform: translateY(6px); }

.kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
}
h2 { margin: 0; font-size: 22px; line-height: 1.15; letter-spacing: -0.015em; }
h3 { margin: 0; }
.lede { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.35; }
.meta { margin: 0; font-size: 13px; color: var(--soft); line-height: 1.35; }
.meta svg { vertical-align: -2px; margin-right: 3px; }
.meta.center { text-align: center; }
.title { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.3; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
}
.row:last-of-type { border-bottom: 0; }
.row span { color: var(--soft); display: inline-flex; align-items: center; gap: 7px; }
.ok { color: var(--ok); font-size: 14px; }
.ready .ok { opacity: 0; transform: translateX(6px); animation: slide-in 320ms var(--ease) forwards; }
.ready .row:nth-child(1) .ok { animation-delay: 240ms; }
.ready .row:nth-child(2) .ok { animation-delay: 480ms; }
.ready .row:nth-child(3) .ok { animation-delay: 720ms; }
.hline { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }

.btn-ink {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--on);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  text-align: center;
  transition: transform 120ms ease, opacity 200ms ease, background 200ms ease;
}
.ghost-ink { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.is-pulse { animation: cta-pulse 1.4s ease-in-out infinite; }

.subhd {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  font-weight: 700;
  font-size: 16px;
}
.subhd small { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--soft); font-variant-numeric: tabular-nums; }
.subhd .status-chip { margin-left: auto; }

/* ---------- Status chip ---------- */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--bg-deep);
  color: var(--ink);
  transition: background 240ms ease, color 240ms ease, opacity 140ms ease;
}
.status-chip::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.status-chip.sm { min-height: 22px; font-size: 11px; padding: 0 7px; }
.status-chip[data-kind="wait"] { background: var(--accent-soft); color: var(--wait-ink); }
.status-chip[data-kind="sign"] { background: var(--ok-soft); color: var(--ok); }
.status-chip.is-swap { opacity: 0; }

/* ---------- 01 Problema ---------- */
#pane-problema { padding-top: 18px; }
.prob-top { display: grid; gap: 6px; }
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}
.shot {
  position: relative;
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
}
#pane-problema.is-on .shot-prima { animation: up 420ms var(--ease) 200ms both; }
#pane-problema.is-on .shot-ora { animation: up 420ms var(--ease) 650ms both; }
.shot .ph {
  position: relative;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background: #d9d1c4;
}
.shot img {
  width: 100%;
  height: 232px;
  object-fit: cover;
  display: block;
  transform-origin: 42% 46%;
}
#pane-problema.is-on .shot-prima img { animation: ken-soft 5s ease-out both; }
#pane-problema.is-on .shot-ora img { animation: ken-crack 4.4s cubic-bezier(0.3, 0.6, 0.2, 1) 900ms both; }
.ring {
  position: absolute;
  left: calc(42% - 17px);
  top: calc(44% - 17px);
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 0 1px rgba(11, 31, 51, 0.25) inset;
  opacity: 0;
}
#pane-problema.is-on .ring { animation: ring 1.1s ease 2.4s both; }
.shot figcaption {
  margin-top: 6px;
  display: grid;
  text-align: center;
  line-height: 1.2;
}
.shot figcaption span { font-size: 13px; font-weight: 700; color: var(--ink); }
.shot figcaption small { font-size: 11px; color: var(--soft); }
#pane-problema .lede { margin-top: 6px; }
#pane-problema .ghost-ink { margin-top: auto; }
#pane-problema.is-on .ghost-ink { animation: up 400ms var(--ease) 1.4s both; }

/* ---------- 02 Apri ---------- */
.apri-hero {
  position: relative;
  flex: 1;
  min-height: 140px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--ink);
}
.apri-hero img { width: 100%; height: 100%; object-fit: cover; opacity: 0.9; display: block; }
#pane-apri.is-on .apri-hero img { animation: ken-live 3.6s ease-out both; }
.apri-hero p {
  position: absolute;
  left: 12px; right: 12px; bottom: 12px;
  margin: 0;
  color: var(--on);
  font-weight: 700;
  font-size: 14px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}
#pane-apri.is-on .btn-ink { animation: up 400ms var(--ease) 1s both; }

/* ---------- 03 Scatto ---------- */
#pane-certificami { padding: 10px; }
.finder {
  position: relative;
  flex: 1;
  min-height: 200px;
  background: #06121f;
  border-radius: 14px;
  overflow: hidden;
}
.finder .live {
  position: absolute;
  inset: 0 0 92px 0;
  width: 100%;
  height: calc(100% - 92px);
  object-fit: cover;
  transform-origin: center;
  transition: transform 460ms var(--ease), border-radius 460ms var(--ease), opacity 300ms ease;
}
#pane-certificami.is-on .live { animation: hand 7s ease-in-out infinite; }
#pane-certificami.is-shot .live {
  animation: none;
  opacity: 0.22;
  transform: scale(1.02);
}
.bracket {
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid rgba(247, 244, 239, 0.9);
  transition: opacity 200ms ease;
}
.bracket.tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.bracket.tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; }
.bracket.bl { bottom: 104px; left: 12px; border-right: 0; border-top: 0; }
.bracket.br { bottom: 104px; right: 12px; border-left: 0; border-top: 0; }
#pane-certificami.is-shot .bracket { opacity: 0; }
.pill {
  position: absolute;
  margin: 0;
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(11, 31, 51, 0.72);
  color: var(--on);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(4px);
  transition: opacity 200ms ease;
}
.pill-top { left: 12px; top: 40px; }
.pill-cam { right: 12px; top: 40px; }
#pane-certificami.is-shot .pill { opacity: 0; }
.focus {
  position: absolute;
  left: 60%; top: 50%;
  width: 60px; height: 60px;
  margin: -30px 0 0 -30px;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  opacity: 0;
  box-shadow: 0 0 0 1px rgba(11, 31, 51, 0.4) inset;
}
.focus::before, .focus::after {
  content: "";
  position: absolute;
  background: var(--accent);
}
.focus::before { left: 50%; top: -6px; width: 1px; height: 6px; }
.focus::after { left: -6px; top: 50%; width: 6px; height: 1px; }
#pane-certificami.is-focus .focus { animation: focus 1s var(--ease) both; }
#pane-certificami.is-shot .focus { opacity: 0; animation: none; }
.camctl {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 92px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 18px;
  background: #06121f;
}
.thumb-slot {
  width: 40px; height: 40px;
  border-radius: 8px;
  border: 1.5px solid rgba(247, 244, 239, 0.35);
  justify-self: start;
  background: transparent center / cover no-repeat;
  transition: border-color 300ms ease;
}
#pane-certificami.is-shot .thumb-slot {
  border-color: var(--accent);
  background-image: url("./media/scatto.jpg");
  animation: pop 360ms var(--ease) 180ms both;
}
.count { justify-self: end; color: var(--on); font-size: 13px; font-weight: 600; opacity: 0.9; font-variant-numeric: tabular-nums; }
.shutter {
  width: 68px; height: 68px;
  border-radius: 50%;
  border: 3px solid var(--on);
  display: grid; place-items: center;
  transition: transform 120ms ease;
}
.shutter i {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--on);
  display: block;
  transition: transform 120ms ease;
}
.shutter.is-pressed { transform: scale(0.9); }
.shutter.is-pressed i { transform: scale(0.86); }
.capt-label {
  position: absolute;
  left: 0; right: 0; top: 42%;
  margin: 0;
  color: var(--on);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  opacity: 0;
}
.capt-label svg { color: var(--accent); }
#pane-certificami.is-shot .capt-label { animation: up 320ms var(--ease) 320ms both; }
.flash {
  position: absolute; inset: 0;
  background: #000; opacity: 0; pointer-events: none; z-index: 10;
}
.screen.is-flash .flash { animation: flash 200ms linear; }

/* ---------- 04 Verbale pronto ---------- */
#pane-verbale { padding-top: 22px; align-items: stretch; }
.check {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  display: grid; place-items: center;
  flex: none;
}
.check.sm { width: 40px; height: 40px; }
#pane-verbale.is-on .check { animation: pop 380ms var(--ease) 120ms both; }
#pane-verbale.is-on h2 { animation: up 360ms var(--ease) 220ms both; }
#pane-verbale.is-on .doc-row { animation: up 420ms var(--ease) 420ms both; }
#pane-verbale.is-on .btn-ink { animation: up 400ms var(--ease) 900ms both; }
#pane-verbale .btn-ink { margin-top: auto; }
.doc-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}
.doc-row.compact { align-items: center; }
.doc-meta { display: grid; gap: 4px; align-content: start; }
.doc-meta .status-chip { margin-top: 6px; justify-self: start; }
#pane-verbale .doc-row { margin-top: 6px; }
#pane-verbale .doc-cover { width: 118px; }
.inside {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.inside li { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.inside li svg { color: var(--ok); flex: none; }
#pane-verbale.is-on .inside { animation: up 420ms var(--ease) 640ms both; }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: #d9d1c4; display: block; }
.thumb.lg { width: 72px; height: 72px; }

/* HTML document cover */
.doc-cover {
  position: relative;
  width: 96px;
  aspect-ratio: 1 / 1.414;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(11, 31, 51, 0.14);
  font-family: var(--doc);
  padding: 0 0 6px;
  display: flex;
  flex-direction: column;
}
.doc-cover.sm { width: 70px; box-shadow: 0 6px 14px rgba(11, 31, 51, 0.12); }
.dc-band {
  height: 22%;
  background: var(--ink);
  color: var(--on);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border-bottom: 1.5px solid var(--accent);
}
.dc-band b { font-size: 8px; letter-spacing: 0.08em; }
.doc-cover.sm .dc-band b { font-size: 6.5px; }
.dc-title { margin: 10px 7px 0; font-size: 9px; font-weight: 700; color: var(--ink); line-height: 1.15; }
.doc-cover.sm .dc-title { font-size: 7px; margin-top: 7px; }
.dc-sub { margin: 3px 7px 0; font-size: 7px; color: var(--soft); }
.dc-lines { display: grid; gap: 4px; margin: 8px 7px 0; }
.dc-lines i { display: block; height: 2px; background: var(--line); border-radius: 1px; }
.dc-lines i:nth-child(2) { width: 70%; }
.dc-lines i:nth-child(3) { width: 85%; }
.dc-qr { position: absolute; right: 6px; bottom: 6px; width: 20px; height: 20px; }

/* ---------- 05 PDF ---------- */
#pane-pdf { padding: 8px 12px 12px; }
.pdf-frame {
  position: relative;
  flex: 1;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-deeper);
  padding: 0 10px;
}
.pdf-scroll {
  position: absolute;
  left: 10px; right: 10px; top: 0;
  height: 100%;
  transition: transform 680ms cubic-bezier(0.22, 0.8, 0.28, 1);
}
.pdf-edge {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 10px;
  background: linear-gradient(180deg, rgba(11, 31, 51, 0.08), transparent);
  pointer-events: none;
}
.page {
  height: 100%;
  background: #fff;
  border-top: 8px solid var(--bg-deeper);
  border-bottom: 2px solid var(--bg-deeper);
  padding: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--doc);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(11, 31, 51, 0.08);
}
.page > * { margin-left: 12px; margin-right: 12px; }
.pg-band {
  margin-left: 0; margin-right: 0;
  height: 30px;
  background: var(--ink);
  color: var(--on);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-bottom: 1.5px solid var(--accent);
}
.pg-band.slim { height: 24px; }
.pg-band b { font-size: 11px; letter-spacing: 0.1em; }
.pg-band span { margin-left: auto; font-size: 10px; opacity: 0.85; }
.pg-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; padding-bottom: 6px; border-bottom: 1px solid var(--ink); }
.pg-title.sm { font-size: 13px; }
.pg-table { border-collapse: collapse; width: calc(100% - 24px); font-size: 12.5px; }
.pg-table th, .pg-table td { text-align: left; padding: 6px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; line-height: 1.3; }
.pg-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.pg-sign div { border-top: 1px solid var(--ink); padding-top: 6px; display: grid; gap: 1px; }
.pg-sign small { font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--soft); font-weight: 700; }
.pg-sign b { font-size: 12px; }
.pg-sign span { font-size: 10px; color: var(--muted); }
.pg-table th { width: 32%; font-weight: 700; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--soft); padding-right: 6px; }
.pg-note { margin-top: 2px; font-size: 10.5px; line-height: 1.4; color: var(--muted); }
.pg-photo {
  border: 1px solid var(--accent);
  padding: 3px;
  background: #fff;
}
.pg-photo img { display: block; width: 100%; height: 236px; object-fit: cover; }
.pg-foot {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  font-size: 9px;
  line-height: 1.3;
  color: var(--soft);
  padding-top: 6px;
  border-top: 1px solid var(--line-soft);
}
.pg-foot .qr { width: 36px; height: 36px; flex: none; }
.pg-foot span:only-child { margin-left: auto; }

/* ---------- 06 Report list → detail ---------- */
#pane-report { padding: 0; }
.rep-list, .rep-detail {
  position: absolute;
  inset: 0;
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 360ms var(--ease), opacity 260ms ease;
}
.rep-detail { transform: translateX(100%); opacity: 0; }
#pane-report.is-detail .rep-list { transform: translateX(-18%); opacity: 0; }
#pane-report.is-detail .rep-detail { transform: none; opacity: 1; }
.filters { display: flex; gap: 6px; }
.f {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 13px;
  font-weight: 600;
  color: var(--soft);
}
.f.on { background: var(--ink); color: var(--on); border-color: var(--ink); }
.report {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  transition: transform 120ms ease;
}
.report .thumb { width: 72px; height: 72px; }
.report .body { min-width: 0; display: grid; gap: 3px; justify-items: start; }
.report .status-chip { margin-top: 4px; }
.rep-empty { margin: 4px 0 0; text-align: center; font-size: 13px; color: var(--soft); }
.pdf-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}
.doc-cover.xs { width: 34px; box-shadow: none; border-radius: 3px; }
.doc-cover.xs .dc-band { height: 24%; padding: 0 3px; }
.doc-cover.xs .dc-band b { font-size: 4.5px; }
.doc-cover.xs .dc-lines { margin: 5px 4px 0; gap: 3px; }
.link-ink { font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.timeline {
  list-style: none;
  margin: 2px 0 0;
  padding: 0 0 0 4px;
  display: grid;
  gap: 0;
}
.timeline li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  font-size: 15px;
  color: var(--soft);
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 7px; top: 50%;
  width: 2px; height: 100%;
  background: var(--line);
}
.timeline li:last-child::before { display: none; }
.timeline li i {
  position: relative;
  z-index: 1;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--line);
  flex: none;
  transition: background 240ms ease, border-color 240ms ease, transform 240ms var(--ease);
}
.timeline li.done i { background: var(--ink); border-color: var(--ink); }
.timeline li.done span { color: var(--ink); }
.timeline li.cur span { font-weight: 700; }
.timeline.st-wait .t-wait i { background: var(--accent); border-color: var(--accent); transform: scale(1.15); }
.timeline.st-wait .t-wait span { color: var(--ink); font-weight: 700; }
.timeline.st-wait .cur span { font-weight: 500; }
.timeline.st-sign .t-wait i { background: var(--ink); border-color: var(--ink); transform: none; }
.timeline.st-sign .t-wait span { color: var(--ink); font-weight: 500; }
.timeline.st-sign .t-sign i { background: var(--ok); border-color: var(--ok); transform: scale(1.15); }
.timeline.st-sign .t-sign span { color: var(--ok); font-weight: 700; }
#cta-richiedi { margin-top: auto; }
#pane-report.is-sent #cta-richiedi { opacity: 0.45; }

/* Bottom sheet — controparte */
.scrim {
  position: absolute;
  inset: 0;
  background: rgba(11, 31, 51, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 360ms ease;
  z-index: 2;
}
#pane-report.is-sheet .scrim { opacity: 1; }
.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--card);
  border-radius: 18px 18px 0 0;
  border-top: 1px solid var(--line);
  box-shadow: 0 -16px 40px rgba(11, 31, 51, 0.16);
  padding: 8px 16px 18px;
  transform: translateY(102%);
  transition: transform 420ms var(--ease);
  z-index: 3;
  display: grid;
  gap: 10px;
}
#pane-report.is-sheet .sheet { transform: none; }
.grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 2px; }
.cp-send, .cp-otp, .cp-done { display: none; gap: 10px; }
.cp-send { display: grid; }
#pane-report.is-cp .cp-send { display: none; }
#pane-report.is-cp .cp-otp { display: grid; animation: up 300ms var(--ease) both; }
#pane-report.is-signed .cp-otp { display: none; }
#pane-report.is-signed .cp-done { display: grid; justify-items: center; text-align: center; animation: up 300ms var(--ease) both; }
#pane-report.is-signed .cp-done .check { animation: pop 380ms var(--ease) both; }
#pane-report.is-sent #cta-invia { opacity: 0.45; }
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--ok-soft);
  color: var(--ok);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 240ms ease, transform 240ms var(--ease);
}
.toast div { display: grid; }
.toast strong { font-size: 14px; }
.toast span { font-size: 12px; color: var(--muted); }
#pane-report.is-sent .toast { opacity: 1; transform: none; }
.otp-slots {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  margin: 2px 0;
}
.otp-slots i {
  height: 46px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  display: grid;
  place-items: center;
  transition: transform 120ms ease, border-color 160ms ease, background 160ms ease;
}
.otp-slots i::after {
  content: "";
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ink);
  transform: scale(0);
  transition: transform 160ms var(--ease);
}
.otp-slots i.filled { border-color: var(--ink); background: #fff; }
.otp-slots i.filled::after { transform: scale(1); }
.otp-hint { margin: 0; font-size: 12px; color: var(--soft); }

/* ---------- 08 Verifica ---------- */
#pane-verifica { padding-top: 10px; }
.urlbar {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--bg-deep);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
.v-head { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
#pane-verifica.is-on .v-head .check { animation: pop 380ms var(--ease) 160ms both; }
.verify {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 6px 0;
}
.qr-wrap {
  width: 148px; height: 148px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid; place-items: center;
}
.qr-wrap .qr { width: 124px; height: 124px; }
#pane-verifica .doc-cover.sm { width: 92px; }
#pane-verifica .verify { padding: 10px 0; gap: 22px; }
#pane-verifica.is-on .verify { animation: up 420ms var(--ease) 380ms both; }
#pane-verifica.is-on .card { animation: up 420ms var(--ease) 600ms both; }
#pane-verifica.is-on .v-checks { animation: up 420ms var(--ease) 820ms both; }
#pane-verifica .btn-ink { margin-top: auto; }
#pane-verifica.is-on .btn-ink { animation: up 400ms var(--ease) 1.2s both; }

/* ---------- Touches ---------- */
.touch-layer { position: absolute; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.finger {
  position: absolute;
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  border: 1.5px solid rgba(247, 244, 239, 0.95);
  background: rgba(205, 176, 86, 0.32);
  box-shadow: 0 2px 10px rgba(11, 31, 51, 0.25);
  animation: finger 620ms var(--ease) forwards;
}
.finger::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: rgba(247, 244, 239, 0.98);
}
.finger.is-swipe { animation: swipe 560ms var(--ease) forwards; }
[data-tap].is-pressed { transform: scale(0.95); transition: transform 110ms ease; }
.report.is-pressed, .btn-ink.is-pressed { transform: scale(0.97); }
.otp-slots i.is-pressed { transform: scale(0.9); }

/* ---------- Tab bar ---------- */
.tabbar {
  flex: none;
  height: 64px;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line-soft);
  padding-bottom: 6px;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--soft);
  transition: color 200ms ease, transform 110ms ease;
}
.tab svg { width: 24px; height: 24px; }
.tab span { font-size: 10px; font-weight: 600; letter-spacing: 0.01em; }
.screen[data-tab="cert"] .tab-cert,
.screen[data-tab="report"] .tab-report { color: var(--ink); }
.screen[data-tab="cert"] .tab-cert span,
.screen[data-tab="report"] .tab-report span { font-weight: 700; }

/* ---------- Progress & controls ---------- */
.rail {
  width: min(420px, 92vw);
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.rail span {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
  cursor: pointer;
}
.rail span i { display: block; height: 100%; width: 0; background: var(--ink); }
.clockline {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}
.ghost {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 8px;
  min-height: 32px;
  padding: 0 12px;
  cursor: pointer;
  color: var(--ink);
}

.endcard {
  display: none;
  width: min(420px, 92vw);
  margin-top: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  text-align: center;
}
body.is-ended .endcard { display: block; animation: up 360ms var(--ease) both; }
.end-title { margin: 0; font-size: 17px; font-weight: 700; }
.end-sub { margin: 4px 0 12px; font-size: 13px; color: var(--muted); }
.end-actions { display: flex; gap: 8px; justify-content: center; }
.end-actions .cta { min-height: 48px; padding: 0 20px; }
.end-actions .ghost { min-height: 48px; padding: 0 16px; }

.site-footer--compact {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 8px 16px 28px;
  text-align: center;
  color: var(--soft);
}

.footer-compact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin: 0 0 10px;
  font-size: 13px;
}

.footer-compact-links a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.footer-compact-links a:hover {
  border-bottom-color: var(--gold, #cdb056);
}

.site-footer--compact .footer-legal,
.site-footer--compact .footer-copy {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--soft);
}

.site-footer--compact .footer-legal a,
.site-footer--compact .footer-copy a {
  color: inherit;
}

.site-footer--compact .footer-copy {
  margin-top: 4px;
  opacity: 0.85;
}

/* embed mode */
body.is-embed .chrome .cta,
body.is-embed .chrome-actions,
body.is-embed .site-footer,
body.is-embed .disclaimer,
body.is-embed .endcard { display: none; }
body.is-embed .stage { padding: 8px; }
body.is-embed .caption { font-size: 16px; }

/* record mode: niente UI di controllo / debug (export MP4) */
body.is-record .rail,
body.is-record .clockline,
body.is-record .disclaimer,
body.is-record .site-footer,
body.is-record .chrome-actions,
body.is-record .endcard { display: none !important; }
body.is-record .chrome .chip { opacity: 0.85; }
body.is-record .stage {
  min-height: 100vh;
  justify-content: center;
  padding: 24px 16px 32px;
}

/* ---------- Keyframes ---------- */
@keyframes up { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(0.8); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide-in { to { opacity: 1; transform: none; } }
@keyframes ken-soft { from { transform: scale(1.08); } to { transform: scale(1); } }
@keyframes ken-crack { from { transform: scale(1); } to { transform: scale(1.42); } }
@keyframes ring {
  0% { opacity: 0; transform: scale(1.6); }
  40% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.85; transform: scale(1); }
}
@keyframes ken-live { from { transform: scale(1.12) translateY(2%); } to { transform: scale(1.04); } }
@keyframes hand {
  0% { transform: scale(1.08) translate(0, 0); }
  30% { transform: scale(1.09) translate(-0.6%, 0.4%); }
  60% { transform: scale(1.08) translate(0.5%, -0.5%); }
  100% { transform: scale(1.08) translate(0, 0); }
}
@keyframes focus {
  0% { opacity: 0; transform: scale(1.5); }
  45% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.9; transform: scale(1); }
}
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes finger {
  0% { transform: scale(0.6); opacity: 0; }
  28% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes swipe {
  0% { transform: translateY(0) scale(0.8); opacity: 0; }
  20% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-110px) scale(1); opacity: 0; }
}
@keyframes cta-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(11, 31, 51, 0); }
  50% { box-shadow: 0 0 0 5px rgba(11, 31, 51, 0.1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .pane, .pane-push, .pane-sheet, .pane-fade { transform: none; }
  .ready .ok, .shot { opacity: 1; transform: none; }
  .focus { opacity: 0.9; }
}
