:root {
  --fondo: #ffffff;
  --card: #ffffff;
  --inchiostro: #111316;
  --grigio: #6b6f76;
  --tenue: #b3b6bb;
  --bordo: rgba(17, 19, 22, 0.09);
  --campo: #f6f7f7;
  --accento: #0e8a6c;
  --accento-scuro: #0b3d33;
  --ambra: #d9870a;
  --ambra-tenue: rgba(217, 135, 10, 0.1);
  --cifra: clamp(34px, min(12.5vw, 10.4vh), 56px);
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 14px;
  overflow: hidden;
}

/* the card: white on white, held up by a hairline border, a lit top edge and three soft shadows */
.send {
  position: relative;
  width: min(392px, 100%);
  background: var(--card);
  border: 1px solid var(--bordo);
  border-radius: 22px;
  padding: clamp(12px, 3.6vmin, 20px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 1) inset,
    0 1px 2px rgba(17, 19, 22, 0.04),
    0 10px 24px -10px rgba(17, 19, 22, 0.12),
    0 34px 64px -30px rgba(17, 19, 22, 0.24);
}

/* recipient */
.send__head { display: flex; align-items: center; gap: 11px; }
.who { position: relative; flex: none; width: 36px; height: 36px; }
.who__face {
  display: grid; place-items: center; padding: 0 3px 2px 0;
  width: 100%; height: 100%;
  border-radius: 50%;
  font-size: 12.5px; font-weight: 640; letter-spacing: 0.02em; color: #fff;
  background: radial-gradient(120% 120% at 25% 15%, #3fb393, #0b5a49 70%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 4px 10px -4px rgba(11, 90, 73, 0.6);
}
.who__bank {
  position: absolute; right: -6px; bottom: -4px;
  width: 16px; height: 16px; padding: 2.5px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--bordo), 0 2px 4px rgba(17, 19, 22, 0.1);
  fill: none; stroke: var(--inchiostro); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round;
}
.send__meta { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.2; }
.send__to { font-size: 14.5px; font-weight: 620; letter-spacing: -0.01em; }
.send__acc { font-size: 12px; color: var(--grigio); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.send__change {
  font-size: 12px; font-weight: 560; color: var(--grigio);
  padding: 6px 10px; border-radius: 999px;
  box-shadow: 0 0 0 1px var(--bordo);
  transition: color 0.2s, box-shadow 0.2s, background 0.2s;
}
@media (hover: hover) {
  .send__change:hover { color: var(--inchiostro); background: var(--campo); }
}

/* the amount field */
.field {
  position: relative;
  display: block;
  margin-top: clamp(10px, 2.6vh, 16px);
  padding: clamp(10px, 2.2vh, 14px) 16px clamp(9px, 2vh, 13px);
  border-radius: 18px;
  background: var(--campo);
  box-shadow: 0 0 0 1px rgba(17, 19, 22, 0.04) inset;
  transition: background 0.35s, box-shadow 0.35s;
  overflow: hidden;
  cursor: text;
}
.field__glow {
  position: absolute; inset: -40% -10% auto;
  height: 160%;
  background: radial-gradient(50% 45% at 30% 60%, rgba(14, 138, 108, 0.14), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.field.is-focus { background: #fff; box-shadow: 0 0 0 1px rgba(14, 138, 108, 0.35) inset, 0 0 0 4px rgba(14, 138, 108, 0.08); }
.field.is-focus .field__glow { opacity: 1; }
.field.is-over { background: #fffaf2; box-shadow: 0 0 0 1px rgba(217, 135, 10, 0.5) inset, 0 0 0 4px var(--ambra-tenue); }
.field.is-over .field__glow { opacity: 1; background: radial-gradient(50% 45% at 30% 60%, rgba(217, 135, 10, 0.16), transparent 70%); }

.field__top { position: relative; display: flex; justify-content: space-between; align-items: center; }
.field__label { font-size: 12px; font-weight: 560; color: var(--grigio); letter-spacing: 0.01em; cursor: text; }
.field__cur {
  font-size: 10.5px; font-weight: 640; letter-spacing: 0.08em; color: var(--grigio);
  padding: 3px 7px; border-radius: 6px; background: rgba(17, 19, 22, 0.05);
}

.amount {
  position: relative;
  display: flex; align-items: baseline;
  height: calc(var(--cifra) * 1.18);
  margin-top: 4px;
  font-size: var(--cifra);
  font-weight: 560;
  font-variation-settings: "wdth" 96;
  letter-spacing: -0.02em;
  line-height: 1.1;
  white-space: nowrap;
  transition: color 0.3s;
}
.field.is-over .amount { color: var(--ambra); }
.amount__sym { font-size: 0.56em; font-weight: 520; color: var(--grigio); margin-right: 0.08em; align-self: flex-start; margin-top: 0.24em; transition: color 0.3s; }
.field.is-over .amount__sym { color: var(--ambra); }
.amount__num { display: inline-flex; align-items: baseline; }
.amount__zero { color: var(--tenue); display: inline-block; }
.amount__cents { font-size: 0.5em; font-weight: 520; color: var(--tenue); margin-left: 0.06em; }

/* a figure: a window one digit high over a reel of 0-9 twice; the separator is a sibling that opens from zero width */
.dg { display: inline-flex; align-items: baseline; overflow: hidden; }
.dg__win { position: relative; display: inline-block; width: 0.6em; height: 1.1em; overflow: hidden; text-align: center; -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent); }
.dg__reel { position: absolute; left: 0; right: 0; top: 0; display: flex; flex-direction: column; will-change: transform; }
.dg__reel span { display: block; height: 1.1em; }
.sep { display: inline-block; width: 0; overflow: hidden; text-align: center; }
.sep.is-on { width: 0.24em; }
.sep > span { display: inline-block; }

.caret {
  display: inline-block; width: 2px; height: 0.78em;
  margin-left: 0.04em; border-radius: 2px;
  background: var(--accento);
  align-self: center;
  opacity: 0;
}
.field.is-over .caret { background: var(--ambra); }

.field__input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0;
  font-size: 16px; color: transparent; caret-color: transparent; background: transparent;
  cursor: text;
}

.field__note { position: relative; display: block; height: 18px; margin-top: 2px; }
.note {
  position: absolute; left: 0; top: 0;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 520; white-space: nowrap;
}
.note svg { width: 14px; height: 14px; fill: none; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.note--ok { color: var(--grigio); }
.note--ok svg { stroke: var(--accento); }
.note--over { color: var(--ambra); opacity: 0; font-weight: 600; }
.note--over svg { stroke: var(--ambra); }

/* balance */
.bal { margin-top: clamp(10px, 2.6vh, 16px); padding: 0 2px; }
.bal__row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 12px; color: var(--grigio); white-space: nowrap; }
.bal__row b { font-weight: 620; color: var(--inchiostro); }
.bal__v { transition: color 0.3s; }
.bal__v.is-over, .bal__v.is-over b { color: var(--ambra); }

.bar {
  position: relative;
  height: 8px;
  margin-top: 9px;
  border-radius: 99px;
  background: rgba(17, 19, 22, 0.06);
  overflow: hidden;
}
/* what this transfer takes: a fine hatch that sits under the remaining balance */
.bar__spend {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(-45deg, rgba(14, 138, 108, 0.32) 0 2px, rgba(14, 138, 108, 0.08) 2px 5px);
  transition: background 0.3s;
}
.bal.is-over .bar__spend {
  background: repeating-linear-gradient(-45deg, rgba(217, 135, 10, 0.55) 0 2px, rgba(217, 135, 10, 0.16) 2px 5px);
}
.bar__left {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accento-scuro), var(--accento));
  box-shadow: 1px 0 0 2px #fff;
  overflow: hidden;
}
.bar__shine {
  position: absolute; inset: 0 auto 0 0; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: translateX(-120%);
}

/* the button */
.go {
  position: relative;
  display: grid; place-items: center;
  width: 100%; height: 52px;
  margin-top: clamp(12px, 3vh, 18px);
  border-radius: 14px;
  background: var(--inchiostro);
  color: #fff;
  font-size: 15px; font-weight: 600; letter-spacing: -0.005em;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 8px 18px -8px rgba(17, 19, 22, 0.55);
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
.go:disabled { background: #eceded; color: var(--tenue); box-shadow: none; cursor: default; }
.go:focus-visible, .send__change:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }
@media (hover: hover) {
  .go:not(:disabled):hover { background: #23262b; }
}
.go__fill { position: absolute; inset: 0; background: linear-gradient(90deg, var(--accento-scuro), var(--accento)); transform: scaleX(0); transform-origin: left; }
.go__label { position: relative; grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 8px; }
.go__label--b { opacity: 0; }
.go__label svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.pointer {
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px;
  fill: var(--inchiostro); stroke: #fff; stroke-width: 1.4; stroke-linejoin: round;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.25));
  pointer-events: none;
  opacity: 0;
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .field, .amount, .go, .bal__v { transition: none; }
}
