/* ==========================================================================
   FOOUND — contributi (tastierino), archivio privato e nuvola-regalo
   Una colonna centrale che È l'interfaccia (niente cornice da telefono),
   scarabocchi solo nei margini. Due stati nella stessa pagina: #archive.
   ========================================================================== */

.fo-page {
  --col: 440px;
  /* tasti, importo e spaziature seguono l'altezza visibile: tutto in un colpo d'occhio */
  --key: clamp(60px, min(19.5vw, calc((100vh - 620px) / 4)), 80px);
  --key: clamp(60px, min(19.5vw, calc((100svh - 620px) / 4)), 80px);
  --kgx: clamp(18px, 7vw, 30px);
  --kgy: clamp(10px, 1.4vh, 16px);
  --kgy: clamp(10px, 1.4svh, 16px);
  --vgap: clamp(12px, 2.4vh, 34px);
  --vgap: clamp(12px, 2.4svh, 34px);
  --pad-w: calc(3 * var(--key) + 2 * var(--kgx));
  --amt: clamp(62px, min(25vw, 13vh), 128px);
  --amt: clamp(62px, min(25vw, 13svh), 128px);
  --card-out: 18px;            /* quanto il pannello archivio esce dalla colonna */
  --nudge: 0deg;

  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--header-h) + clamp(12px, 2.6vh, 44px)) var(--gutter) clamp(36px, 7vh, 88px);
}

/* testo secondario un filo più scuro del token condiviso (0.56 ≈ 4.2:1):
   qui i testi piccoli devono restare AA (≥ 4.5:1) */
.fo-page, .fo-sheet { --muted: rgba(19, 19, 19, 0.62); }

/* ---------- scarabocchi nei margini ---------- */
.fo-page .scribble {
  rotate: var(--nudge);
  transition: rotate 0.7s var(--ease-spring);
}
.fo-s1 {
  width: 300px;
  right: calc(50% + var(--col) / 2 + 84px);
  top: 17%;
  transform: rotate(-12deg);
}
.fo-s2 {
  width: 340px;
  left: calc(50% + var(--col) / 2 + 56px);
  bottom: 13%;
  transform: rotate(9deg);
}
.fo-s3 {
  width: 104px;
  left: calc(50% + var(--col) / 2 + 150px);
  top: 15%;
  transform: rotate(18deg);
}
.fo-page.is-nudge-l { --nudge: -2.2deg; }
.fo-page.is-nudge-r { --nudge: 2.2deg; }

@media (max-width: 1240px) {
  .fo-s1 { width: 220px; right: calc(50% + var(--col) / 2 + 40px); }
  .fo-s2 { width: 250px; left: calc(50% + var(--col) / 2 + 30px); }
  .fo-s3 { width: 84px; left: calc(50% + var(--col) / 2 + 96px); }
}
@media (max-width: 1000px) {
  .fo-s1 { width: 150px; right: calc(50% + var(--col) / 2 + 24px); top: 20%; }
  .fo-s2 { width: 170px; left: calc(50% + var(--col) / 2 + 18px); }
  .fo-s3 { display: none; }
}

/* ---------- colonna ---------- */
.fo {
  width: min(100%, var(--col));
  margin: 0 auto;
}
.fo__stage { position: relative; }

.fo-pay {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.55s var(--ease-out), transform 0.8s var(--ease-in-out), filter 0.55s var(--ease-out);
}

/* barra in alto: indice + icona archivio */
.fo-bar {
  width: 100%;
  min-height: 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.fo-bar__name { display: inline-flex; align-items: baseline; gap: 8px; }
.fo-bar__sub { color: var(--muted); }

.fo-round {
  position: relative;
  flex: none;
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out), box-shadow 0.3s, transform 0.5s var(--ease-spring);
}
.fo-round svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.fo-round:active { transform: scale(0.92); }
@media (hover: hover) {
  .fo-round:hover { background: var(--ink); color: var(--white); box-shadow: inset 0 0 0 1px var(--ink); }
  .fo-archive-btn:hover svg { animation: fo-lid 0.6s var(--ease-spring); }
}
@keyframes fo-lid {
  40% { transform: translateY(-2px) rotate(-6deg); }
}

/* titolo-manifesto: il punto finale è il pallino azzurro */
.fo-title {
  margin-top: clamp(8px, 1.4vh, 24px);
  max-width: 12.5em;
  text-align: center;
  font-size: clamp(25px, 1.15vw + 17px, 34px);
  line-height: 1.02;
  letter-spacing: -0.038em;
  text-wrap: balance;
}
.fo-title__dot {
  width: 0.2em; height: 0.2em;
  min-width: 6px; min-height: 6px;
  margin-left: 0.07em;
  vertical-align: baseline;
}

