/* Panel pesanan pelanggan yang terasa hidup (js/fx-pesanan.js, js/sheet.js).
   Hanya transform & opacity; warna dari token app.css (terang & malam); semua gerak punya cadangan "kurangi gerakan" di bawah. */

/* ===== Mencari sopir: denyut radar di titik jemput (penanda HTML di peta) ===== */
.fx-radar{position:absolute;left:50%;top:50%;width:0;height:0;pointer-events:none}
.fx-radar i,.fx-radar b{position:absolute;left:-132px;top:-132px;width:264px;height:264px;border-radius:50%}
.fx-radar b{background:radial-gradient(circle,var(--pin) 0,transparent 68%);opacity:.07}
.fx-radar i{border:2px solid var(--pin);background:radial-gradient(circle,transparent 52%,var(--pin) 200%);opacity:0;will-change:transform,opacity;animation:fxRadar 3.9s cubic-bezier(.25,.6,.35,1) infinite}
.fx-radar i:nth-of-type(2){animation-delay:1.3s}
.fx-radar i:nth-of-type(3){animation-delay:2.6s}
@keyframes fxRadar{0%{transform:scale(.09);opacity:0}12%{opacity:.6}65%{opacity:.26}100%{transform:scale(1);opacity:0}}
.fx-seeking .pt-cari b{display:none}   /* denyut kecil bawaan penanda diganti radar */

