/* Act 2 "where the money goes": pieces shared by every variant.
   The story continues Act 1's payment: EUR 129.00, Visa •• 4242, captured, settled, reconciled, posted to the
   ledger, available, withdrawn. Illustrative numbers that add up exactly:
   gross 129.00 − fee 2.45 = net 126.55; − reserve 6.45 = available 120.10; 120.10 + 6.45 + 2.45 = 129.00.
   Colours: amber = money on the move / pending (the portal's pending status), green = completed / available,
   brand blue = the ledger and money held by ecomm (reserved), muted = the fee. */

.money { position: relative; --money-avail: var(--ok); --money-pend: #efa23a; --money-res: var(--logo); --money-fee: color-mix(in srgb, var(--text-2) 55%, transparent); }

/* Product UI mock: surface, 1px line, card shadow, 16px radius */
.money-mock {
  position: relative; overflow: hidden;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-card);
}
.money-mock__bar { display: flex; align-items: center; gap: 8px; min-height: 45px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.money-mock__bar b { font: 600 14px/1 var(--font); white-space: nowrap; }
.money-mock__bar em { margin-left: auto; font: 500 12px/1 var(--font); font-style: normal; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.money-mock__bar em code { font: 400 11.5px/1 var(--code); }
.money .brand__mark--xs { width: 18px; height: 18px; border-radius: 5px; } /* keeps the small mark small on phones too */
.money-mono { font-family: var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* Balance buckets: Available / Pending / Reserved */
.money-bal { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.money-bal > div { display: grid; gap: 7px; padding: 14px 16px; min-width: 0; }
.money-bal > div + div { border-left: 1px solid var(--line); }
.money-bal > div > span { display: inline-flex; align-items: center; gap: 7px; font: 500 12px/1 var(--font); color: var(--text-2); white-space: nowrap; }
.money-bal > div > span i { flex: none; width: 8px; height: 8px; border-radius: 2px; }
.money-bal b { font: 500 22px/1 var(--font); letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.money-bal b small { font: 500 12px/1 var(--font); color: var(--text-2); letter-spacing: 0; margin-right: 4px; }
.money-key--avail { background: var(--money-avail); }
.money-key--pend { background: var(--money-pend); }
.money-key--res { background: var(--money-res); }
.money-key--fee { background: var(--money-fee); }

/* Withdrawal stages: Requested → Approved → Sent → Paid */
.money-stages { position: relative; }
.money-stages > ol { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.money-stages::before, .money-stages__fill {
  content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 11px; height: 2px; border-radius: 2px; background: var(--line-2);
}
.money-stages__fill { background: var(--money-avail); transform-origin: left; }
.money-stages li { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; font: 500 12px/1.2 var(--font); color: var(--text-2); transition: color .35s; }
.money-stages li i {
  position: relative; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--line-2);
  transition: background-color .6s, border-color .6s;
}
.money-stages li i svg { width: 12px; height: 12px; fill: none; stroke: var(--on-ok); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .3s; }
.money-stages li.is-done { color: var(--text); }
.money-stages li.is-done i { background: var(--money-avail); border-color: var(--money-avail); }
.money-stages li.is-done i svg { opacity: 1; }
.money-stages li.is-now { color: var(--text); }
.money-stages li.is-now i { border-color: var(--accent); }

/* Small status tag inside mocks */
.money-tag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 99px; font: 600 11px/1 var(--font); letter-spacing: .02em; white-space: nowrap; color: var(--ok-fg); background: var(--ok-bg); }
.money-tag svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.money-tag--gold { color: var(--accent); background: var(--accent-soft); }
.money-tag--blue { color: #fff; background: var(--logo); }

@media (max-width: 560px) {
  .money-bal > div { padding: 12px 10px; }
  .money-bal b { font-size: 17px; }
  .money-bal > div > span { font-size: 11px; gap: 5px; }
  .money-stages li { font-size: 11px; }
}

/* Act 2, variant A: a pinned payment detail that keeps moving after "Authorised".
   One coin (Act 1's moving payment) travels down the event rail; each event it reaches turns green,
   the balance fills, and the withdrawal finishes paid. The copy column tells the current step. */

.money-a { border-top: 1px solid var(--line); }
.money-a__pin { min-height: min(100svh, 4000px); display: flex; align-items: center; padding: 104px 0 44px; }
.money-a__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 88px); align-items: center; }

/* ---------- copy ---------- */
.money-a__copy { display: grid; justify-items: start; align-content: center; }
.money-a__lead { margin-top: 22px; max-width: 40ch; font-size: var(--t-large); color: var(--text-2); }
.money-a__chapters { width: 100%; margin-top: clamp(26px, 4.4vh, 44px); }
.money-a__steps { display: grid; gap: 22px; }
.money-a__steps li { max-width: 44ch; }
.money-a__num {
  display: inline-grid; place-items: center; min-width: 30px; height: 24px; padding: 0 8px; border-radius: 99px;
  font: 600 12px/1 var(--font); color: var(--on-accent); background: var(--accent);
}
.money-a__steps h3 { margin: 12px 0 6px; font: 600 var(--t-h3)/1.3 var(--font); letter-spacing: -.01em; }
.money-a__steps p { font-size: var(--t-medium); line-height: 1.5; color: var(--text-2); }
.money-a__progress { display: none; position: relative; height: 2px; margin-top: 26px; border-radius: 2px; background: var(--line); overflow: hidden; }
.money-a__progress i { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, var(--accent), var(--ok)); transform-origin: left; }

/* ---------- the payment card ---------- */
.money-a__stage { position: relative; min-width: 0; }
.money-a__stage::before { /* a soft violet glow behind the card */
  content: ""; position: absolute; inset: 12% 8% 18%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent);
}
.money-a__op { width: 100%; max-width: 640px; margin-left: auto; }

.money-a__sum { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.money-a__who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.money-a__card { flex: none; width: 50px; height: 34px; border-radius: 7px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.money-a__card .m { --m: .75; }
.money-a__amt { display: block; font: 500 26px/1 var(--font); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.money-a__who div > span { display: block; margin-top: 7px; font: 500 12.5px/1 var(--font); color: var(--text-2); white-space: nowrap; }
.money-a__status { display: grid; justify-items: end; flex: none; }
.money-a__status .st { grid-area: 1 / 1; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .3s var(--ease-out); }
.money-a__status .st.is-on { opacity: 1; transform: none; transition: opacity .35s .15s, transform .5s .15s var(--ease-out); }

/* events */
.money-a__events { position: relative; padding: 8px 0 10px; }
.money-a__events > ol { position: relative; }
.money-a__ev {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 14px; align-items: start;
  padding: 9px 18px 9px 56px; transition: opacity .45s, background-color .45s;
}
.money-a__ev > * { position: relative; }
.money-a__dot {
  position: absolute; left: 18px; top: 9px; z-index: 1;
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--line-2);
  transition: background-color .6s, border-color .6s;
}
.money-a__dot svg { width: 11px; height: 11px; fill: none; stroke: var(--on-ok); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.5); transition: opacity .45s .1s, transform .6s .1s var(--ease-out); }
.money-a__ev.is-done .money-a__dot { background: var(--ok); border-color: var(--ok); }
.money-a__ev.is-done .money-a__dot svg { opacity: 1; transform: none; }
.money-a__what > b, .money-a__what > span, .money-a__ev time { transition: color .6s; }
/* The step the money is on, or waits at: a brand ring with a dot inside. */
.money-a__ev:is(.is-now, .is-wait):not(.is-done) .money-a__dot { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 3.5px, var(--surface) 4px); }
/* Steps still to come stay readable: grey, not faded. */
.money-a__ev.is-future .money-a__what > b, .money-a__ev.is-future .money-a__what > span, .money-a__ev.is-future time { color: var(--hero-accent); }
.money-a__what { min-width: 0; }
.money-a__what > b { display: flex; align-items: center; gap: 8px; font: 600 14.5px/1.2 var(--font); letter-spacing: -.01em; }
.money-a__what > span { display: block; margin-top: 4px; font: 400 13px/1.35 var(--font); color: var(--text-2); }
.money-a__what .money-mono { color: var(--text); font-size: 12.5px; }
.money-a__what .money-tag { margin-left: 6px; padding: 3px 8px; vertical-align: 1px; }
.money-a__ev time { padding-top: 2px; font: 400 12px/1.2 var(--font); color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.money-a__ev--ledger .brand__mark--xs { width: 18px; height: 18px; }

.money-a__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 9px; }
.money-a__chips li {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px 5px 7px; border-radius: 99px;
  font: 500 11.5px/1 var(--font); color: var(--text-2); border: 1px solid var(--line-2);
  transition: color .35s, background-color .35s, border-color .35s;
}
.money-a__chips li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); transition: background-color .35s; }
.money-a__chips li.is-now { color: var(--text); border-color: var(--accent); }
.money-a__chips li.is-now::before { background: var(--accent); }
.money-a__chips li.is-done { color: var(--ok-fg); background: var(--ok-bg); border-color: transparent; }
.money-a__chips li.is-done::before { background: var(--ok); }