.fo-title__dot.is-pulse { animation: fo-dot 1.1s var(--ease-spring); }
@keyframes fo-dot {
  30% { transform: scale(2.4); box-shadow: 0 0 0 6px rgba(71, 175, 255, 0.18); }
  60% { transform: scale(0.85); }
}

/* ---------- 01 · IMPORTO ---------- */
.fo-amount-wrap {
  position: relative;
  width: 100%;
  margin-top: var(--vgap);
  padding-bottom: 24px;           /* spazio riservato all'avviso: nessuno scatto di layout */
}
.fo-amount {
  display: block;
  width: 100%;
  text-align: center;
  font-weight: var(--w-bold);
  font-size: var(--amt);
  line-height: 0.9;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
  transition: font-size 0.3s var(--ease-out);
}
.fo-amount__vis {
  display: inline-block;
  white-space: nowrap;
  padding: 0.05em 0.04em 0.04em 0;
}
.fo-amount .c {
  display: inline-block;
  transition: color 0.3s var(--ease-out);
}
.fo-amount__dec,
.fo-amount__cur {
  font-size: 0.45em;
  letter-spacing: -0.02em;
}
.fo-amount__dec { margin-left: 0.03em; }
.fo-amount__cur { margin-left: 0.04em; transition: color 0.3s var(--ease-out); }
.fo-amount .is-ghost,
.fo-amount .is-ghost .c { color: rgba(19, 19, 19, 0.17); }
.fo-amount .c.is-new { animation: fo-rise 0.46s var(--ease-spring) both; }
.fo-amount .c.is-out { transition: transform 0.28s var(--ease-in-out), opacity 0.22s; transform: translateY(0.3em); opacity: 0; }
@keyframes fo-rise {
  from { transform: translateY(0.38em) scale(0.94); opacity: 0; }
  55% { opacity: 1; }
}

.fo-hint {
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  text-align: center;
  font-size: 11px;
  font-weight: var(--w-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.3s, transform 0.4s var(--ease-out);
  pointer-events: none;
}
.fo-hint.is-on { opacity: 1; transform: none; }

/* ---------- 03 · METODO DI PAGAMENTO ---------- */
.fo-method {
  width: var(--pad-w);
  max-width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  padding: 9px 18px 9px 10px;
  border-radius: 999px;
  text-align: left;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.3s, transform 0.5s var(--ease-spring);
}
.fo-method:active { transform: scale(0.985); }
@media (hover: hover) {
  .fo-method:hover { box-shadow: inset 0 0 0 1px var(--ink); }
  .fo-method:hover .fo-method__chev { transform: translateX(3px); }
}
.fo-method__icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink);
  color: var(--white);
}
.fo-method__icon svg,
.fo-opt__icon svg,
.fo-ico {
  width: 19px; height: 19px;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.fo-method__text { display: grid; min-width: 0; }
.fo-method__k {
  font-size: 10px;
  font-weight: var(--w-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.3;
}
.fo-method__v {
  font-size: 15px;
  font-weight: var(--w-bold);
  letter-spacing: -0.012em;
  line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fo-method__v.is-new { animation: fo-swap 0.5s var(--ease-out) both; }
.fo-method__icon.is-new svg { animation: fo-pop 0.55s var(--ease-spring) both; }
@keyframes fo-swap { from { opacity: 0; transform: translateY(6px); } }
@keyframes fo-pop { from { transform: scale(0.4) rotate(-20deg); opacity: 0; } }
.fo-method__chev {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.45s var(--ease-spring);
}

/* ---------- 02 · TASTIERINO ---------- */
.fo-keys {
  margin-top: var(--vgap);
  display: grid;
  grid-template-columns: repeat(3, var(--key));
  grid-auto-rows: var(--key);
  column-gap: var(--kgx);
  row-gap: var(--kgy);
  justify-content: center;
}
.fo-key {
  position: relative;
  width: var(--key); height: var(--key);
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: var(--w-bold);
  font-size: calc(var(--key) * 0.34);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.6s var(--ease-spring), box-shadow 0.3s, color 0.35s var(--ease-out);
}
.fo-key > span { position: relative; z-index: 1; display: grid; place-items: center; line-height: 1; }
/* l'inchiostro si allarga dal centro */
.fo-key::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--ink);
  transform: scale(0.3);
  opacity: 0;
  transition: transform 0.5s var(--ease-out), opacity 0.38s var(--ease-out);
}
/* eco ad anello al rilascio */
.fo-key::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--ink);
  opacity: 0;
  pointer-events: none;
}
.fo-key.is-down { transform: scale(0.92); color: var(--white); transition-duration: 0.12s, 0.3s, 0.08s; }
.fo-key.is-down::before { transform: scale(1); opacity: 1; transition-duration: 0.14s, 0.08s; }
.fo-key.is-ring::after { animation: fo-ring 0.7s var(--ease-out); }
@keyframes fo-ring {
  from { transform: scale(0.96); opacity: 0.55; }
  to { transform: scale(1.38); opacity: 0; }
}
@media (hover: hover) {
  .fo-key:hover { box-shadow: inset 0 0 0 1px var(--ink); }
}
.fo-key:focus-visible { outline-offset: 4px; border-radius: 50%; }
.fo-key--sep > span { font-size: 1.25em; transform: translateY(-0.24em); }
.fo-key--sep > span.is-point { font-size: 1.6em; transform: translateY(-0.3em); }
.fo-key__del {
  width: calc(var(--key) * 0.36); height: auto;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  overflow: visible;
}
/* tieni premuto per azzerare: l'anello si disegna */
.fo-key__hold {
  position: absolute; inset: -1px;
  width: calc(100% + 2px); height: calc(100% + 2px);
  z-index: 2;
  transform: rotate(-90deg);
  pointer-events: none;
  overflow: visible;
}
.fo-key__hold circle {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.2s var(--ease-out);
}
.fo-key.is-holding .fo-key__hold circle { stroke-dashoffset: 0; transition: stroke-dashoffset 0.56s linear; }

