/* Remitello - logged-in area (dashboard, transfer, rewards, profile, track).
   Own classes only, with explicit dark-mode rules (html.dark). */

/* ---- entrance animation, staggered with style="--i:N" ---- */
.rise { opacity: 0; transform: translateY(14px); animation: accRise .6s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes accRise { to { opacity: 1; transform: none; } }

/* ---- welcome hero ---- */
.acc-hero { position: relative; overflow: hidden; border-radius: 28px; padding: 28px; color: #fff; isolation: isolate;
  background: linear-gradient(120deg, #1D4ED8 0%, #4F46E5 55%, #7C3AED 100%); box-shadow: 0 26px 50px -22px rgba(37,99,235,.6); }
.acc-hero::before { content: ""; position: absolute; z-index: -1; top: -45%; right: -8%; width: 440px; height: 440px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.24), transparent 66%); animation: accDrift 9s ease-in-out infinite alternate; }
.acc-hero::after { content: ""; position: absolute; z-index: -1; left: -90px; bottom: -130px; width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, rgba(16,185,129,.38), transparent 66%); animation: accDrift 11s ease-in-out infinite alternate-reverse; }
@keyframes accDrift { to { transform: translate(34px, 22px) scale(1.14); } }
.acc-hero h1 { color: #fff; }
.acc-hero p { color: rgba(255,255,255,.82); }
.acc-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 9999px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); color: #fff; }
.acc-chip i { color: #6EE7B7; }
.acc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 13px; line-height: 1.2; cursor: pointer;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); color: #fff; backdrop-filter: blur(6px); transition: background .2s, transform .2s; }
.acc-btn:hover { background: rgba(255,255,255,.26); transform: translateY(-1px); }
.acc-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.acc-btn-primary { background: #fff; color: #1D4ED8; border-color: #fff; box-shadow: 0 10px 22px -10px rgba(0,0,0,.45); }
.acc-btn-primary:hover { background: #EFF6FF; }
.acc-art { border-radius: 24px; overflow: hidden; box-shadow: 0 24px 44px -18px rgba(2,6,23,.55); border: 1px solid rgba(255,255,255,.35); background: #fff; }
.acc-art img { display: block; width: 100%; height: auto; }
.avatar-ring { width: 64px; height: 64px; border-radius: 9999px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 24px; color: #1D4ED8; background: #fff;
  box-shadow: 0 0 0 4px rgba(255,255,255,.3), 0 14px 26px -10px rgba(0,0,0,.45); animation: ringPulse 3.2s ease-in-out infinite; }
@keyframes ringPulse { 50% { box-shadow: 0 0 0 9px rgba(255,255,255,.12), 0 14px 26px -10px rgba(0,0,0,.45); } }

/* ---- stat cards ---- */
.stat-card { position: relative; overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 20px 34px -18px rgba(15,23,42,.3); }
.stat-ico { width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.stat-wave { position: absolute; left: 0; right: 0; bottom: 0; height: 56px; opacity: .55; pointer-events: none; }
.stat-wave path { animation: waveMove 7s ease-in-out infinite alternate; }
@keyframes waveMove { from { transform: translateX(0); } to { transform: translateX(-40px); } }

/* ---- order rows: progress line + hover ---- */
.order-card { position: relative; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.order-card:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -18px rgba(15,23,42,.35); }
.order-prog { position: absolute; left: 0; bottom: 0; height: 3px; border-radius: 0 3px 3px 0; transform-origin: left; animation: progGrow 1s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 70ms + 250ms); }
.order-prog.live { background: linear-gradient(90deg, #2563EB, #6366F1, #2563EB); background-size: 200% 100%; animation: progGrow 1s cubic-bezier(.2,.7,.2,1) both, progShimmer 1.8s linear infinite; animation-delay: calc(var(--i, 0) * 70ms + 250ms), 0s; }
.order-prog.done { background: linear-gradient(90deg, #10B981, #34D399); }
.order-prog.bad { background: #F43F5E; }
@keyframes progGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes progShimmer { to { background-position: -200% 0; } }
.pulse-dot { position: relative; }
.pulse-dot::after { content: ""; position: absolute; inset: 0; border-radius: 9999px; border: 2px solid #2563EB; opacity: 0; animation: dotPing 1.8s ease-out infinite; }
@keyframes dotPing { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.7); opacity: 0; } }

/* ---- big animated tracker (track page) ---- */
.trk-bar { position: relative; height: 10px; border-radius: 9999px; background: #E2E8F0; overflow: hidden; }
.trk-fill { position: absolute; inset: 0 auto 0 0; border-radius: 9999px; background: linear-gradient(90deg, #2563EB, #6366F1); animation: trkGrow 1.1s cubic-bezier(.2,.7,.2,1) both; transform-origin: left; }
.trk-fill.done { background: linear-gradient(90deg, #2563EB, #10B981); }
.trk-fill.live::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); width: 45%; animation: trkShine 1.6s linear infinite; }
@keyframes trkGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes trkShine { from { transform: translateX(-120%); } to { transform: translateX(320%); } }
.trk-step { transition: transform .25s ease; }
.trk-step.now { animation: stepBob 2s ease-in-out infinite; }
@keyframes stepBob { 50% { transform: translateY(-3px); } }

/* ---- side panel on the transfer page ---- */
.side-card { border-radius: 28px; padding: 18px; background: linear-gradient(160deg, #EFF6FF 0%, #F5F3FF 100%); border: 1px solid #DBEAFE; }
.flow-steps li { position: relative; padding-left: 38px; opacity: .55; animation: flowOn 9s ease-in-out infinite; animation-delay: calc(var(--k, 0) * 3s); }
.flow-steps li > i { position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 12px; background: #fff; color: #2563EB; border: 1px solid #DBEAFE; }
@keyframes flowOn { 0%, 6% { opacity: .5; } 12%, 30% { opacity: 1; } 40%, 100% { opacity: .5; } }

/* ---- points ring + coins (rewards) ---- */
.coin { position: absolute; width: 26px; height: 26px; border-radius: 9999px; background: radial-gradient(circle at 35% 30%, #FDE68A, #F59E0B 70%); border: 2px solid rgba(255,255,255,.65); box-shadow: 0 6px 14px -4px rgba(0,0,0,.35); animation: coinFloat 5s ease-in-out infinite; }
.coin::after { content: "\2605"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #B45309; }
@keyframes coinFloat { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-14px) rotate(14deg); } }
.meter { height: 8px; border-radius: 9999px; background: rgba(255,255,255,.25); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 9999px; background: linear-gradient(90deg, #6EE7B7, #fff); animation: trkGrow 1.1s cubic-bezier(.2,.7,.2,1) both; transform-origin: left; }

/* ---- checkout success: drawn check + burst ---- */
.ok-check circle { stroke-dasharray: 145; stroke-dashoffset: 145; animation: okDraw .7s ease-out forwards; }
.ok-check path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: okDraw .45s .55s ease-out forwards; }
@keyframes okDraw { to { stroke-dashoffset: 0; } }
.ok-burst { position: relative; height: 0; }
.ok-burst span { position: absolute; left: 33px; top: 42px; width: 7px; height: 7px; border-radius: 9999px; opacity: 0; animation: okBurst .9s .5s ease-out forwards; }
.ok-burst span:nth-child(odd) { background: #10B981; } .ok-burst span:nth-child(even) { background: #6366F1; } .ok-burst span:nth-child(3n) { background: #F59E0B; }
.ok-burst span:nth-child(1) { --dx: -46px; --dy: -34px; } .ok-burst span:nth-child(2) { --dx: -22px; --dy: -50px; } .ok-burst span:nth-child(3) { --dx: 6px; --dy: -54px; }
.ok-burst span:nth-child(4) { --dx: 34px; --dy: -44px; } .ok-burst span:nth-child(5) { --dx: 52px; --dy: -20px; } .ok-burst span:nth-child(6) { --dx: -54px; --dy: -8px; }
.ok-burst span:nth-child(7) { --dx: 48px; --dy: 8px; } .ok-burst span:nth-child(8) { --dx: -36px; --dy: 12px; }
@keyframes okBurst { 0% { opacity: 1; transform: translate(0,0) scale(1); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.4); } }

/* ---- dark mode ---- */
html.dark .acc-hero { background: linear-gradient(120deg, #1E3A8A 0%, #3730A3 55%, #5B21B6 100%); box-shadow: 0 26px 50px -22px rgba(0,0,0,.7); }
html.dark .acc-art { border-color: rgba(255,255,255,.12); background: #0B1220; box-shadow: 0 24px 44px -18px rgba(0,0,0,.7); }
html.dark .stat-card:hover, html.dark .order-card:hover { box-shadow: 0 20px 34px -18px rgba(0,0,0,.7); }
html.dark .trk-bar { background: #243047; }
html.dark .side-card { background: linear-gradient(160deg, #111C33 0%, #17142E 100%); border-color: #243047; }
html.dark .flow-steps li > i { background: #0B1220; border-color: #243047; color: #60A5FA; }
html.dark .avatar-ring { color: #1E3A8A; }

@media (prefers-reduced-motion: reduce) {
  .rise, .order-prog, .trk-fill, .meter > span { animation: none; opacity: 1; transform: none; }
  .acc-hero::before, .acc-hero::after, .avatar-ring, .stat-wave path, .pulse-dot::after, .trk-step.now, .coin, .flow-steps li, .order-prog.live, .trk-fill.live::after { animation: none; }
  .flow-steps li { opacity: 1; }
  .ok-check circle, .ok-check path { animation: none; stroke-dashoffset: 0; } .ok-burst { display: none; }
}
