/* =========================
   V-Link Mobile — Shared CSS
   ========================= */
:root { --navy:#0B1E3F; --sky:#2b98d5; --gold:#ffc728; }
html[lang="ar"] body, html[lang="ar"] *:not(code):not(.mono) { font-family:'Cairo', system-ui, sans-serif; }
html[lang="en"] body, html[lang="en"] *:not(code):not(.mono) { font-family:'Inter', system-ui, sans-serif; }
.mono { font-family:'JetBrains Mono', ui-monospace, monospace; }
body { background:#f6f8fd; color: var(--navy); min-height: 100vh; -webkit-font-smoothing: antialiased; }
.tnum { font-variant-numeric: tabular-nums; }
[x-cloak] { display:none !important; }
::selection { background:#2b98d544; color:#0B1E3F; }

/* App frame — phone-like on desktop, full width on mobile */
.app-frame {
  position: relative;
  max-width: 430px;
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  padding-bottom: 100px;
  overflow-x: hidden;
}
.app-frame.no-tab { padding-bottom: 0; }
@media (min-width: 640px) {
  body { background: radial-gradient(1000px 500px at 50% -10%, rgba(43,152,213,.18), transparent 60%), linear-gradient(180deg,#eaf0fa 0%, #f6f8fd 60%); padding: 32px 16px; }
  .app-frame {
    min-height: 840px;
    height: calc(100vh - 64px);
    max-height: 900px;
    border-radius: 40px;
    box-shadow: 0 40px 80px rgba(11,30,63,.22), 0 0 0 10px #0B1E3F, 0 0 0 12px #0f2049;
    overflow: hidden;
  }
  .app-frame.no-tab { padding-bottom: 0; }
}

/* Status bar */
.status-bar {
  height: 44px; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 24px 6px;
  font-size: 13px; font-weight: 700; color: #0B1E3F;
}
.status-bar-icons { display: flex; align-items: center; gap: 5px; }
.status-bar-battery { width: 22px; height: 11px; border: 1.5px solid #0B1E3F; border-radius: 3px; position: relative; }
.status-bar-battery::after { content:''; position:absolute; inset-inline-end: -3px; top: 2.5px; width: 2px; height: 4px; background: #0B1E3F; border-radius: 1px; }
.status-bar-battery-fill { position: absolute; inset: 1.5px; background: #0B1E3F; border-radius: 1px; width: 70%; }

/* Phone notch (desktop) */
.notch { display: none; }
@media (min-width: 640px) {
  .notch { display: block; position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 120px; height: 28px; background: #000; border-radius: 20px; z-index: 50; }
}

/* Tab bar */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #eef2f9;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 10px 0 calc(14px + env(safe-area-inset-bottom));
  max-width: 430px; margin: 0 auto;
  z-index: 40;
}
@media (min-width: 640px) {
  .tab-bar { position: absolute; border-bottom-left-radius: 40px; border-bottom-right-radius: 40px; padding-bottom: 14px; }
}
.tab-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #64748b; font-size: 11px; font-weight: 700; text-decoration: none; padding: 4px 0; }
.tab-item.active { color: var(--navy); }
.tab-item .tab-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--sky); opacity: 0; transition: opacity .2s; }
.tab-item.active .tab-dot { opacity: 1; }

/* Lang toggle (small, top-right on many pages) */
.lang-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: 999px; background: #fff;
  border: 1px solid #e2e8f0; color: #0B1E3F; font-size: 12px; font-weight: 700;
  box-shadow: 0 1px 2px rgba(11,30,63,.04);
}

/* Chip */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.chip-green { background: #dcfce7; color: #16a34a; }
.chip-red { background: #fee2e2; color: #dc2626; }
.chip-sky { background: #cfe9f9; color: #1b618e; }
.chip-slate { background: #f1f5f9; color: #475569; }

/* QR scan-line */
.qr-wrap { position: relative; overflow: hidden; }
.qr-scan-line {
  position: absolute; left: 6%; right: 6%; height: 2px;
  background: linear-gradient(90deg, transparent, #2b98d5, transparent);
  box-shadow: 0 0 14px #2b98d5;
  animation: scan 2.2s ease-in-out infinite;
}
@keyframes scan { 0%{top:8%} 50%{top:88%} 100%{top:8%} }

/* Live dot pulse */
.live-dot { position: relative; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; display: inline-block; }
.live-dot::before { content:''; position:absolute; inset:-3px; border-radius: 50%; background: currentColor; opacity: .3; animation: pulse 1.5s ease-out infinite; }
@keyframes pulse { 0%{transform:scale(.8);opacity:.4} 100%{transform:scale(2);opacity:0} }

/* Timer bar */
.timer-bar { height: 4px; background: linear-gradient(90deg,#2b98d5,#0B1E3F); border-radius: 999px; transform-origin: right center; transition: transform 1s linear; }
html[dir="ltr"] .timer-bar { transform-origin: left center; }

/* Merchant tile */
.m-tile { width: 48px; height: 48px; border-radius: 14px; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:800; font-size:18px; box-shadow: inset 0 -8px 18px rgba(0,0,0,.12); flex-shrink: 0; }
.m-tile-sm { width: 40px; height: 40px; border-radius: 12px; font-size: 15px; }

/* Filter chip */
.fchip { padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; border: 1px solid transparent; transition: all .2s; cursor: pointer; white-space: nowrap; }
.fchip-off { background: #fff; color: #475569; border-color: #e2e8f0; }
.fchip-on { background: var(--navy); color: #fff; }

/* Scrollbar hide */
.no-scroll::-webkit-scrollbar { display: none; }
.no-scroll { scrollbar-width: none; }

/* Toast */
.toast {
  position: fixed; bottom: 110px; left: 50%; transform: translateX(-50%);
  background: #0B1E3F; color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 700; box-shadow: 0 10px 30px rgba(11,30,63,.35);
  z-index: 100; pointer-events: none;
}

/* Sheet modal (bottom sheet) */
.sheet-bd {
  position: fixed; inset: 0;
  background: rgba(11,30,63,.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex; justify-content: center; align-items: flex-end;
  animation: fadeBd .2s ease;
}
.sheet {
  width: 100%; max-width: 430px;
  background: #fff;
  border-top-left-radius: 24px; border-top-right-radius: 24px;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  max-height: 85vh; overflow-y: auto;
  animation: sheetIn .3s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 -20px 60px rgba(11,30,63,.25);
}
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeBd { from { opacity: 0; } to { opacity: 1; } }

/* Fade up */
@keyframes fadeUp { from{opacity:0; transform:translateY(10px)} to{opacity:1; transform:translateY(0)} }
.fade-up { animation: fadeUp .32s ease both; }

/* Button presses */
.btn-press { transition: transform .15s; }
.btn-press:active { transform: scale(.97); }
