:root {
  --fondo: #000000;
  --pillola: #141517;
  --pillola-basso: #0a0b0c;
  --testo: #f2f3f1;
  --tenue: #8a8d8b;
  --carta: #f4f1ea;
  --inchiostro: #b9b4aa;
  --accento: #6fe3b4;
  --accento-scuro: #1f8a63;
  --pozzo: #070808;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; background: var(--fondo); }

body {
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  color: var(--testo);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.btn {
  position: relative;
  display: block;
  width: min(88vw, 340px);
  height: 60px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 30px;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.btn:focus-visible { box-shadow: 0 0 0 2px var(--fondo), 0 0 0 4px var(--accento); }

/* the soft shadow lives on the button, so the overflow of the body never cuts it */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.7),
    0 10px 24px -10px rgba(0, 0, 0, 1),
    0 24px 48px -20px rgba(111, 227, 180, var(--alone, 0));
  pointer-events: none;
}

.btn__body {
  position: relative;
  display: block;
  width: 100%;
  height: 60px;
  border-radius: 30px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--pillola), var(--pillola-basso));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -1px 0 rgba(0, 0, 0, 0.6);
  will-change: transform;
}

/* the mint light that fills the pill once the expense is approved */
.btn__wash {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(60% 140% at 12% 50%, rgba(111, 227, 180, 0.22), transparent 70%),
    linear-gradient(90deg, rgba(111, 227, 180, 0.08), rgba(111, 227, 180, 0.02));
  opacity: 0;
  pointer-events: none;
}

/* the 1px edge that catches light where the pointer is */
.btn__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background:
    radial-gradient(130px 60px at var(--mx, 24%) 0%, rgba(220, 255, 240, 0.32), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

.btn__sheen {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 44%;
  background: linear-gradient(100deg, transparent 20%, rgba(220, 255, 240, 0.14) 50%, transparent 80%);
  opacity: 0;
  pointer-events: none;
}

/* the well on the left: a recessed hole that holds the receipt slip */
.well {
  position: absolute;
  left: 10px;
  top: 10px;
  width: 40px;
  height: 40px;
}
.well__hole {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(100% 100% at 50% 30%, #0f1011, var(--pozzo));
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9), inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

.slip {
  position: absolute;
  left: 9px;
  top: 5px;
  width: 22px;
  height: 30px;
  transform-origin: 50% 100%;
}
/* the paper: warm, a faint shadow, a torn zigzag at the bottom */
.slip__paper {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #fbf9f4, var(--carta) 60%, #e9e4d9);
  clip-path: polygon(0 0, 100% 0, 100% 92%, 91% 100%, 82% 92%, 73% 100%, 64% 92%, 55% 100%, 46% 92%, 37% 100%, 28% 92%, 19% 100%, 10% 92%, 0 100%);
  border-radius: 2px 2px 0 0;
  overflow: hidden;
  rotate: -5deg;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}
.slip__head {
  position: absolute;
  left: 50%;
  top: 4px;
  width: 8px;
  height: 2px;
  margin-left: -4px;
  border-radius: 1px;
  background: #3a3a38;
}
.slip__row {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 1.5px;
  border-radius: 1px;
  background: var(--inchiostro);
}
.slip__row:nth-of-type(2) { top: 9px; }
.slip__row:nth-of-type(3) { top: 12.5px; right: 8px; }
.slip__row:nth-of-type(4) { top: 16px; }
.slip__total {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 20.5px;
  height: 2px;
  border-radius: 1px;
  background: #2f302e;
}
.slip__scan {
  position: absolute;
  left: -2px;
  right: -2px;
  top: 0;
  height: 1.5px;
  background: var(--accento);
  box-shadow: 0 0 6px 1px rgba(111, 227, 180, 0.8), 0 -6px 8px rgba(111, 227, 180, 0.25);
  opacity: 0;
}

/* the mint disc with the check that takes the place of the slip */
.seal {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(120% 120% at 30% 20%, #c9ffe8, var(--accento) 52%, var(--accento-scuro));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -1px 0 rgba(0, 0, 0, 0.25), 0 0 18px -4px rgba(111, 227, 180, 0.6);
  opacity: 0;
}
.seal svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.seal__check { fill: none; stroke: #062a1d; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ring__fill { fill: none; stroke: var(--accento); stroke-width: 1.4; stroke-linecap: round; opacity: 0; transform: rotate(-90deg); transform-origin: 20px 20px; }

/* labels */
.txt {
  position: absolute;
  left: 62px;
  right: 84px;
  top: 11px;
  height: 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  text-align: left;
  white-space: nowrap;
  pointer-events: none;
}
.txt__main {
  font-size: 15px;
  line-height: 18px;
  font-weight: 560;
  font-variation-settings: "wdth" 100;
  letter-spacing: 0.005em;
}
.txt__sub {
  font-size: 11.5px;
  line-height: 15px;
  font-weight: 480;
  color: var(--tenue);
  overflow: hidden;
  text-overflow: ellipsis;
}

.roll { position: relative; display: block; height: 18px; overflow: hidden; }
.roll__item {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 15px;
  line-height: 18px;
  font-weight: 560;
  letter-spacing: 0.005em;
}

/* three hairline segments: receipt, policy, budget */
.segs {
  display: flex;
  gap: 4px;
  height: 15px;
  align-items: center;
  max-width: 150px;
}
.seg {
  position: relative;
  flex: 1;
  height: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.seg__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accento-scuro), var(--accento));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.txt--done .txt__main { color: var(--testo); }
.swap { position: relative; display: block; height: 15px; overflow: hidden; }
.swap__a, .swap__b {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 15px;
  transition: transform 0.38s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.25s;
}
.swap__a { color: var(--accento); }
.swap__b { transform: translateY(110%); opacity: 0; color: var(--testo); }
.undo { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* the amount on the right, with the box that marks it as matched to the receipt */
.amount {
  position: absolute;
  right: 20px;
  top: 50%;
  height: 24px;
  margin-top: -12px;
  display: flex;
  align-items: center;
  padding: 0 7px;
  pointer-events: none;
}
.amount__box {
  position: absolute;
  inset: 0;
  border-radius: 7px;
  border: 1px solid rgba(111, 227, 180, 0.7);
  background: rgba(111, 227, 180, 0.07);
  opacity: 0;
}
.amount__txt {
  position: relative;
  font-size: 14px;
  font-weight: 600;
  font-variation-settings: "wdth" 96;
  letter-spacing: 0.01em;
}

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

.pointer {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #ffffff;
  stroke: #0b0b0d;
  stroke-width: 1.2;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
  opacity: 0;
}

/* approved: coming near offers to undo */
@media (hover: hover) {
  .btn.is-done:hover .swap__a { transform: translateY(-110%); opacity: 0; }
  .btn.is-done:hover .swap__b { transform: translateY(0); opacity: 1; }
}
.btn.is-done:focus-visible .swap__a, .btn.is-done.is-near .swap__a { transform: translateY(-110%); opacity: 0; }
.btn.is-done:focus-visible .swap__b, .btn.is-done.is-near .swap__b { transform: translateY(0); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .swap__a, .swap__b { transition: opacity 0.25s; }
  .btn.is-done:hover .swap__a, .btn.is-done.is-near .swap__a, .btn.is-done:focus-visible .swap__a { transform: none; }
  .btn.is-done:hover .swap__b, .btn.is-done.is-near .swap__b, .btn.is-done:focus-visible .swap__b { transform: none; }
}
