/* ==========================================================================
   GiftCashly V16 — "How selling works" animation (includes/sell-flow-anim.php, assets/js/sell-flow.js)
   Four scenes, no heading / copy / pause button: 1 submit → 2 verification → 3 wallet → 4 withdraw (bank / crypto).
   Default markup = static explainer (final states). .is-anim (added by JS when motion is allowed) turns it into a
   12 s loop (4 × 3 s): the step with .is-on plays, .is-done steps show a tick and a filled connector.
   A dark navy band in BOTH themes; not mirrored by tools/build-theme-dark.php — dark-page tweaks are explicit below.
   Layout: ≥1061px four columns · 641–1060px rows (rail | scene | caption) · ≤640px rail on the left, scene over caption.
   ========================================================================== */
.hw{--hw-navy:#07184F;--hw-navy2:#0B2470;--hw-blue:#0A5CE0;--hw-violet:#5B3FD6;--hw-gold:#F5C451;--hw-green:#0B6B47;--hw-green2:#12935F;
  --hw-ink:#FFFFFF;--hw-ink2:rgba(255,255,255,.72);--hw-line:rgba(255,255,255,.12);--hw-ease:cubic-bezier(.2,.7,.2,1);
  max-width:1280px;margin:8px auto 0;padding:0 20px;font-family:'Inter',system-ui,-apple-system,'Segoe UI',sans-serif}