/* ===== Mencari sopir: tahap pencarian ===== */
.fx-stg{list-style:none;margin-top:16px}
.fx-stg li{position:relative;display:flex;align-items:flex-start;gap:12px;padding-bottom:12px}
.fx-stg li:last-child{padding-bottom:0}
.fx-stg li::before{content:"";position:absolute;left:6px;top:19px;bottom:-3px;width:2px;border-radius:1px;background:var(--line-2)}
.fx-stg li:last-child::before{display:none}
.fx-stg li.on::before{background:var(--ink)}
.fx-stg li>i{position:relative;flex:none;width:12px;height:12px;margin:4px 0 0 1px;border-radius:50%;box-shadow:inset 0 0 0 2px var(--line-2)}
.fx-stg li.on>i{background:var(--ink);box-shadow:none}
.fx-stg li.cur>i{background:var(--grad-lamp);box-shadow:none}
.fx-stg li.cur>i::after{content:"";position:absolute;inset:-5px;border-radius:50%;border:2px solid var(--sodium);opacity:0;animation:fxDot 1.8s var(--e-standard) infinite}
@keyframes fxDot{0%{transform:scale(.55);opacity:.7}100%{transform:scale(1.25);opacity:0}}
.fx-stg li>span{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.fx-stg b{font-size:14.5px;font-weight:650;line-height:1.4;color:var(--grey)}
.fx-stg li.on b{color:var(--ink)}
.fx-stg li.cur b{color:var(--ink);font-weight:750}
.fx-stg small{font-size:12.5px;line-height:1.4;color:var(--grey)}
.fx-stg em{flex:none;font-style:normal;font-size:12.5px;line-height:1.6;color:var(--grey);font-variant-numeric:tabular-nums}
.fx-stg li.cur>span{animation:fxFade .3s ease-out both}

/* Satu baris penjelasan yang bergantian */
.fx-tip{display:flex;gap:10px;align-items:flex-start;min-height:60px;margin-top:14px;padding:11px 12px;border-radius:12px;background:var(--field);font-size:13px;line-height:1.45;color:var(--ink)}
.fx-tip svg{flex:none;width:18px;height:18px;margin-top:1px;color:var(--grey);fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.fx-tip>*{transition:opacity .2s ease-out}
.fx-tip.out>*{opacity:0}
.pv[data-st="searching"] .trip{margin-top:12px}

/* ===== Momen =====
   .pv[data-fx] dipasang fx-pesanan.js saat kabarnya datang. Semua jeda dikurangi --fx-e (waktu yang sudah lewat), supaya gerak
   berlanjut mulus bila panel digambar ulang di tengah momen. */
@keyframes fxFade{from{opacity:0}to{opacity:1}}
@keyframes fxUp{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@keyframes fxArrive{from{opacity:0;transform:translateY(26px)}to{opacity:1;transform:none}}
@keyframes fxPop{0%{opacity:0;transform:scale(.6)}100%{opacity:1;transform:none}}
@keyframes fxRing{0%{opacity:.9;transform:scale(.9)}100%{opacity:0;transform:scale(1.5)}}
@keyframes fxDigit{from{opacity:0;transform:translateY(14px) scale(.92)}to{opacity:1;transform:none}}
@keyframes fxNod{0%,100%{transform:none}40%{transform:translateY(-7px)}}
@keyframes fxTick{from{opacity:.35;transform:translateY(-.16em)}to{opacity:1;transform:none}}
.fx-tick{animation:fxTick .32s var(--e-enter)}
.prog.fx-0 i{transition:none}

/* Sopir ditemukan: kartu sopir "datang", cincin lampu sekali di fotonya */
.pv[data-fx="found"] .eta{animation:fxUp .4s var(--e-enter) both;animation-delay:calc(0s - var(--fx-e,0s))}
.pv[data-fx="found"] .drv{animation:fxArrive .56s var(--e-spring) both;animation-delay:calc(.14s - var(--fx-e,0s))}
.pv[data-fx="found"] .drv .av{animation:fxPop .5s var(--e-spring) both;animation-delay:calc(.24s - var(--fx-e,0s))}
.pv[data-fx="found"] .drv .av::after{content:"";position:absolute;inset:-4px;border-radius:50%;border:2px solid var(--lamp);opacity:0;animation:fxRing .9s var(--e-standard) both;animation-delay:calc(.5s - var(--fx-e,0s))}
.pv[data-fx="found"] .vrf em{animation:fxUp .3s var(--e-enter) both;animation-delay:calc(.5s - var(--fx-e,0s))}
.pv[data-fx="found"] .vrf em:nth-child(2){animation-delay:calc(.58s - var(--fx-e,0s))}
.pv[data-fx="found"] .vrf em:nth-child(3){animation-delay:calc(.66s - var(--fx-e,0s))}
.pv[data-fx="found"] .carnote,.pv[data-fx="found"] .carnote+.sub{animation:fxFade .4s ease-out both;animation-delay:calc(.42s - var(--fx-e,0s))}
.pv[data-fx="found"] .acts .act{animation:fxUp .36s var(--e-enter) both;animation-delay:calc(.48s - var(--fx-e,0s))}
.pv[data-fx="found"] .acts .act:nth-child(2){animation-delay:calc(.54s - var(--fx-e,0s))}
.pv[data-fx="found"] .acts .act:nth-child(3){animation-delay:calc(.6s - var(--fx-e,0s))}

/* Sopir tiba: angka PIN muncul satu per satu */
.pv[data-fx="arrived"] .eta{animation:fxUp .4s var(--e-enter) both;animation-delay:calc(0s - var(--fx-e,0s))}
.pv[data-fx="arrived"] .tpin .d b{animation:fxDigit .46s var(--e-spring) both;animation-delay:calc(.12s - var(--fx-e,0s))}
.pv[data-fx="arrived"] .tpin .d b:nth-child(2){animation-delay:calc(.19s - var(--fx-e,0s))}
.pv[data-fx="arrived"] .tpin .d b:nth-child(3){animation-delay:calc(.26s - var(--fx-e,0s))}
.pv[data-fx="arrived"] .tpin .d b:nth-child(4){animation-delay:calc(.33s - var(--fx-e,0s))}
.pv[data-fx="arrived"] .tpin .d b:nth-child(n+5){animation-delay:calc(.4s - var(--fx-e,0s))}
.pv[data-fx="arrived"] .tpin p{animation:fxFade .4s ease-out both;animation-delay:calc(.45s - var(--fx-e,0s))}

/* PIN cocok: angka mengangguk berurutan */
.pv[data-fx="pin"] .tpin .d b{animation:fxNod .46s var(--e-standard) both;animation-delay:calc(0s - var(--fx-e,0s))}
.pv[data-fx="pin"] .tpin .d b:nth-child(2){animation-delay:calc(.07s - var(--fx-e,0s))}
.pv[data-fx="pin"] .tpin .d b:nth-child(3){animation-delay:calc(.14s - var(--fx-e,0s))}
.pv[data-fx="pin"] .tpin .d b:nth-child(4){animation-delay:calc(.21s - var(--fx-e,0s))}
.pv[data-fx="pin"] .tpin .d b:nth-child(n+5){animation-delay:calc(.28s - var(--fx-e,0s))}
.pv[data-fx="pin"] .tpin p{animation:fxUp .4s var(--e-enter) both;animation-delay:calc(.32s - var(--fx-e,0s))}

/* Perjalanan dimulai: judul naik, jam tiba muncul, garis progres menyapu (fx-pesanan.js) */
.pv[data-fx="start"] .arrive>span:first-child{animation:fxUp .42s var(--e-enter) both;animation-delay:calc(0s - var(--fx-e,0s))}
.pv[data-fx="start"] .arrive .t{animation:fxPop .5s var(--e-spring) both;animation-delay:calc(.16s - var(--fx-e,0s));transform-origin:right bottom}
.pv[data-fx="start"] #jalanSub{animation:fxFade .4s ease-out both;animation-delay:calc(.3s - var(--fx-e,0s))}

/* Sampai: centang digambar (app.css), teks menyusul, total naik (fx-pesanan.js) */
.pv[data-fx="done"] .center h2{animation:fxUp .44s var(--e-enter) both;animation-delay:calc(.34s - var(--fx-e,0s))}
.pv[data-fx="done"] .center .sub{animation:fxUp .44s var(--e-enter) both;animation-delay:calc(.42s - var(--fx-e,0s))}
.pv[data-fx="done"] .sum{animation:fxFade .4s ease-out both;animation-delay:calc(.5s - var(--fx-e,0s))}

/* Pembayaran berhasil: tanda lunas muncul, cincin lampu sekali lagi */
.pv[data-fx="paid"] .sum .pm .ok{animation:fxPop .5s var(--e-spring) both;animation-delay:calc(.1s - var(--fx-e,0s));transform-origin:right center}
.pv[data-fx="paid"] svg.done.still .ring{display:block;animation:ring .9s var(--e-standard) forwards;animation-delay:calc(.1s - var(--fx-e,0s))}

/* ===== Pergantian status: panel beralih halus (View Transitions; cadangannya .pv.in di app.css) ===== */
html.fx-vt #panel{view-transition-name:fx-panel}
html.fx-vt #toast{view-transition-name:fx-toast}
html.fx-vt #tabs{view-transition-name:fx-tabs}
html.fx-vt::view-transition{pointer-events:none}   /* ketukan tetap sampai ke tombol selama transisi */
html.fx-vt::view-transition-old(root){display:none}   /* peta tetap hidup, tanpa bayangan potret lama */
html.fx-vt::view-transition-new(root){animation:none;mix-blend-mode:normal}
html.fx-vt::view-transition-group(fx-panel){animation-duration:.38s;animation-timing-function:var(--e-spring);background:var(--card);border-radius:var(--r-sheet) var(--r-sheet) 0 0}
/* isi lama memudar cepat, isi baru menyusul (tidak bertumpuk); di antaranya hanya warna kartu, bukan peta */
html.fx-vt::view-transition-old(fx-panel){animation:fxVtOut .11s ease-in both;mix-blend-mode:normal}
html.fx-vt::view-transition-new(fx-panel){animation:fxVtIn .24s .07s ease-out both;mix-blend-mode:normal}
@keyframes fxVtOut{to{opacity:0}}
@keyframes fxVtIn{from{opacity:0}}

/* ===== Panel bawah (sheet.js) ===== */
.panel{overscroll-behavior:contain}

/* ===== Kerangka muatan pertama ===== */
.fx-sk{display:block;flex:none;max-width:100%;background:var(--line);animation:skel 1.2s ease-in-out infinite alternate}
.fx-skr{display:flex;align-items:center;justify-content:space-between;gap:14px}
.fx-skr>span{display:flex;flex-direction:column;min-width:0}
.fx-skel .hlist{padding-top:1px;padding-bottom:1px}
.app:has(#panel>.fx-skel) #locate{visibility:hidden}   /* tombol lokasi belum punya tempat sebelum panel digambar */

/* ===== Akun: Suara ===== */
.card .fx-suara,.card .fx-suara+.row{border-top:1px solid var(--line)}

@media (prefers-reduced-motion: reduce){
  .fx-radar i{animation:none!important;opacity:.16;transform:scale(.5)}
  .fx-radar i:nth-of-type(2){transform:scale(.75)}
  .fx-radar i:nth-of-type(3){transform:scale(1)}
  .fx-stg li.cur>i::after{animation:none!important;opacity:.45;transform:none}
  .fx-tip>*{transition:none}
}