/* ---------- 04 · AZIONE ---------- */
.fo-send {
  position: relative;
  margin-top: var(--vgap);
  min-height: 60px;
  font-size: 17px;
  letter-spacing: -0.01em;
  text-transform: none;
  overflow: hidden;
}
.fo-send > span { position: relative; z-index: 1; }
/* quando l'importo diventa valido, una luce attraversa la pillola una volta */
.fo-send::after {
  content: "";
  position: absolute; top: 0; bottom: 0; left: -40%;
  width: 34%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: translateX(-120%) skewX(-18deg);
  pointer-events: none;
}
.fo-send.is-armed::after { animation: fo-sheen 1.1s var(--ease-in-out) 0.05s; }
@keyframes fo-sheen { to { transform: translateX(520%) skewX(-18deg); } }
.fo-send[aria-disabled="true"] { opacity: 0.28; }
.fo-send[aria-disabled="true"]:hover { transform: none; }

.fo-flag { display: block; max-width: 100%; margin-top: 12px; text-align: center; line-height: 1.5; text-wrap: balance; }
.fo-flag .fo-ring { display: inline-block; margin-right: 8px; vertical-align: 0; }
.fo-flag[hidden] { display: none; }
.fo-ring {
  flex: none;
  width: 7px; height: 7px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px currentColor;
}
.fo-noscript { margin-top: 16px; font-size: 13px; color: var(--muted); text-align: center; }

/* ==========================================================================
   STATO 2 · ARCHIVIO — si apre dall'icona con una maschera circolare
   ========================================================================== */
.fo-archive {
  position: absolute;
  inset: calc(-1 * var(--card-out));
  z-index: 3;
  display: flex;
  flex-direction: column;
  padding: var(--card-out) var(--card-out) 16px;
  border-radius: 28px;
  background: #f8f8f8;
  box-shadow: inset 0 0 0 1px var(--line), 0 50px 100px -60px rgba(19, 19, 19, 0.4);
  clip-path: circle(0px at var(--ox, calc(100% - 42px)) var(--oy, 42px));
  visibility: hidden;
  transition: clip-path 0.78s var(--ease-in-out), visibility 0s linear 0.78s;
}
.fo__stage.is-archive .fo-archive {
  clip-path: circle(var(--or, 150%) at var(--ox, calc(100% - 42px)) var(--oy, 42px));
  visibility: visible;
  transition: clip-path 0.86s var(--ease-in-out), visibility 0s;
}
.fo__stage.is-archive .fo-pay {
  opacity: 0;
  transform: scale(0.965);
  filter: blur(2px);
  visibility: hidden;
  transition: opacity 0.5s var(--ease-in-out) 0.28s, transform 0.86s var(--ease-in-out), filter 0.5s 0.28s, visibility 0s linear 0.8s;
}
.fo__stage.no-anim .fo-archive,
.fo__stage.no-anim .fo-pay { transition: none !important; }

