:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --testo: #15171a;
  --testo-2: #5b6068;
  --testo-3: #a2a7ae;
  --linea: #eceef0;
  --traccia: #f4f5f6;
  --accento: #0f7a55;        /* the single accent: a deep green, on the Pay pill, the ring and the tick */
  --accento-scuro: #0b5e41;
  --accento-velo: #e8f5ef;
  --ombra: 18, 30, 26;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { font-size: clamp(12px, min(3.6vw, 3.1vh), 17px); }
body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { display: block; }

.stage { min-height: 100vh; display: grid; place-items: center; padding: 1em; }

.card {
  position: relative;
  width: min(20.5em, 92vw);
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: 1.35em;
  box-shadow: 0 1px 2px rgba(var(--ombra), .04), 0 24px 50px -30px rgba(var(--ombra), .34);
  overflow: hidden;
  display: grid;
}
.view { grid-area: 1 / 1; padding: 1.25em; align-self: start; }
.view--done { visibility: hidden; text-align: center; padding-top: 1.5em; }
.view--done.is-on { visibility: visible; }

/* the thin light that runs along the top edge when the payment goes through, and a soft sheen across */
.card__edge {
  position: absolute; left: 0; right: 0; top: 0; height: 1.5px; z-index: 3; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(15,122,85,.0) 20%, rgba(15,122,85,.85) 50%, rgba(15,122,85,0) 80%, transparent);
  transform: translateX(-100%); opacity: 0;
}
.card__sheen {
  position: absolute; inset: -20% -40%; z-index: 2; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.55) 50%, transparent 60%);
  transform: translateX(-70%); opacity: 0;
}

/* ---- the checkout ---- */
.head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1em; }
.shop { display: inline-flex; align-items: center; gap: .5em; font-weight: 600; font-size: .95em; letter-spacing: -.01em; }
.shop__mark { width: 1.6em; height: 1.6em; border-radius: .5em; background: var(--testo); display: grid; place-items: center; }
.shop__mark svg { width: 62%; height: 62%; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; }
.step { font-family: "JetBrains Mono Variable", ui-monospace, monospace; font-size: .68em; letter-spacing: .08em; text-transform: uppercase; color: var(--testo-3); }

.method {
  display: flex; align-items: center; gap: .75em;
  padding: .75em .85em; border: 1px solid var(--linea); border-radius: .9em; background: var(--traccia);
}
.chip { width: 2.3em; flex: none; }
.chip svg { width: 100%; height: auto; }
.chip rect { fill: var(--testo); stroke: none; }
.chip__mark { fill: #fff; opacity: .9; }
.method__text { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.method__name { font-weight: 550; font-size: .9em; }
.method__num, .method__exp { font-family: "JetBrains Mono Variable", ui-monospace, monospace; font-size: .74em; color: var(--testo-2); }

.sum { display: flex; justify-content: space-between; align-items: baseline; margin: 1.1em .15em 1em; color: var(--testo-2); font-size: .9em; }
.sum__val { color: var(--testo); font-weight: 650; font-size: 1.35em; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.action { display: flex; justify-content: center; height: 3.1em; }
.pay {
  position: relative; height: 3.1em; width: 100%;
  border-radius: 1.55em; background: var(--accento); color: #fff;
  font-weight: 600; font-size: 1em; letter-spacing: -.005em;
  box-shadow: 0 10px 22px -12px rgba(15,122,85,.7), inset 0 1px 0 rgba(255,255,255,.2);
  display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; overflow: hidden;
}
.pay:focus-visible, .dl:focus-visible, .ok:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }
/* the label sits out of the grid flow: when the pill folds to a circle its nowrap width would widen the grid track and push the ring off centre */
.pay__label { position: absolute; inset: 0; display: grid; place-items: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay__ring { grid-area: 1 / 1; width: 2.3em; height: 2.3em; opacity: 0; }
.pay__ring circle, .pay__ring path { fill: none; stroke-linecap: round; }
.pay__track { stroke: rgba(255,255,255,.25); stroke-width: 2.4; }
.pay__arc { stroke: #fff; stroke-width: 2.4; stroke-dasharray: 1; stroke-dashoffset: .72; }
.pay__tick { stroke: #fff; stroke-width: 2.8; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }

.secure { display: flex; align-items: center; justify-content: center; gap: .4em; margin-top: .85em; font-size: .72em; color: var(--testo-3); }
.secure svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.3; }

/* ---- the receipt ---- */
.badge {
  width: 3.4em; height: 3.4em; margin: 0 auto .8em; border-radius: 50%;
  background: var(--accento); display: grid; place-items: center;
  box-shadow: 0 0 0 .45em var(--accento-velo), 0 12px 24px -12px rgba(15,122,85,.75);
}
.badge svg { width: 78%; height: 78%; }
.badge path { fill: none; stroke: #fff; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.done__title { font-weight: 600; font-size: .95em; color: var(--testo-2); }
.amount { margin: .15em 0 .9em; font-weight: 680; font-size: 2.2em; letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.amount__roll { display: inline-flex; }
.amount__roll .c { display: inline-block; height: 1.1em; overflow: hidden; vertical-align: top; }
.amount__roll .s { display: flex; flex-direction: column; }
.amount__roll .s span { height: 1.1em; display: block; }

.rows { text-align: left; border-top: 1px solid var(--linea); padding-top: .55em; margin-bottom: 1em; }
.row { display: flex; align-items: baseline; gap: .5em; padding: .36em .1em; font-size: .84em; }
.row dt { color: var(--testo-2); flex: none; }
.row dd { font-family: "JetBrains Mono Variable", ui-monospace, monospace; font-size: .92em; flex: none; display: inline-flex; align-items: center; gap: .4em; }
.row--total { font-weight: 650; }
.row--total dt { color: var(--testo); }
.row--total dd { font-weight: 650; }
.dots {
  flex: 1; height: 1px; align-self: center; transform-origin: 0 50%;
  background-image: linear-gradient(90deg, var(--testo-3) 45%, transparent 45%);
  background-size: 5px 1px; opacity: .55;
}
.mini { width: 1.6em; }
.mini svg { width: 100%; height: auto; }
.mini rect { fill: var(--testo); }
.mini path { fill: #fff; opacity: .9; }

.acts { display: grid; grid-template-columns: 1fr auto; gap: .55em; }
.dl {
  position: relative; overflow: hidden; height: 2.75em; border-radius: 1.4em;
  border: 1px solid var(--linea); background: var(--carta);
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  font-weight: 560; font-size: .88em;
}
.dl__icon { width: 1.15em; height: 1.15em; color: var(--accento); position: relative; z-index: 1; }
.dl__icon svg { width: 100%; height: 100%; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dl__label { position: relative; z-index: 1; white-space: nowrap; }
.dl__bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accento); transform: scaleX(0); transform-origin: 0 50%; }
.ok {
  height: 2.75em; padding: 0 1.3em; border-radius: 1.4em; background: var(--testo); color: #fff;
  font-weight: 600; font-size: .88em;
}

@media (hover: hover) {
  .dl:hover { border-color: #d6dadd; }
  .ok:hover { background: #2a2e33; }
}
