:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --bordo: rgba(22, 24, 22, 0.08);
  --linea: #e7e8e5;
  --testo: #171917;
  --testo-2: #6a6e69;
  --testo-3: #a3a7a1;
  --accento: #1d7a55;        /* the refund green: the filled steps, the line, the amount that flies */
  --accento-tenue: #e6f2ec;  /* the soft green behind the landed amount */
  --maglia: #d8c6a6;         /* the colour of the returned item's tile */
  --maglia-scura: #bba684;
  --plastica: #1c2230;       /* the small payment card */
  --plastica-2: #3a4458;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
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; }
ol { list-style: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vh, 28px) 12px;
}

/* ---- the card ---- */
.card {
  position: relative;
  width: min(400px, 100%);
  background: var(--carta);
  border-radius: 22px;
  box-shadow:
    0 0 0 1px var(--bordo),
    0 1px 2px rgba(22, 24, 22, 0.04),
    0 10px 26px -12px rgba(22, 24, 22, 0.16),
    0 36px 64px -34px rgba(22, 24, 22, 0.22);
}
.card::before { /* a hairline of light along the top edge */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0) 30%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.card__in { position: relative; padding: clamp(14px, 3.6vh, 22px) clamp(15px, 4.6vw, 22px) clamp(13px, 3.2vh, 18px); }