/* rail + coin (positioned from the dots by the script) */
.money-a__rail { position: absolute; left: 27px; top: 28px; width: 2px; height: calc(100% - 100px); border-radius: 2px; background: var(--line); z-index: 0; }
.money-a__fill { position: absolute; inset: 0; border-radius: 2px; background: var(--ok); transform-origin: top; }
.money-a__coin {
  position: absolute; left: -9px; top: -10px; z-index: 3; width: 20px; height: 20px; border-radius: 50%; display: none;
  background: var(--accent); box-shadow: 0 0 0 3px var(--surface);
}
.motion .money-a__coin { display: block; }

/* balance */
.money-a__bal { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.money-a__bar { position: relative; height: 10px; margin: 2px 18px 0; border-radius: 99px; overflow: hidden; background: color-mix(in srgb, var(--line) 80%, transparent); }
.money-a__seg { position: absolute; top: 0; bottom: 0; transform-origin: left; }
.money-a__seg--avail { left: 0; width: calc(93.101% - 2px); background: var(--money-avail); border-radius: 99px 0 0 99px; }
.money-a__seg--res { left: 93.101%; width: calc(5% - 2px); background: var(--money-res); }
.money-a__seg--fee { left: 98.101%; width: 1.899%; background: var(--money-fee); }
.money-a__seg--pend { left: 0; width: 100%; transform-origin: right; transform: scaleX(0); border-radius: 99px;
  background: repeating-linear-gradient(-45deg, var(--money-pend) 0 6px, color-mix(in srgb, var(--money-pend) 70%, transparent) 6px 12px); }
.money-a__legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 18px 15px; font: 500 12px/1 var(--font); color: var(--text-2); }
.money-a__legend > span { display: inline-flex; align-items: center; gap: 6px; }
.money-a__legend i { width: 8px; height: 8px; border-radius: 2px; }
.money-a__legend b { color: var(--text); font-weight: 500; font-size: 12px; }
.money-a__total { margin-left: auto; }
.money-a__swap { display: inline-grid; }
.money-a__swap em { grid-area: 1 / 1; font-style: normal; opacity: 0; transition: opacity .3s; }
.money-a__swap em.is-on { opacity: 1; }

