/* Shipwise interactive prototype. Built from the Figma frames at 414 × 896 and scaled to fit the frame it sits in */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #e9e9e7; -webkit-tap-highlight-color: transparent; }
body { display: grid; place-items: center; font-family: 'Barlow', system-ui, sans-serif; color: #323B4A; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
img { display: block; }
p { margin: 0; }

.stage { position: relative; overflow: hidden; }
.app { position: absolute; left: 0; top: 0; width: 414px; height: 896px; overflow: hidden; background: #FAFAFA; transform-origin: 0 0; border-radius: 20px; user-select: none; -webkit-user-select: none; }
.embed .app { border-radius: 0; }
html:has(.embed), .embed { background: #FAFAFA; }

/* Status bar */
.sb { position: absolute; left: 0; top: 0; width: 414px; height: 44px; z-index: 30; pointer-events: none; }
.sb .t { position: absolute; left: 33.4px; top: 17.2px; }
.sb .r { position: absolute; right: 18.3px; top: 17.3px; }

/* Screens: one is shown at a time; pushing a screen slides it in from the right */
.scr { position: absolute; inset: 0; background: #FAFAFA; display: flex; flex-direction: column; }
.scr.in-r { animation: in-r 340ms cubic-bezier(.2, .7, .2, 1) both; }
.scr.in-l { animation: in-l 340ms cubic-bezier(.2, .7, .2, 1) both; }
.scr.in-f { animation: in-f 260ms ease-out both; }
.scr.out-l { animation: out-l 340ms cubic-bezier(.2, .7, .2, 1) both; pointer-events: none; }
.scr.out-r { animation: out-r 340ms cubic-bezier(.2, .7, .2, 1) both; pointer-events: none; z-index: 2; }
.scr.out-f { animation: out-f 220ms ease-in both; pointer-events: none; }
@keyframes in-r { from { transform: translateX(100%); } }
@keyframes in-l { from { transform: translateX(-28%); filter: brightness(.94); } }
@keyframes in-f { from { opacity: 0; } }
@keyframes out-l { to { transform: translateX(-28%); filter: brightness(.94); } }
@keyframes out-r { to { transform: translateX(100%); } }
@keyframes out-f { to { opacity: 0; } }

/* Splash */
.splash { align-items: center; justify-content: center; gap: 0; background: #FAFAFA; }
.splash .mark { margin-top: 30px; }
.splash .word { margin-top: 20px; }
.load { width: 176px; height: 14px; margin-top: 18px; border-radius: 7px; background: #323B4B; padding: 2px; }
.load i { display: block; height: 100%; width: 4%; border-radius: 5px; background: #fff; transition: width 1300ms cubic-bezier(.4, .1, .3, 1); }

/* Shared type */
.hi { font-size: 16px; font-weight: 500; line-height: 1; }
.name { font-size: 53px; font-weight: 700; line-height: 53px; }
.menu { width: 60px; height: 60px; flex: none; border-radius: 16px; }
.top { display: flex; align-items: center; gap: 20px; }
.top > div { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.row-h { display: flex; gap: 20px; padding: 10px 0; font-size: 16px; font-weight: 500; }
.row-h span:first-child { flex: 1; }
.row-h .g { color: #929BA9; }

/* Home */
.home .body { position: absolute; left: 0; top: 60px; width: 414px; height: 746px; padding: 0 20px 20px; display: flex; flex-direction: column; gap: 20px; }
.search { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-radius: 50px; background: #fff; filter: drop-shadow(0 10px 10px rgb(0 0 0 / .1)); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 500 16px/1.2 'Barlow', system-ui, sans-serif; color: #323B4A; padding: 0; }
.search input::placeholder { color: #929BA9; }
.tiles { flex: 1; min-height: 0; display: flex; gap: 20px; }
.tiles > div { flex: 1; display: flex; flex-direction: column; gap: 20px; }
.tile { display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: 20px; border-radius: 30px; background: #F2F1F1; transition: transform 160ms, filter 160ms; }
.tile.grow { flex: 1; }
.tile.fix { height: 190px; flex: none; }
.tile:active { transform: scale(.97); filter: brightness(.96); }
.tile .ic { flex: 1; display: grid; place-items: center; }
.tile .tt { display: flex; align-items: center; justify-content: space-between; font-size: 17.5px; font-weight: 700; }
.tile .n { font-size: 14px; font-weight: 500; }
.tile.dark { background: #323B4B; color: #fff; }
.tile.dark:active { filter: brightness(1.15); }
.tile.green { background: #EAF5DC; }
.tile.nudge { animation: nudge 360ms ease; }
@keyframes nudge { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.arr { display: grid; place-items: center; width: 16px; height: 12px; flex: none; }
.arr img { transform: rotate(90deg); }
.arr.back img { transform: rotate(-90deg); }

/* Bottom bar with the tab icons from the design; four tap zones sit over it */
.bar { position: absolute; left: 0; top: 806px; width: 414px; height: 90px; border-radius: 30px 30px 0 0; background: #fff; z-index: 10; }
.bar .tabs { position: absolute; left: 55px; top: 31px; }
.bar .hit { position: absolute; top: 14px; height: 62px; width: 70px; border-radius: 16px; }
.bar .hit:active { background: rgb(50 59 75 / .06); }

/* Lists */
.head { position: relative; z-index: 5; flex: none; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 60px 0 20px; border-radius: 0 0 30px 30px; background: #fff; filter: drop-shadow(0 10px 10px rgb(0 0 0 / .1)); }
.head > .in { width: 374px; display: flex; flex-direction: column; gap: 20px; }
.days { display: flex; gap: 10px; }
.days button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 5px; border-radius: 10px; background: #fff; color: #929BA9; font-size: 14px; font-weight: 500; text-align: center; transition: background-color 200ms, color 200ms; }
.days button.on { background: #323B4B; color: #fff; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; margin-top: -30px; padding-top: 30px; }
.scroll::-webkit-scrollbar { display: none; }
.list { display: flex; flex-direction: column; gap: 20px; padding: 20px 20px 110px; }
.card { display: flex; flex-direction: column; justify-content: flex-end; gap: 20px; width: 100%; padding: 20px; border-radius: 20px; background: #F2F1F1; transition: transform 160ms, filter 160ms, opacity 300ms; }
.card:active { transform: scale(.98); filter: brightness(.97); }
.card.red { background: #F9E6E6; }
.card .rw { display: flex; align-items: center; gap: 20px; }
.card .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; white-space: nowrap; }
.km { font-size: 17.5px; font-weight: 700; }
.lt { font-size: 16px; font-weight: 500; }
.pr { font-size: 35px; font-weight: 700; line-height: 1; }
.trk { height: 8px; padding: 2px 3px; border-radius: 50px; background: #E3E3E3; }
.trk i { display: block; height: 100%; border-radius: 20px; background: #fff; transition: width 600ms cubic-bezier(.2, .7, .2, 1); }
.red .trk { background: #E9C4C4; }
.red .trk i { background: #F37878; }
.card.gone { opacity: 0; transform: translateX(40px); }
.empty { padding: 40px 0; text-align: center; color: #929BA9; font-size: 16px; font-weight: 500; }

/* Shipment detail */
.det .head { gap: 16px; }
.det .head > .in { gap: 20px; }
.backrow { display: flex; align-items: center; gap: 20px; font-size: 16px; font-weight: 500; line-height: 1; margin: -10px -10px; padding: 10px; border-radius: 12px; width: max-content; }
.backrow:active { background: rgb(50 59 75 / .06); }
.dest { display: flex; flex-direction: column; gap: 20px; padding: 20px; border-radius: 20px; background: #323B4B; color: #fff; }
.dest b { font-size: 16px; font-weight: 700; }
.dest span { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; white-space: pre; }
.trip { display: flex; flex-direction: column; gap: 20px; padding: 20px; border-radius: 20px; background: #F2F1F1; }
.trip.red { background: #F9E6E6; }
.trip .rw { display: flex; align-items: center; gap: 20px; }
.trip .tx { flex: 1; display: flex; flex-direction: column; gap: 10px; white-space: nowrap; }
.map { position: relative; width: 414px; height: 0; overflow: hidden; transition: height 420ms cubic-bezier(.2, .7, .2, 1); margin: -16px 0 0; }
.map.open { height: 485px; margin: 0; }
.map > img:first-child { width: 414px; height: 485px; object-fit: cover; object-position: bottom; }
.map .pin { position: absolute; left: 246px; top: 203px; transform-origin: 50% 100%; }
.map.open .pin { animation: drop 520ms 240ms cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes drop { from { transform: translateY(-30px) scale(.6); opacity: 0; } }
.grab { width: 120px; height: 24px; margin: -10px 0 -9px; display: grid; place-items: center; }
.grab i { width: 49px; height: 5px; border-radius: 20px; background: #323B4B; transition: width 200ms; }
.grab:active i { width: 60px; }
.hist { display: flex; flex-direction: column; gap: 20px; padding: 20px 20px 120px; }
.hist .items { display: flex; flex-direction: column; gap: 40px; }
.hi-row { display: flex; gap: 20px; align-items: flex-start; color: #828792; }
.hi-row div { display: flex; flex-direction: column; gap: 10px; }
.hi-row b { font-size: 16px; font-weight: 700; }
.hi-row span { font-size: 14px; font-weight: 500; white-space: pre; }
.hi-row.new { animation: fresh 700ms ease both; color: #323B4A; }
@keyframes fresh { from { opacity: 0; transform: translateY(-8px); } }

/* Slide to confirm */
.slide { position: relative; display: flex; align-items: center; gap: 20px; height: 70px; padding: 10px 40px 10px 10px; border-radius: 50px; background: #63FF80; color: #0D5119; font-size: 16px; font-weight: 700; touch-action: none; overflow: hidden; }
.slide.pick { background: #FFDD63; color: #4B3D0A; }
.slide .lab { flex: 1; text-align: center; transition: opacity 200ms; }
.slide .knob { position: relative; z-index: 2; width: 50px; height: 50px; flex: none; border-radius: 50%; cursor: grab; transition: transform 300ms cubic-bezier(.3, 1.4, .5, 1); }
.slide .knob:active { cursor: grabbing; }
.slide .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 70px; border-radius: 50px; background: rgb(255 255 255 / .35); pointer-events: none; }
.slide.hint .knob { animation: hint 1.6s 600ms ease-in-out 2; }
@keyframes hint { 0%, 100% { transform: none; } 30% { transform: translateX(26px); } 55% { transform: none; } }
.dock { position: absolute; left: 0; top: 806px; width: 414px; height: 90px; border-radius: 30px 30px 0 0; background: #fff; z-index: 10; }
.dock { transition: transform 360ms cubic-bezier(.2, .7, .2, 1); }
.mapview .dock { transform: translateY(100%); }
.dock .slide { position: absolute; left: 6px; top: 10px; width: 402px; }
.pickwrap { padding: 10px 0 0; }

/* Finish drop sheet over the blurred shipment */
.blurred > :not(.sheet):not(.sb) { filter: blur(5px); transition: filter 300ms; }
.sheet { position: absolute; left: 0; top: 395px; width: 414px; height: 501px; z-index: 20; border-radius: 30px 30px 0 0; background: #fff; animation: up 420ms cubic-bezier(.2, .7, .2, 1) both; }
.sheet.down { animation: down 300ms ease-in both; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes down { to { transform: translateY(100%); } }
.finish { position: absolute; left: 6px; top: 10px; width: 402px; height: 70px; display: flex; align-items: center; gap: 20px; padding: 10px 10px 10px 80px; border-radius: 50px; background: #323B4B; color: #fff; font-size: 16px; font-weight: 700; }
.finish .lab { flex: 1; text-align: center; }
.finish .knob { width: 50px; height: 50px; border-radius: 50%; transition: transform 500ms cubic-bezier(.5, 0, .2, 1); }
.finish:active .knob { transform: scale(.94); }
.qr { position: absolute; left: 47px; top: 109px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.qr p { font-size: 16px; font-weight: 700; }
.qr .code { position: relative; width: 300px; height: 300px; }
.qr .code::after { content: ""; position: absolute; left: -10px; right: -10px; top: 0; height: 3px; border-radius: 2px; background: #63FF80; box-shadow: 0 0 12px 2px rgb(99 255 128 / .6); animation: scan 1.8s ease-in-out infinite alternate; }
@keyframes scan { to { top: 297px; } }
.done { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 14px; background: #fff; border-radius: 30px 30px 0 0; text-align: center; animation: in-f 260ms ease-out both; }
.done .ok { width: 92px; height: 92px; border-radius: 50%; background: #63FF80; display: grid; place-items: center; animation: pop 520ms cubic-bezier(.3, 1.6, .5, 1) both; }
.done .ok svg { width: 44px; height: 44px; fill: none; stroke: #0D5119; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: tick 420ms 260ms ease-out forwards; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@keyframes tick { to { stroke-dashoffset: 0; } }
.done b { font-size: 21px; font-weight: 700; }
.done span { font-size: 16px; font-weight: 500; color: #828792; }

/* Toast */
.toast { position: absolute; left: 50%; top: 54px; z-index: 40; max-width: 360px; padding: 12px 18px; border-radius: 16px; background: #323B4B; color: #fff; font-size: 14px; font-weight: 500; text-align: center; transform: translateX(-50%); animation: toast 2.6s ease both; pointer-events: none; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -12px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -6px); } }

@media (prefers-reduced-motion: reduce) {
  .scr.in-r, .scr.in-l, .scr.out-l, .scr.out-r, .sheet, .sheet.down { animation-duration: 1ms; }
  .slide.hint .knob, .qr .code::after { animation: none; }
}