/* il contenuto dell'archivio arriva un attimo dopo la maschera */
.fo-archive > * { transition: opacity 0.5s var(--ease-out), transform 0.7s var(--ease-out); }
.fo__stage:not(.is-archive) .fo-archive > * { opacity: 0; transform: translateY(10px); transition-duration: 0.2s; }
.fo__stage.is-archive .fo-archive > :nth-child(2) { transition-delay: 0.12s; }
.fo__stage.is-archive .fo-archive > :nth-child(3) { transition-delay: 0.18s; }
.fo__stage.is-archive .fo-archive > :nth-child(4) { transition-delay: 0.26s; }
.fo__stage.is-archive .fo-archive > :nth-child(5) { transition-delay: 0.32s; }

.fo-archive__title {
  font-size: clamp(22px, 1vw + 15px, 28px);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1;
  padding-top: 2px;
}
.fo-archive__title:focus { outline: none; }
.fo-account {
  margin-top: 6px;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  font-size: 13px;
  color: var(--muted);
}
.fo-account[hidden] { display: none; }
.fo-account b { color: var(--ink); font-weight: var(--w-bold); }
.fo-textbtn {
  min-height: 44px;
  margin: -12px 0;
  padding: 0 2px;
  font-size: 13px;
  font-weight: var(--w-bold);
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.fo-archive__body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 26px), transparent);
  padding-bottom: 26px;
}