/* ---------- motion: hidden until the script shows them ---------- */
.motion .money-a:not(.is-static) [data-ma-reveal],
.motion .money-a:not(.is-static) [data-ma-op] { visibility: hidden; }

@media (min-width: 900px) {
  /* The chapters stack in one place and cross-fade while the section is pinned. */
  .motion .money-a:not(.is-static) .money-a__steps { gap: 0; }
  .motion .money-a:not(.is-static) .money-a__steps li { grid-area: 1 / 1; opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .4s var(--ease-out); }
  .motion .money-a:not(.is-static) .money-a__steps li.is-active { opacity: 1; transform: none; transition: opacity .5s .2s, transform .7s .2s var(--ease-out); }
  .motion .money-a:not(.is-static) .money-a__progress { display: block; }
}
/* Short desktop screens: the pinned card tightens so the whole story fits */
@media (min-width: 900px) and (max-height: 860px) {
  .money-a__pin { padding: 92px 0 28px; }
  .money-a__lead { margin-top: 16px; }
  .money-a__chapters { margin-top: 22px; }
  .money-a__steps h3 { margin-top: 10px; }
  .money-a__sum { padding: 12px 16px; }
  .money-a__amt { font-size: 22px; }
  .money-a__events { padding: 4px 0 6px; }
  .money-a__ev { padding-top: 6px; padding-bottom: 6px; }
  .money-a__dot { top: 6px; }
  .money-a__what > span { margin-top: 3px; }
  .money-a__chips { margin-top: 7px; }
  .money-bal > div { padding: 10px 16px; gap: 6px; }
  .money-bal b { font-size: 19px; }
  .money-a__legend { padding: 10px 18px 12px; }
}
@media (min-width: 900px) and (max-height: 700px) {
  .money-a__lead { display: none; }
}

/* ---------- phones and tablets: no pin, the card reveals as it scrolls ---------- */
@media (max-width: 1080px) {
  .money-a__grid { gap: 36px; }
  .money-a__ev time { font-size: 11px; }
}
@media (max-width: 899.98px) {
  .money-a__pin { min-height: 0; padding: clamp(90px, 12vw, 160px) 0; }
  .money-a__grid { grid-template-columns: 1fr; gap: 36px; }
  .money-a__op { max-width: none; }
  .motion .money-a:not(.is-static) .money-a__chapters { display: none; }
  .money-a__steps { grid-template-columns: 1fr 1fr; gap: 22px; }
}
@media (max-width: 560px) {
  .money-a__steps { grid-template-columns: 1fr; }
  .money-a__sum { padding: 14px; }
  .money-a__amt { font-size: 21px; }
  .money-a__card { width: 42px; height: 28px; }
  .money-a__ev { grid-template-columns: 1fr; padding: 9px 14px 9px 48px; }
  .money-a__ev time { margin-top: 5px; padding: 0; font-size: 11px; }
  .money-a__dot { left: 14px; top: 9px; }
  .money-a__rail { left: 23px; }
  .money-a__bar { margin: 2px 14px 0; }
  .money-a__legend { padding: 12px 14px 14px; gap: 8px 12px; }
  .money-a__total { margin-left: 0; }
  .money-mock__bar em { display: none; }
}