.hw *,.hw *::before,.hw *::after{box-sizing:border-box}
.hw-in{position:relative;overflow:hidden;border-radius:24px;padding:30px 30px 26px;color:var(--hw-ink);
  background:radial-gradient(70% 90% at 100% 0%,rgba(91,63,214,.42),transparent 60%),radial-gradient(60% 80% at 0% 100%,rgba(10,92,224,.38),transparent 62%),linear-gradient(160deg,#0B2470,#07184F 70%);
  box-shadow:0 18px 50px rgba(7,24,79,.22)}
.hw .hw-sr{position:absolute!important;width:1px;height:1px;margin:0;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* ---- steps + rail ---- */
.hw .hw-steps{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px}
.hw .hw-step{position:relative;display:flex;flex-direction:column;align-items:center;text-align:center;min-width:0;margin:0;padding:0}
.hw-step::before,.hw-step::after{content:'';position:absolute;top:16.5px;left:calc(50% + 26px);width:calc(100% + 20px - 52px);height:3px;border-radius:3px;background:var(--hw-line)}
.hw-step::after{background:linear-gradient(90deg,var(--hw-blue),var(--hw-violet),var(--hw-gold));transform-origin:left center;transform:scaleX(1)}
.hw-step:last-child::before,.hw-step:last-child::after{display:none}
.hw-node{position:relative;z-index:1;flex:0 0 auto;width:36px;height:36px;border-radius:50%;display:grid;place-items:center;margin:0 0 14px;
  background:var(--hw-green);border:2px solid rgba(255,255,255,.25);color:#fff;font:800 .95rem/1 'Sora',system-ui,sans-serif;transition:background .3s,box-shadow .3s,border-color .3s}
.hw-node b{display:none;font:inherit;color:#fff}
.hw-node svg{width:18px;height:18px;fill:none;stroke:#fff;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.hw-scene{position:relative;width:100%;height:196px;border-radius:16px;overflow:hidden;background:rgba(255,255,255,.05);border:1px solid var(--hw-line);
  transition:opacity .4s var(--hw-ease),border-color .4s,box-shadow .4s,filter .4s}
.hw .hw-cap{margin:12px 0 0;padding:0 4px}
.hw .hw-t{margin:0;font:700 1rem/1.25 'Sora',system-ui,sans-serif;letter-spacing:-.01em;color:#fff;transition:color .3s}
.hw .hw-d{margin:3px 0 0;font-size:.84rem;line-height:1.4;color:var(--hw-ink2)}

/* ---- pills ---- */
.hw-pill{position:absolute;left:50%;bottom:12px;transform:translateX(-50%);display:inline-flex;align-items:center;gap:6px;white-space:nowrap;
  padding:5px 11px;border-radius:999px;font:700 .74rem/1.2 'Inter',sans-serif}
.hw-pill svg{width:13px;height:13px;flex:0 0 auto;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.hw-pill-ok{background:rgba(18,147,95,.92);color:#fff}
.hw-pill-light{background:#fff;color:var(--hw-navy)}
.hw-pill-light svg{color:var(--hw-violet)}
.hw-pill-gold{background:rgba(245,196,81,.14);border:1px solid rgba(245,196,81,.5);color:var(--hw-gold)}
.hw-pill-dim{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.16);color:var(--hw-ink2);font-weight:600}

/* ---- gift card (scenes 1–2) ---- */
.hw-card{position:absolute;left:50%;top:18px;width:200px;height:124px;margin-left:-100px;border-radius:14px;padding:13px 13px 0;overflow:hidden;
  background:linear-gradient(135deg,var(--hw-blue) 0%,var(--hw-violet) 100%);box-shadow:0 14px 30px rgba(0,0,0,.35),inset 0 1px 0 rgba(255,255,255,.25);text-align:left}
.hw-card::after{content:'';position:absolute;right:-30px;top:-40px;width:130px;height:130px;border-radius:50%;background:radial-gradient(circle,rgba(255,255,255,.22),transparent 70%)}
.hw-card-top{display:flex;align-items:center;justify-content:space-between}
.hw-chip{width:28px;height:20px;border-radius:5px;background:linear-gradient(135deg,#FFE29A,var(--hw-gold) 55%,#C99A2E)}
.hw-card-v{font:800 1rem/1 'Sora',sans-serif;color:#fff}
.hw-card-brand{display:block;margin:8px 0 0;font:700 .6rem/1 'Inter',sans-serif;letter-spacing:.2em;color:rgba(255,255,255,.94)}
.hw-code{position:absolute;left:11px;right:11px;bottom:11px;height:30px;border-radius:8px;background:#fff;display:flex;align-items:center;padding:0 10px;
  font:700 .8rem/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:var(--hw-navy);letter-spacing:.02em;white-space:nowrap}
.hw-type{display:inline-block;overflow:hidden;width:14ch;opacity:0}
.hw-mask{position:absolute;left:10px;top:0;line-height:30px}
.hw-caret{display:inline-block;width:2px;height:14px;margin-left:1px;background:var(--hw-blue);opacity:0}
.hw-card-sm{width:184px;height:114px;margin-left:-112px}
.hw-card-sm .hw-mask{position:static;line-height:1}

/* ---- scene 2 ---- */
.hw-beam{position:absolute;left:0;right:0;top:-30px;height:30px;opacity:0;background:linear-gradient(180deg,transparent,rgba(245,196,81,.45) 70%,#FFE7A3 92%,transparent)}
.hw-shield{position:absolute;left:calc(50% + 36px);top:64px;width:58px;height:58px;border-radius:50%;display:grid;place-items:center;
  background:#fff;box-shadow:0 10px 26px rgba(0,0,0,.35),0 0 0 6px rgba(11,107,71,.25)}
.hw-shield svg{width:36px;height:36px}
.hw-shield .sh{fill:var(--hw-green)}
.hw-shield .ck{fill:none;stroke:#fff;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:30;stroke-dashoffset:0}

/* ---- scene 3: coins → wallet, then the amount + time pills on one row (never on top of the wallet) ---- */
.hw-wallet{position:absolute;left:50%;top:30px;width:112px;height:86px;margin-left:-56px}
.hw-wallet svg,.hw-src svg{display:block;width:100%;height:100%;overflow:visible}
.hw .wb{fill:var(--hw-green);stroke:rgba(255,255,255,.25);stroke-width:2}
.hw .wf{fill:none;stroke:rgba(255,255,255,.35);stroke-width:3}
.hw .wp{fill:var(--hw-green2);stroke:rgba(255,255,255,.3);stroke-width:2}
.hw .wd{fill:var(--hw-gold)}
.hw-drop{position:absolute;left:50%;top:6px;width:0;height:0}
.hw-coin{position:absolute;left:-13px;top:0;width:26px;height:26px;border-radius:50%;display:grid;place-items:center;opacity:0;font-style:normal;
  background:radial-gradient(circle at 35% 30%,#FFF1C4,var(--hw-gold) 55%,#C99A2E);color:#7A5300;font:800 .78rem/1 'Sora',sans-serif;box-shadow:0 4px 10px rgba(0,0,0,.3)}
.hw-coin.c1{left:-34px}.hw-coin.c3{left:8px}
.hw-row{position:absolute;left:8px;right:8px;bottom:12px;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px}
.hw-row .hw-pill{position:static;transform:none}
.hw-amt{display:inline-flex;align-items:center;padding:4px 10px;border-radius:10px;background:#E9F8F0;color:var(--hw-green);
  font:800 .95rem/1.25 'Sora',sans-serif;font-variant-numeric:tabular-nums;box-shadow:0 8px 20px rgba(0,0,0,.25);min-width:84px;justify-content:center}

/* ---- scene 4: wallet → bank + crypto (240 × 148 box, centred) ---- */
.hw-out{position:absolute;left:50%;top:8px;width:240px;height:148px;margin-left:-120px}
.hw-paths{position:absolute;inset:0 0 auto 0;width:240px;height:140px;overflow:visible}
.hw-paths path{fill:none;stroke:rgba(255,255,255,.28);stroke-width:2;stroke-linecap:round;stroke-dasharray:4 6}
.hw-src{position:absolute;left:8px;top:44px;width:64px;height:49px;text-align:center}
.hw-src small,.hw-dst small{position:absolute;left:50%;transform:translateX(-50%);white-space:nowrap;font:600 .7rem/1 'Inter',sans-serif;color:var(--hw-ink2)}
.hw-src small{top:56px}
.hw-dst{position:absolute;left:172px;width:46px;height:46px}
.hw-bank{top:9px}.hw-crypto{top:85px}
.hw-dst small{top:50px}
.hw-dst .tile{position:relative;display:grid;place-items:center;width:46px;height:46px;border-radius:13px;color:#fff;
  box-shadow:0 8px 20px rgba(0,0,0,.3),inset 0 1px 0 rgba(255,255,255,.25)}
.hw-bank .tile{background:linear-gradient(150deg,#2F7BFF,#5B3FD6)}
.hw-crypto .tile{background:linear-gradient(150deg,#F7931A,#E2761B)}
.hw-dst .tile svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.hw-dst .ok{position:absolute;right:-6px;top:-6px;width:19px;height:19px;border-radius:50%;display:grid;place-items:center;background:#19B98A;box-shadow:0 0 0 2px #0B2470}
.hw-dst .ok svg{width:11px;height:11px;stroke:#fff;stroke-width:3.4}
.hw-bill{position:absolute;left:63px;top:58px;width:22px;height:22px;border-radius:50%;display:grid;place-items:center;opacity:0;font-style:normal;
  background:radial-gradient(circle at 35% 30%,#FFF1C4,var(--hw-gold) 55%,#C99A2E);color:#7A5300;font:800 .7rem/1 'Sora',sans-serif;box-shadow:0 4px 10px rgba(0,0,0,.35)}
.hw-min{bottom:10px;padding:4px 10px;font-size:.7rem}

/* ==========================================================================
   Animated mode
   ========================================================================== */
.hw.is-anim .hw-node{background:var(--hw-navy2)}
.hw.is-anim .hw-node b{display:block}
.hw.is-anim .hw-node svg{display:none}
.hw.is-anim .hw-step::after{transform:scaleX(0)}
.hw.is-anim .hw-step:not(.is-on) .hw-scene{opacity:.5;filter:saturate(.55)}
.hw.is-anim .hw-step.is-on .hw-scene{border-color:rgba(245,196,81,.55);box-shadow:0 0 0 1px rgba(245,196,81,.25),0 18px 40px rgba(10,92,224,.35);background:rgba(255,255,255,.08)}
.hw.is-anim .hw-step.is-on .hw-node{background:var(--hw-blue);border-color:#fff;box-shadow:0 0 0 6px rgba(10,92,224,.35)}
.hw.is-anim .hw-step.is-on .hw-t{color:var(--hw-gold)}
.hw.is-anim .hw-step.is-done .hw-node{background:var(--hw-green)}
.hw.is-anim .hw-step.is-done .hw-node b{display:none}
.hw.is-anim .hw-step.is-done .hw-node svg{display:block}
.hw.is-anim .hw-step.is-done::after{transform:scaleX(1)}
.hw.is-anim .hw-step.is-on::after{animation:hwFill 3s linear both}

/* scene 1 */
.hw.is-anim .is-on .hw-sc1 .hw-card{animation:hwSlide .6s var(--hw-ease) both}
.hw.is-anim .is-on .hw-sc1 .hw-type{opacity:1;animation:hwType 1.2s steps(14,end) .55s both,hwOut .25s ease 1.9s forwards}
.hw.is-anim .is-on .hw-sc1 .hw-caret{animation:hwCaret 1.9s linear both}
.hw.is-anim .is-on .hw-sc1 .hw-mask{animation:hwIn .3s ease 1.9s both}
.hw.is-anim .is-on .hw-sc1 .hw-send{animation:hwRise .4s var(--hw-ease) 2.15s both}
/* scene 2 */
.hw.is-anim .is-on .hw-sc2 .hw-beam{animation:hwScan .75s ease-in-out .15s 2 backwards}
.hw.is-anim .is-on .hw-sc2 .hw-shield{animation:hwPop .45s cubic-bezier(.3,1.5,.5,1) 1.65s both}
.hw.is-anim .is-on .hw-sc2 .hw-shield .ck{animation:hwDraw .4s ease 2s both}
.hw.is-anim .is-on .hw-sc2 .hw-person{animation:hwRise .4s var(--hw-ease) 2.1s both}
/* scene 3 */
.hw.is-anim .is-on .hw-sc3 .hw-coin.c1{animation:hwDrop .7s cubic-bezier(.5,0,.8,.6) .1s both}
.hw.is-anim .is-on .hw-sc3 .hw-coin.c2{animation:hwDrop .7s cubic-bezier(.5,0,.8,.6) .35s both}
.hw.is-anim .is-on .hw-sc3 .hw-coin.c3{animation:hwDrop .7s cubic-bezier(.5,0,.8,.6) .6s both}
.hw.is-anim .is-on .hw-sc3 .hw-wallet{animation:hwBump .3s ease .75s 3 both}
.hw.is-anim .is-on .hw-sc3 .hw-amt{animation:hwRise .45s cubic-bezier(.3,1.4,.5,1) .95s both}
.hw.is-anim .is-on .hw-sc3 .hw-time{animation:hwRise .4s var(--hw-ease) 1.6s both}
/* scene 4: one coin to the bank, one to the crypto wallet, then the payout minimum */
.hw.is-anim .is-on .hw-sc4 .hw-paths path{animation:hwDash .9s linear infinite}
.hw.is-anim .is-on .hw-sc4 .hw-src{animation:hwBump .3s ease .2s 2 both}
.hw.is-anim .is-on .hw-sc4 .hw-bill.b1{animation:hwToBank .9s cubic-bezier(.45,0,.55,1) .25s both}
.hw.is-anim .is-on .hw-sc4 .hw-bill.b2{animation:hwToCrypto .9s cubic-bezier(.45,0,.55,1) 1.05s both}
.hw.is-anim .is-on .hw-sc4 .hw-bank .tile{animation:hwHit .45s ease 1.1s both}
.hw.is-anim .is-on .hw-sc4 .hw-crypto .tile{animation:hwHit .45s ease 1.9s both}
.hw.is-anim .is-on .hw-sc4 .hw-bank .ok{animation:hwPop .35s cubic-bezier(.3,1.5,.5,1) 1.15s both}
.hw.is-anim .is-on .hw-sc4 .hw-crypto .ok{animation:hwPop .35s cubic-bezier(.3,1.5,.5,1) 1.95s both}
.hw.is-anim .is-on .hw-sc4 .hw-min{animation:hwRise .4s var(--hw-ease) 2.15s both}

.hw.is-off *,.hw.is-off *::before,.hw.is-off *::after{animation-play-state:paused!important}

@keyframes hwFill{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes hwSlide{from{transform:translateX(-60px) rotate(-6deg);opacity:0}to{transform:none;opacity:1}}
@keyframes hwType{from{width:0}to{width:14ch}}
@keyframes hwOut{to{opacity:0}}
@keyframes hwIn{from{opacity:0}to{opacity:1}}
@keyframes hwCaret{0%,14%,28%,42%,56%,70%,84%{opacity:1}7%,21%,35%,49%,63%,77%,91%,100%{opacity:0}}
@keyframes hwRise{from{opacity:0;translate:0 10px}to{opacity:1;translate:0 0}}
@keyframes hwScan{0%{top:-30px;opacity:1}100%{top:114px;opacity:1}}
@keyframes hwPop{from{transform:scale(.3);opacity:0}to{transform:scale(1);opacity:1}}
@keyframes hwDraw{from{stroke-dashoffset:30}to{stroke-dashoffset:0}}
@keyframes hwDrop{0%{opacity:0;transform:translateY(-6px) scale(1)}15%{opacity:1}80%{opacity:1;transform:translateY(42px) scale(.85)}100%{opacity:0;transform:translateY(52px) scale(.6)}}
@keyframes hwBump{0%,100%{transform:none}50%{transform:translateY(3px) scaleY(.97)}}
@keyframes hwDash{to{stroke-dashoffset:-20}}
@keyframes hwToBank{0%{opacity:0;transform:translate(0,0) scale(.7)}12%{opacity:1;transform:translate(10px,0) scale(1)}55%{transform:translate(64px,-14px)}88%{opacity:1;transform:translate(118px,-38px) scale(.95)}100%{opacity:0;transform:translate(122px,-38px) scale(.5)}}
@keyframes hwToCrypto{0%{opacity:0;transform:translate(0,0) scale(.7)}12%{opacity:1;transform:translate(10px,0) scale(1)}55%{transform:translate(64px,14px)}88%{opacity:1;transform:translate(118px,38px) scale(.95)}100%{opacity:0;transform:translate(122px,38px) scale(.5)}}
@keyframes hwHit{0%{transform:scale(1)}40%{transform:scale(1.12);box-shadow:0 0 0 6px rgba(255,255,255,.18),0 8px 20px rgba(0,0,0,.3)}100%{transform:scale(1)}}

/* ---- tablet: one row per step — rail | scene | caption ---- */
@media (max-width:1060px){
  .hw .hw-steps{grid-template-columns:minmax(0,1fr);gap:16px}
  .hw .hw-step{display:grid;grid-template-columns:36px minmax(0,1fr);column-gap:14px;align-items:start;text-align:left}
  .hw-node{grid-column:1;grid-row:1/span 2;margin:0}
  .hw-scene{grid-column:2}
  .hw .hw-cap{grid-column:2;margin:10px 0 0;padding:0}
  .hw-step::before,.hw-step::after{top:44px;left:16.5px;width:3px;height:calc(100% - 36px);transform-origin:center top}
  .hw-step:last-child::before,.hw-step:last-child::after{display:none}
  .hw.is-anim .hw-step::after{transform:scaleY(0)}
  .hw.is-anim .hw-step.is-done::after{transform:scaleY(1)}
  .hw.is-anim .hw-step.is-on::after{animation-name:hwFillY}
}
@media (min-width:641px) and (max-width:1060px){
  .hw .hw-step{grid-template-columns:36px minmax(260px,330px) minmax(0,1fr);column-gap:18px}
  .hw-node{grid-row:1}
  .hw-scene{grid-row:1}
  .hw .hw-cap{grid-column:3;grid-row:1;align-self:center;margin:0}
  .hw .hw-t{font-size:1.08rem}
}
@keyframes hwFillY{from{transform:scaleY(0)}to{transform:scaleY(1)}}
/* ---- phones ---- */
@media (max-width:640px){
  .hw{padding:0 12px;margin-bottom:28px}
  .hw-in{padding:22px 16px 24px;border-radius:20px}
  .hw .hw-steps{gap:14px}
  .hw-scene{height:188px}
  .hw .hw-cap{margin-top:8px}
  .hw .hw-t{font-size:.98rem}.hw .hw-d{font-size:.82rem}
}
@media (max-width:350px){
  .hw-in{padding-left:12px;padding-right:12px}
  .hw .hw-step{column-gap:10px}
  .hw-card{transform:scale(.92)}
  .hw-out{transform:scale(.9);transform-origin:50% 0}
}

@media (prefers-reduced-motion:reduce){
  .hw *,.hw *::before,.hw *::after{animation:none!important;transition:none!important}
}

/* ---- dark page: the band keeps its colours; only its edge changes ---- */
html[data-theme="dark"] .hw-in{box-shadow:0 18px 50px rgba(0,0,0,.45);outline:1px solid rgba(255,255,255,.07);outline-offset:-1px}
/* the dark theme recolours every h1–h3 (0,2,3) and p (0,2,1) on the page — the band keeps its own ink */
html[data-theme="dark"] .hw .hw-step .hw-t{color:#fff}
html[data-theme="dark"] .hw.is-anim .hw-step.is-on .hw-t{color:var(--hw-gold)}
html[data-theme="dark"] .hw .hw-step .hw-d{color:var(--hw-ink2)}