/* tabella: DATE / TRANSACTION · AMOUNT */
.fo-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.fo-table th {
  font-weight: var(--w-bold);
  text-align: left;
}
.fo-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: #f8f8f8;
  padding: 0 0 12px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  box-shadow: inset 0 -1px 0 var(--line-strong);
}
.fo-table .is-r { text-align: right; }
.fo-row { position: relative; }
.fo-row td {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.fo-row__btn {
  display: grid; gap: 3px;
  text-align: left;
  border-radius: 6px;
}
.fo-row__btn::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.fo-row__btn:focus-visible { outline: none; }
.fo-row:has(.fo-row__btn:focus-visible) { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: 8px; }
.fo-row__date { font-size: 12px; color: var(--muted); letter-spacing: 0.01em; }
.fo-row__tx { font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.fo-row__tx .dot { width: 7px; height: 7px; }
.fo-row__amt {
  text-align: right;
  font-weight: var(--w-bold);
  font-size: 15px;
  white-space: nowrap;
  padding-left: 12px !important;
  transition: transform 0.4s var(--ease-out);
}
@media (hover: hover) {
  .fo-row:hover .fo-row__amt { transform: translateX(-4px); }
  .fo-row:hover td { border-bottom-color: var(--line-strong); }
}
.fo-row.is-in { animation: fo-row-in 0.7s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 55ms + 0.25s); }
@keyframes fo-row-in { from { opacity: 0; transform: translateY(12px); } }
.fo-table tfoot th, .fo-table tfoot td {
  padding: 16px 0 4px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.fo-table tfoot td { text-align: right; font-weight: var(--w-bold); font-size: 15px; letter-spacing: -0.01em; text-transform: none; }
.fo-table tfoot small { display: block; font-size: 11px; color: var(--muted); font-weight: var(--w-medium); letter-spacing: 0.02em; text-transform: none; margin-top: 2px; }

/* scheletro di caricamento: le righe del brief, «€ --,--» */
.fo-row--skel td { color: var(--faint); }
.fo-row--skel .fo-row__tx, .fo-row--skel .fo-row__amt { animation: fo-pulse 1.4s ease-in-out infinite; }
@keyframes fo-pulse { 50% { opacity: 0.45; } }

/* stati: vuoto / privato / errore */
.fo-state {
  position: relative;
  min-height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px 8px 12px;
  text-align: center;
}
.fo-state__mark {
  position: relative;
  width: 86px; height: 86px;
  margin-bottom: 6px;
}
.fo-state__mark .scribble { position: absolute; inset: 0; width: 100%; height: 100%; }
.fo-state__mark .fo-ico { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; }
.fo-state__title {
  font-size: 22px;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-wrap: balance;
}
.fo-state__text {
  max-width: 300px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: balance;
}
.fo-state__actions {
  margin-top: 12px;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.fo-state__actions .btn { min-height: 48px; padding: 0 24px; font-size: 14px; letter-spacing: -0.005em; text-transform: none; }

/* ---------- NUVOLA-REGALO ---------- */
.fo-cloud-zone {
  position: relative;
  flex: none;
  display: grid;
  justify-items: center;
  padding-top: 6px;
}
.fo-cloud-zone[hidden] { display: none; }
.fo-cloud {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 4px 18px 2px;
  min-height: 44px;
  border-radius: 24px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.fo-cloud:focus-visible { outline-offset: 0; border-radius: 24px; }
.fo-cloud__body {
  display: block;
  width: 116px;
  transform-origin: 50% 88%;
  transition: transform 0.18s var(--ease-out);
}
.fo-cloud__svg { width: 100%; height: auto; overflow: visible; }
.fo-cloud__belly { fill: var(--sky-deep); }
.fo-cloud__main { fill: var(--sky); }
.fo-cloud__shine { fill: #fff; opacity: 0.75; }
.fo-cloud__label {
  font-size: 10px;
  font-weight: var(--w-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
/* galleggia piano, sempre */
.fo-cloud-zone:not(.is-pressed) .fo-cloud__svg { animation: fo-float 4.2s ease-in-out infinite; }
@keyframes fo-float { 50% { transform: translateY(-3px); } }
.fo-cloud.is-pressed .fo-cloud__body { transform: scale(1.14, 0.82); }
@media (hover: hover) {
  .fo-cloud:hover .fo-cloud__body { transform: scale(1.04, 0.97); }
  .fo-cloud.is-pressed:hover .fo-cloud__body { transform: scale(1.14, 0.82); }
}
.fo-cloud[aria-busy="true"] { cursor: progress; }

.fo-puff {
  position: absolute;
  left: 50%; top: 42%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: var(--sky);
  box-shadow: inset 0 -3px 0 var(--sky-deep);
  pointer-events: none;
  z-index: 0;
}

/* esito della nuvola: una nuvoletta di carta sopra la nuvola */
.fo-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 4px);
  z-index: 5;
  width: min(300px, calc(100vw - 48px));
  margin-left: calc(min(300px, calc(100vw - 48px)) / -2);
  padding: 16px 18px 16px;
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 4px 14px;
  align-items: center;
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 0 0 1px var(--line), 0 24px 50px -24px rgba(19, 19, 19, 0.38);
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.92);
  transform-origin: 50% 100%;
  transition: opacity 0.3s, transform 0.5s var(--ease-spring), visibility 0s linear 0.5s;
  pointer-events: none;
}
.fo-bubble::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -6px;
  width: 12px; height: 12px;
  margin-left: -6px;
  background: var(--white);
  box-shadow: 1px 1px 0 var(--line);
  transform: rotate(45deg);
}
.fo-bubble.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.3s, transform 0.6s var(--ease-spring), visibility 0s;
}
.fo-bubble__art { grid-row: span 2; width: 62px; height: 62px; }
.fo-bubble__art svg { width: 100%; height: 100%; overflow: visible; }
.fo-bubble__t { font-weight: var(--w-bold); font-size: 16px; letter-spacing: -0.02em; line-height: 1.15; align-self: end; text-wrap: balance; }
.fo-bubble__d { font-size: 13px; line-height: 1.4; color: var(--muted); align-self: start; }
.fo-bubble .preview-flag { grid-column: 1 / -1; margin-top: 6px; font-size: 9.5px; }

/* disegni a mano (regalo, cuore, ondina): tratto che si disegna */
.fo-draw path, .fo-draw circle.st {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: fo-draw 0.9s var(--ease-out) forwards;
}
.fo-draw .e { stroke-width: 1.1; opacity: 0.8; animation-delay: 0.12s; }
.fo-draw .m { stroke-width: 2.3; }
.fo-draw .d2 { animation-delay: 0.3s; }
.fo-draw .d3 { animation-delay: 0.5s; }
.fo-draw .d4 { animation-delay: 0.68s; }
.fo-draw .pin { fill: var(--blue); opacity: 0; animation: fo-pin 0.5s var(--ease-spring) 0.95s forwards; transform-box: fill-box; transform-origin: center; }
@keyframes fo-draw { to { stroke-dashoffset: 0; } }
@keyframes fo-pin { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: none; } }

.fo-flag--archive { margin-top: 10px; }

/* ==========================================================================
   FINESTRE (EG.sheet) — metodo, conferma, pagamento sicuro, ricevuta, accesso
   ========================================================================== */
.fo-sheet .sheet { padding: 22px 24px 26px; }
.fo-shield { position: fixed; inset: 0; display: none; }
.fo-sheet.is-busy .fo-shield { display: block; }

.fo-sh { position: relative; }
.fo-sh.is-leaving { opacity: 0; transform: translateY(-6px); transition: opacity 0.16s, transform 0.2s; }
.fo-sh.is-entering > * { animation: fo-step 0.55s var(--ease-out) both; }
.fo-sh.is-entering > :nth-child(2) { animation-delay: 0.04s; }
.fo-sh.is-entering > :nth-child(3) { animation-delay: 0.08s; }
.fo-sh.is-entering > :nth-child(4) { animation-delay: 0.12s; }
.fo-sh.is-entering > :nth-child(5) { animation-delay: 0.16s; }
.fo-sh.is-entering > :nth-child(n+6) { animation-delay: 0.2s; }
@keyframes fo-step { from { opacity: 0; transform: translateY(10px); } }

.fo-sh__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px;
  margin: -6px -8px 10px 0;
}
.fo-sh__head .label { display: inline-flex; align-items: center; gap: 8px; }
.fo-x {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  transition: background 0.25s;
}
.fo-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
@media (hover: hover) { .fo-x:hover { background: var(--paper); } }
.fo-sh__title {
  font-size: 26px;
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-wrap: balance;
}
.fo-sh__title:focus { outline: none; }
.fo-sh__lede { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.fo-sh__note {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.fo-sh__note .fo-ico { width: 16px; height: 16px; margin-top: 2px; color: var(--ink); }
.fo-sh__actions { margin-top: 22px; display: grid; gap: 10px; }
.fo-sh__actions .btn { min-height: 56px; }
.fo-sh__actions .btn:not(.btn--ghost) { font-size: 15px; letter-spacing: -0.005em; text-transform: none; }
.fo-sh__actions .btn--ghost { font-size: 15px; letter-spacing: -0.005em; text-transform: none; }
.fo-sh .preview-flag { margin-top: 16px; display: flex; justify-content: center; }

/* importo nelle finestre: stessa grammatica dell'importo principale */
.fo-big {
  display: block;
  font-weight: var(--w-bold);
  font-size: clamp(50px, 15vw, 68px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fo-big small { font-size: 0.45em; letter-spacing: -0.02em; margin-left: 0.03em; }

/* righe di dettaglio */
.fo-dl { margin-top: 18px; }
.fo-dl > div {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 46px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.fo-dl > div:last-child { border-bottom: 1px solid var(--line); }
.fo-dl dt {
  font-size: 10.5px;
  font-weight: var(--w-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  flex: none;
}
.fo-dl dd {
  margin: 0;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px;
  font-weight: var(--w-bold);
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  overflow-wrap: anywhere;
}
.fo-dl dd .fo-ico { width: 17px; height: 17px; }
.fo-method-inline { display: inline-flex; align-items: center; gap: 8px; }
.fo-dl dd .dot { width: 8px; height: 8px; }

/* utente non registrato in conferma */
.fo-guest {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--paper);
  font-size: 13px;
  line-height: 1.5;
}
.fo-guest .fo-textbtn { margin: -10px 0; }

/* opzioni metodo */
.fo-methods { border: 0; margin: 4px 0 0; padding: 0; min-width: 0; }
.fo-opt {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr 22px;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 6px 10px 2px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fo-opt:last-of-type { border-bottom: 1px solid var(--line); }
.fo-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fo-opt__icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
.fo-opt__name { display: block; font-weight: var(--w-bold); font-size: 16px; letter-spacing: -0.015em; line-height: 1.25; }
.fo-opt__desc { display: block; font-size: 13px; color: var(--muted); line-height: 1.35; }
.fo-opt__check {
  width: 22px; height: 22px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  display: grid; place-items: center;
  transition: background 0.3s, box-shadow 0.3s;
}
.fo-opt__check svg { width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.35s var(--ease-out) 0.05s; }
.fo-opt input:checked ~ .fo-opt__icon { background: var(--ink); color: var(--white); box-shadow: inset 0 0 0 1px var(--ink); }
.fo-opt input:checked ~ .fo-opt__check { background: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.fo-opt input:checked ~ .fo-opt__check svg { stroke-dashoffset: 0; }
.fo-opt input:focus-visible ~ .fo-opt__icon { outline: 2px solid var(--blue); outline-offset: 3px; }
@media (hover: hover) { .fo-opt:hover .fo-opt__icon { box-shadow: inset 0 0 0 1px var(--ink); } }

/* passaggio sicuro al provider */
.fo-handoff {
  margin: 26px 0 8px;
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  gap: 10px;
}
.fo-handoff__node {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-weight: var(--w-bold);
  font-size: 13px;
  letter-spacing: -0.02em;
}
.fo-handoff__node--p { background: var(--ink); color: var(--white); box-shadow: none; }
.fo-handoff__node .fo-ico { width: 20px; height: 20px; }
.fo-handoff__line {
  position: relative;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 4px, transparent 4px 8px);
}
.fo-handoff__dot {
  position: absolute;
  left: 0; top: 50%;
  width: 10px; height: 10px; margin: -5px 0 0 -5px;
  animation: fo-travel 1.5s var(--ease-in-out) infinite;
}
@keyframes fo-travel {
  0% { left: 0; opacity: 0; transform: scale(0.4); }
  15% { opacity: 1; transform: none; }
  85% { opacity: 1; transform: none; }
  100% { left: 100%; opacity: 0; transform: scale(0.4); }
}
.fo-handoff__labels {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 10px; font-weight: var(--w-bold); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.fo-handoff__status {
  margin-top: 26px;
  min-height: 3em;
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: -0.012em;
  text-align: center;
}
.fo-handoff__status span { display: inline-block; animation: fo-swap 0.5s var(--ease-out) both; }

/* ricevuta */
.fo-receipt { text-align: center; }
.fo-receipt__mark {
  position: relative;
  width: 132px; height: 132px;
  margin: 0 auto 8px;
}
.fo-receipt__mark .scribble { position: absolute; inset: 0; width: 100%; height: 100%; }
.fo-receipt__seal {
  margin-top: -2px;
  font-size: 9.5px;
  font-weight: var(--w-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.fo-receipt__outcome { margin-top: 14px; font-size: 22px; letter-spacing: -0.03em; line-height: 1.1; }
.fo-receipt__outcome:focus { outline: none; }
.fo-receipt__thanks { margin-top: 6px; font-size: 14px; color: var(--muted); }
.fo-receipt .fo-big { margin-top: 18px; }
.fo-receipt .fo-dl { text-align: left; border-top: 1px dashed var(--line-strong); margin-top: 22px; padding-top: 4px; }
.fo-receipt .fo-dl > div:first-child { border-top: 0; }
.fo-receipt__id { font-size: 13px !important; letter-spacing: 0.02em; }
.fo-receipt .fo-guest { text-align: left; }
.fo-receipt__actions { grid-template-columns: 1fr 1fr; }
.fo-receipt__actions .btn:only-child { grid-column: 1 / -1; }

/* errore */
.fo-err__mark { width: 64px; height: 64px; margin: 6px 0 14px; }
.fo-err__mark svg { width: 100%; height: 100%; overflow: visible; }
.fo-err__text { margin-top: 10px; font-size: 15px; line-height: 1.5; }

/* accesso / registrazione */
.fo-seg {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 999px;
  background: var(--paper);
  position: relative;
}
.fo-seg::before {
  content: "";
  position: absolute;
  top: 4px; bottom: 4px; left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 1px 0 var(--line), 0 6px 16px -10px rgba(19, 19, 19, 0.4);
  transition: transform 0.5s var(--ease-spring);
}
.fo-seg.is-register::before { transform: translateX(100%); }
.fo-seg button {
  position: relative;
  min-height: 44px;
  font-size: 13px;
  font-weight: var(--w-bold);
  letter-spacing: -0.005em;
  color: var(--muted);
  transition: color 0.3s;
  border-radius: 999px;
}
.fo-seg button[aria-pressed="true"] { color: var(--ink); }
.fo-form { margin-top: 8px; }
.fo-form[hidden] { display: none; }
.fo-field {
  position: relative;
  padding: 14px 0 10px;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 0.25s;
}
.fo-field:focus-within { border-color: var(--ink); }
.fo-field.is-invalid { border-color: var(--danger); }
.fo-field label {
  display: block;
  font-size: 10.5px;
  font-weight: var(--w-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.fo-field__row { display: flex; align-items: center; gap: 8px; }
.fo-field input {
  width: 100%;
  min-height: 34px;
  padding: 4px 0 0;
  border: 0; outline: 0; background: transparent; border-radius: 0;
  font-size: 17px;
  font-weight: var(--w-medium);
}
.fo-field__hint { margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.fo-field__error { font-size: 13px; color: var(--danger); margin-top: 4px; }
.fo-field__error:empty { display: none; }
.fo-peek {
  flex: none;
  min-height: 44px;
  margin: -6px 0;
  padding: 0 4px;
  font-size: 11px;
  font-weight: var(--w-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fo-checks { margin-top: 16px; display: grid; gap: 4px; }
.fo-check {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  min-height: 44px;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}
.fo-check input { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; left: 0; top: 8px; }
.fo-check__box {
  width: 22px; height: 22px;
  margin-top: 0;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  display: grid; place-items: center;
  transition: background 0.25s, box-shadow 0.25s;
}
.fo-check__box svg { width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.3s var(--ease-out); }
.fo-check input:checked + .fo-check__box { background: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.fo-check input:checked + .fo-check__box svg { stroke-dashoffset: 0; }
.fo-check input:focus-visible + .fo-check__box { outline: 2px solid var(--blue); outline-offset: 3px; }
.fo-check.is-invalid .fo-check__box { box-shadow: inset 0 0 0 1.5px var(--danger); }
.fo-check em { font-style: normal; color: var(--muted); }
.fo-check .fo-field__error { grid-column: 2; }
.fo-form .btn { margin-top: 20px; min-height: 56px; font-size: 15px; letter-spacing: -0.005em; text-transform: none; position: relative; }
.fo-form__status { margin-top: 12px; font-size: 14px; color: var(--danger); text-align: center; }
.fo-form__status:empty { display: none; }

.btn.is-busy { pointer-events: none; }
.btn.is-busy > span { opacity: 0.35; }
.btn.is-busy::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: fo-spin 0.8s linear infinite;
}
@keyframes fo-spin { to { transform: rotate(360deg); } }

/* scossa per input non valido */
@keyframes fo-shake {
  0%, 100% { transform: none; }
  18% { transform: translateX(-9px); }
  36% { transform: translateX(7px); }
  54% { transform: translateX(-5px); }
  72% { transform: translateX(3px); }
}
.is-shake { animation: fo-shake 0.42s var(--ease-out); }

/* ==========================================================================
   MOBILE — gli scarabocchi si spostano negli spazi vuoti sopra e sotto
   ========================================================================== */
@media (max-width: 860px) {
  .fo-page {
    --key: clamp(54px, min(19.5vw, calc((100vh - 470px) / 4.4)), 80px);
    --key: clamp(54px, min(19.5vw, calc((100svh - 470px) / 4.4)), 80px);
    --amt: clamp(62px, min(25vw, 11.5vh), 112px);
    --amt: clamp(62px, min(25vw, 11.5svh), 112px);
    --card-out: 10px;
    padding-top: calc(var(--header-h) + 18px);
    padding-bottom: 170px;
  }
  /* sopra: un piccolo groviglio tra il nome e l'icona archivio */
  .fo-s1 {
    width: 54px;
    right: auto;
    left: 50%;
    top: calc(var(--header-h) + 14px);
    margin-left: -27px;
    transform: rotate(-12deg);
  }
  /* sotto: il filo arrotolato nello spazio prima del footer */
  .fo-s2 {
    width: min(230px, 62vw);
    left: auto;
    right: 5%;
    bottom: -30px;     /* il tratto vive nel vuoto tra l'azione e il footer */
    transform: rotate(-5deg);
  }
  .fo-s3 { display: none; }
  .fo-title { margin-top: 8px; }
  .fo-archive { border-radius: 24px; }
  .fo-sheet .sheet { padding: 18px 20px calc(24px + env(safe-area-inset-bottom)); }
}
@media (max-width: 520px) {
  .fo-bar__sub { display: none; }
}
@media (max-width: 360px) {
  .fo-s1 { width: 46px; margin-left: -23px; }
  .fo-sh__title { font-size: 23px; }
  .fo-receipt__actions { grid-template-columns: 1fr; }
}
@media (max-height: 640px) and (max-width: 860px) {
  .fo-s1 { display: none; }
}

/* ==========================================================================
   RIDUZIONE MOVIMENTO — dissolvenze semplici, niente molle né scosse
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .fo-page .scribble { rotate: none; }
  .fo-archive, .fo__stage.is-archive .fo-archive { clip-path: none; }
  .fo__stage:not(.is-archive) .fo-archive { opacity: 0; }
  .fo__stage.is-archive .fo-pay { transform: none; filter: none; }
  .fo-cloud__svg { animation: none !important; }
  .fo-cloud.is-pressed .fo-cloud__body { transform: none; opacity: 0.7; }
  .fo-draw path, .fo-draw circle.st { stroke-dashoffset: 0; }
  .fo-draw .pin { opacity: 1; }
  .fo-handoff__dot { left: 50%; opacity: 1; }
  .is-shake { animation: none; }
}

/* frase per gli investitori, sotto «Invia denaro»: piccola e grigia come la nota del modulo in home */
.fo-investor {
  max-width: 420px;
  margin: 14px auto 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  text-align: center;
  text-wrap: balance;
}
.fo-investor a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.fo-investor a:hover { color: var(--ink); }

/* ---------- nuvola d'oro in 3D (archivio) ---------- */
/* l'inclinazione sta sul pulsante: corpo (schiacciamento) e svg (galleggiamento) hanno già le loro trasformazioni */
.fo-cloud { transform: perspective(600px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.5s var(--ease-out); }
.fo-cloud__svg { filter: drop-shadow(0 10px 14px rgba(120, 70, 10, 0.25)); }
.fo-cloud__body { width: 132px; }
.fo-cloud__label { color: #9a6418; }
.fo-puff { background: radial-gradient(circle at 35% 30%, #fff3c4, #f0b64a 55%, #b97722); }