.shop { display: flex; align-items: center; justify-content: space-between; margin-bottom: clamp(10px, 2.6vh, 16px); }
.shop__mark { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; letter-spacing: 0.01em; font-stretch: 108%; }
.shop__mark svg { width: 15px; height: 15px; fill: none; stroke: var(--testo); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.shop__ref { font-size: 12px; color: var(--testo-3); }

/* ---- the returned item ---- */
.item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.thumb {
  position: relative; width: 44px; height: 50px; border-radius: 10px; overflow: hidden;
  background: linear-gradient(160deg, var(--maglia) 0%, var(--maglia-scura) 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.35), 0 2px 6px -2px rgba(80,60,30,0.25);
}
.thumb__knit { /* a quiet knit rib on the colour tile */
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,0.13) 0 1px, rgba(0,0,0,0) 1px 4px);
  -webkit-mask: linear-gradient(180deg, transparent 0 62%, #000 62% 100%);
          mask: linear-gradient(180deg, transparent 0 62%, #000 62% 100%);
}
.thumb__tag { position: absolute; left: 50%; top: 6px; width: 10px; height: 4px; margin-left: -5px; border-radius: 0 0 3px 3px; background: rgba(255,255,255,0.55); }
.item__text { min-width: 0; }
.item__name { font-size: 15px; font-weight: 600; letter-spacing: -0.012em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__meta { font-size: 12.5px; color: var(--testo-2); margin-top: 3px; white-space: nowrap; }
.refund { text-align: right; }
.refund__label { display: block; font-size: 11.5px; color: var(--testo-2); margin-bottom: 2px; }
.refund__amt { display: inline-block; font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }

/* ---- the three steps ---- */
.steps { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); margin: clamp(16px, 3.8vh, 24px) -4px 0; }
.track { position: absolute; left: 16.666%; right: 16.666%; top: 9px; height: 2px; border-radius: 2px; background: var(--linea); overflow: hidden; }
.track__fill { position: absolute; inset: 0; background: var(--accento); transform-origin: 0 50%; transform: scaleX(0); border-radius: 2px; }
.step { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.node { position: relative; width: 20px; height: 20px; background: var(--carta); border-radius: 50%; }
.node svg { display: block; width: 20px; height: 20px; overflow: visible; }
.node__ring { fill: var(--carta); stroke: #cfd2cd; stroke-width: 1.2; transition: stroke .3s; }
.step.is-next .node__ring { stroke: var(--accento); stroke-width: 1.5; }
.node__full { fill: var(--accento); }
.node__tick { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.step__name { margin-top: 8px; font-size: 12.5px; font-weight: 550; color: var(--testo-3); transition: color .35s; white-space: nowrap; }
.step.is-done .step__name, .step.is-next .step__name { color: var(--testo); }
.step__date { display: block; height: 0; overflow: hidden; }
.step__date > span { display: block; padding-top: 3px; font-size: 11.5px; color: var(--testo-2); white-space: nowrap; }

/* ---- the payment card ---- */
.pay {
  position: relative; display: flex; align-items: center; gap: 11px;
  margin-top: clamp(14px, 3.4vh, 20px); padding: 10px 12px; border-radius: 14px;
  background: #f7f7f5; box-shadow: inset 0 0 0 1px rgba(22,24,22,0.05);
}
.plastic { position: relative; width: 40px; height: 27px; flex: none; }
.plastic__in {
  position: absolute; inset: 0; border-radius: 5px; overflow: hidden;
  background: linear-gradient(135deg, var(--plastica-2) 0%, var(--plastica) 70%);
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.18), 0 3px 8px -3px rgba(16,20,30,0.45);
}
.plastic__chip { position: absolute; left: 6px; top: 8px; width: 9px; height: 7px; border-radius: 2px; background: linear-gradient(135deg, #e3cf9b, #b89a5c); box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.2); }
.plastic__shine { position: absolute; top: -10px; bottom: -10px; left: -30px; width: 16px; transform: rotate(18deg); background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.45), rgba(255,255,255,0)); }
.pay__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pay__name { font-size: 13px; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap; }
.pay__dots { letter-spacing: 0.08em; color: var(--testo-2); }
.pay__bal { display: flex; align-items: center; gap: 4px; line-height: 1.2em; font-size: 12px; color: var(--testo-2); white-space: nowrap; }
.pay__bal .roll { color: var(--testo); font-weight: 550; }
.pay__plus {
  margin-left: auto; font-size: 12.5px; font-weight: 650; color: var(--accento);
  padding: 4px 8px; border-radius: 999px; background: var(--accento-tenue); opacity: 0;
}

/* the amount in flight */
.flyer {
  position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none;
  font-size: 13px; font-weight: 650; color: #fff; white-space: nowrap;
  padding: 4px 9px; border-radius: 999px; background: var(--accento);
  box-shadow: 0 6px 14px -6px rgba(29,122,85,0.65), inset 0 1px 0 rgba(255,255,255,0.25);
}

/* ---- the rolling digits ---- */
.roll { display: inline-flex; align-items: flex-start; height: 1.2em; line-height: 1.2em; overflow: hidden; }
.roll .s, .roll .d { display: block; height: 1.2em; }
.roll .d { overflow: hidden; }
.roll .d__col { display: block; }
.roll .d__col > span { display: block; height: 1.2em; }

/* ---- the footer ---- */
.foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: clamp(11px, 2.6vh, 15px); }
.eta { position: relative; flex: 1; min-width: 0; height: 1.3em; font-size: 12.5px; line-height: 1.3em; color: var(--testo-2); }
.eta__line { position: absolute; left: 0; top: 0; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.eta__line .roll { color: var(--testo); font-weight: 600; }
.eta__line--done { color: var(--accento); font-weight: 600; opacity: 0; }
.eta__line--done svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.trackbtn {
  position: relative; display: inline-flex; align-items: center; gap: 4px; flex: none;
  height: 32px; padding: 0 10px 0 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
}
.trackbtn__bg { position: absolute; inset: 0; border-radius: inherit; background: #f0f1ee; box-shadow: inset 0 0 0 1px rgba(22,24,22,0.06); }
.trackbtn__label, .trackbtn__chev { position: relative; }
.trackbtn__label { transition: font-stretch .35s cubic-bezier(.3,1.6,.5,1); }
.trackbtn__chev { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.trackbtn:focus-visible { outline: 2px solid var(--testo); outline-offset: 2px; }
@media (hover: hover) {
  .trackbtn:hover .trackbtn__label { font-stretch: 110%; }
}

@media (max-width: 360px) {
  .item__name { font-size: 14px; }
  .shop__ref { display: none; }
}
