/* واجهة عميل Qoinez — الموبايل أولاً، والكمبيوتر من 900px */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: var(--fs); line-height: 1.6; min-height: 100vh; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { display: block; }
a { color: var(--p1); }
h1, h2, h3 { margin: 0; line-height: 1.35; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.num, .ltr { direction: ltr; unicode-bidi: isolate; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ===== الأزرار ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 22px; border-radius: 14px; font-weight: 700; font-size: 16px;
  background: var(--grad); color: #fff; box-shadow: 0 10px 22px -12px rgba(192, 38, 211, .8);
  transition: transform .12s ease, filter .15s, opacity .2s; text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn-block { width: 100%; margin-top: 18px; }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; border-radius: 12px; }
.btn-white { background: #fff; color: var(--p1); box-shadow: none; }
.btn-glass { background: rgba(255,255,255,.18); box-shadow: none; }
.btn-ghost-light { background: rgba(255,255,255,.16); box-shadow: none; }
.link { color: var(--p1); font-weight: 700; font-size: var(--fs-sm); }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; background: var(--card); display: grid; place-items: center; color: var(--ink-2); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.icon-btn:hover { color: var(--p1); }

/* ===== الحقول ===== */
.field { margin-top: 16px; }
.field:first-child { margin-top: 0; }
.field label, .lbl-sm { display: block; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); margin-bottom: 7px; }
.input { width: 100%; height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; padding: 0 16px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--p1); box-shadow: 0 0 0 4px var(--soft); }
.input.ltr { direction: ltr; text-align: left; font-weight: 700; letter-spacing: .3px; }
.hint { font-size: var(--fs-sm); color: var(--muted); margin-top: 6px; }
.alert { border-radius: 12px; padding: 12px 14px; font-size: var(--fs-sm); font-weight: 600; margin-top: 14px; }
.alert.err { background: var(--err-soft); color: var(--err); }
.alert.info { background: var(--soft); color: var(--p-dark); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.conv { margin-top: 12px; background: var(--ok-soft); color: var(--ok); border-radius: 14px; padding: 12px 14px; font-weight: 600; }
.conv b { font-size: 19px; }
.conv small { display: block; color: var(--ink-2); font-weight: 600; font-size: var(--fs-xs); }
.amount-chips { display: flex; gap: 8px; margin-top: 8px; }
.amount-chips button { background: var(--soft); color: var(--p1); font-weight: 700; border-radius: 99px; padding: 4px 14px; font-size: var(--fs-sm); }

/* ===== البطاقات ===== */
.card { background: var(--card); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card + .card { margin-top: 16px; }
.card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-h h3, .card-title { font-size: var(--fs-md); font-weight: 800; }
.card-title { margin-bottom: 14px; }

/* ===== الهوية ===== */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 21px; color: inherit; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--grad); position: relative; box-shadow: 0 6px 14px -6px rgba(124, 58, 237, .7); }
.brand-mark::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; border: 3px solid #fff; border-left-color: transparent; transform: rotate(-45deg); }

/* ===== الصفحة العامة ===== */
.landing { min-height: 100vh; display: flex; flex-direction: column; }
.pub-header { position: absolute; inset: 0 0 auto; z-index: 5; color: #fff; }
.pub-header-in { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.pub-header .brand-mark { background: #fff; }
.pub-header .brand-mark::after { border-color: var(--p1); border-left-color: transparent; }
.pub-header .btn-ghost-light { color: #fff; }
.hero { background: var(--grad); color: #fff; padding: 100px 0 90px; border-radius: 0 0 36px 36px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: rgba(255,255,255,.1); top: -180px; left: -140px; }
.hero-grid { position: relative; display: grid; gap: 28px; }
.eyebrow { display: inline-block; background: rgba(255,255,255,.18); border-radius: 99px; padding: 4px 14px; font-size: var(--fs-sm); font-weight: 700; }
.hero h1 { font-size: 30px; font-weight: 800; margin: 14px 0 12px; }
.hero h1 span { color: #fde68a; }
.hero p { margin: 0; opacity: .92; font-size: 16px; }
.hero-points { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; font-weight: 700; }
.hero-points li { display: flex; align-items: center; gap: 10px; }
.hero-points li::before { content: "✓"; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; font-size: 13px; flex: 0 0 auto; }
.login-card { background: #fff; color: var(--ink); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-lg); align-self: center; }
.login-card h2 { font-size: var(--fs-lg); font-weight: 800; }
.login-card p { color: var(--muted); margin: 6px 0 18px; opacity: 1; font-size: var(--fs); }
.login-card small { display: block; color: var(--muted); margin-top: 14px; font-size: var(--fs-xs); }
#gbtn { display: flex; justify-content: center; min-height: 44px; }
.marquee { margin-top: -46px; position: relative; z-index: 2; overflow: hidden; padding: 8px 0; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; animation: slide 45s linear infinite; }
.marquee img { width: 72px; height: 72px; border-radius: 20px; box-shadow: var(--shadow); background: #fff; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }
.pub-section { padding-top: 40px; }
.sec-h { font-size: var(--fs-lg); font-weight: 800; margin-bottom: 16px; }
.steps { display: grid; gap: 12px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); }
.step-n { width: 40px; height: 40px; border-radius: 12px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; margin-bottom: 10px; }
.step b { font-size: var(--fs-md); }
.step p { margin: 4px 0 0; color: var(--muted); }
.pay-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.pay-chip { display: inline-flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 6px 16px 6px 6px; font-weight: 700; font-size: var(--fs-sm); }
.pub-footer { margin-top: auto; padding: 40px 0 28px; color: var(--muted); font-size: var(--fs-sm); text-align: center; }

/* ===== رأس حساب العميل ===== */
.app-header { background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.app-header-in { display: flex; align-items: center; gap: 12px; height: 64px; }
.app-header .brand { display: none; }
.top-nav { display: none; }
.user-box { display: flex; align-items: center; gap: 10px; flex: 1; }
.avatar { width: 42px; height: 42px; border-radius: 12px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; overflow: hidden; flex: 0 0 auto; order: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.who { flex: 1; min-width: 0; order: 1; }
.who small { color: var(--muted); display: block; font-size: var(--fs-xs); }
.who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bal-chip { display: none; }
.user-box .icon-btn { order: 2; }
.app-main { padding-top: 18px; padding-bottom: 110px; }

/* ===== رؤوس الصفحات ===== */
.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: var(--fs-lg); font-weight: 800; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.sec-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 26px 0 14px; }
.sec-title h3 { font-size: var(--fs-md); font-weight: 800; }
.sec-title small { color: var(--muted); font-size: var(--fs-sm); }

/* ===== الرئيسية ===== */
.home-top { display: grid; gap: 16px; }
.balance-card { position: relative; overflow: hidden; background: var(--grad); color: #fff; border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-lg); }
.balance-card::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.1); top: -90px; left: -60px; }
.balance-card .lbl { opacity: .88; }
.balance-card .amt { font-size: 40px; font-weight: 800; direction: ltr; text-align: right; line-height: 1.2; margin: 6px 0 20px; }
.balance-card .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: relative; z-index: 1; }
.recent { display: none; }

.apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; }
.app-tile { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; padding: 6px 2px; border-radius: var(--r); transition: background .15s; }
.app-tile:hover { background: rgba(124, 58, 237, .06); }
.app-tile .ic { width: 62px; height: 62px; border-radius: 18px; overflow: hidden; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; }
.app-tile .ic img { width: 100%; height: 100%; object-fit: cover; }
.app-tile span { font-size: var(--fs-sm); font-weight: 700; line-height: 1.3; }
.app-tile.sel .ic { outline: 3px solid var(--p1); outline-offset: 2px; }
.ph { background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; width: 100%; height: 100%; }

/* ===== تأكيد راتب ===== */
.split { display: grid; gap: 16px; }
.picker { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; }
.picker::-webkit-scrollbar { display: none; }
.picker .app-tile { flex: 0 0 74px; }
.picker .app-tile .ic { width: 54px; height: 54px; border-radius: 16px; }
.picker.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); max-height: 260px; overflow-y: auto; margin-top: 10px; }
.selected-app { display: flex; align-items: center; gap: 12px; background: var(--soft); border-radius: var(--r); padding: 12px; margin-bottom: 16px; }
.selected-app .ic { width: 46px; height: 46px; border-radius: 14px; overflow: hidden; flex: 0 0 auto; }
.selected-app .ic img { width: 100%; height: 100%; object-fit: cover; }
.selected-app .t { flex: 1; min-width: 0; }
.selected-app .t b { display: block; }
.selected-app .t small { color: var(--ink-2); }
.copy-btn { background: var(--p1); color: #fff; font-weight: 700; border-radius: 10px; padding: 8px 14px; font-size: var(--fs-sm); flex: 0 0 auto; }
.help ol { margin: 10px 0 0; padding-inline-start: 20px; display: grid; gap: 8px; color: var(--ink-2); }
.help h3 { font-size: var(--fs-md); font-weight: 800; }
.help p { margin: 14px 0 0; font-size: var(--fs-sm); }

/* ===== السحب ===== */
.mgroup + .mgroup { margin-top: 22px; }
.mg-title { font-weight: 800; font-size: var(--fs-md); margin: 0 2px 12px; }
.mg-title small { display: block; font-weight: 600; font-size: var(--fs-sm); color: var(--muted); }
.methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.method { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); padding: 12px; text-align: right; font-weight: 700; font-size: var(--fs-sm); min-height: 72px; transition: border-color .15s, background .15s; }
.method:hover { border-color: #cdbdf7; }
.method.sel { border-color: var(--p1); background: var(--soft); }
.method .mn { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.spd { font-size: var(--fs-xs); font-weight: 700; border-radius: 99px; padding: 0 8px; width: max-content; }
.spd.instant { background: var(--ok-soft); color: var(--ok); }
.spd.manual { background: var(--warn-soft); color: var(--warn); }
.mi { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; overflow: hidden; }
.mi.logo { background: #fff; border: 1px solid var(--line); padding: 5px; }
.mi.logo img { width: 100%; height: 100%; object-fit: contain; }
.mi.logo.full { padding: 0; border: 0; }
.mi.logo.full img { object-fit: cover; }
.mi.logo.crop img { object-fit: cover; object-position: left center; }
.mi.logo.zoom img { transform: scale(1.45); transform-origin: 50% 45%; }
.pay-chip .mi { flex-basis: 30px; width: 30px; height: 30px; border-radius: 9px; font-size: 10px; }
.pay-chip .mi.logo { padding: 3px; }

/* ===== السجل ===== */
.seg { display: inline-grid; grid-auto-flow: column; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin-bottom: 16px; }
.seg button { height: 40px; padding: 0 18px; border-radius: 10px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--grad); color: #fff; }
.list { display: grid; gap: 10px; }
.item { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.list.compact .item { border: 0; padding: 8px 0; border-radius: 0; background: none; }
.list.compact .item + .item { border-top: 1px solid var(--line); }
.item .ic { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 13px; overflow: hidden; }
.item .ic img { width: 100%; height: 100%; object-fit: cover; }
.item .mid { flex: 1; min-width: 0; }
.item .mid b { display: block; }
.item .mid small { color: var(--muted); font-size: var(--fs-xs); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .end { text-align: left; flex: 0 0 auto; }
.item .end b { display: block; direction: ltr; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 10px; border-radius: 99px; background: var(--soft); color: var(--p1); }
.pill.ok, .pill.paid { background: var(--ok-soft); color: var(--ok); }
.pill.pending, .pill.review { background: var(--warn-soft); color: var(--warn); }
.pill.rejected, .pill.failed, .pill.error { background: var(--err-soft); color: var(--err); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* ===== شريط الموبايل ===== */
.tabbar { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); width: calc(100% - 24px); max-width: 480px; background: #fff; border-radius: 22px; box-shadow: 0 14px 40px -12px rgba(27, 19, 64, .35); display: grid; grid-template-columns: repeat(4, 1fr); padding: 7px; z-index: 30; border: 1px solid var(--line); }
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 15px; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.tabbar button svg { width: 23px; height: 23px; }
.tabbar button.on { color: var(--p1); background: var(--soft); }

/* ===== النافذة المنبثقة ===== */
.sheet-bg { position: fixed; inset: 0; background: rgba(27, 19, 64, .45); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet-bg.open { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 100%); width: 100%; max-width: 520px; z-index: 41; background: var(--bg); border-radius: 26px 26px 0 0; padding: 12px 20px 28px; transition: transform .25s ease; max-height: 88vh; overflow-y: auto; }
.sheet.open { transform: translate(-50%, 0); }
.sheet .grab { width: 44px; height: 5px; border-radius: 99px; background: #d6d0ee; margin: 0 auto 14px; }
.sheet-x { display: none; position: absolute; top: 14px; left: 14px; width: 36px; height: 36px; border-radius: 10px; font-size: 22px; color: var(--muted); }
.sheet-x:hover { background: var(--line); }
.sheet-head { display: flex; align-items: center; gap: 14px; }
.sheet-head .ic { width: 64px; height: 64px; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); flex: 0 0 auto; }
.sheet-head .ic img { width: 100%; height: 100%; object-fit: cover; }
.sheet-head b { font-size: 20px; display: block; }
.badge-rate { display: inline-block; background: var(--ok-soft); color: var(--ok); font-weight: 700; font-size: var(--fs-xs); border-radius: 99px; padding: 2px 10px; }
.copy-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border: 2px dashed #d9cffb; border-radius: 14px; padding: 8px 8px 8px 14px; }
.copy-row code { font-family: inherit; font-size: 20px; font-weight: 800; direction: ltr; }
.how { white-space: pre-wrap; background: #fff; border-radius: 14px; padding: 14px; margin-top: 14px; font-size: var(--fs-sm); color: var(--ink-2); border: 1px solid var(--line); }
.success { text-align: center; padding: 6px 0; }
.success .check { width: 84px; height: 84px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; margin: 0 auto 12px; animation: pop .4s ease; }
.success .amt { font-size: 34px; font-weight: 800; color: var(--ok); direction: ltr; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 80% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
.toast { position: fixed; top: 16px; left: 50%; transform: translate(-50%, -90px); background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 18px; font-weight: 700; z-index: 60; transition: transform .25s; }
.toast.show { transform: translate(-50%, 0); }

/* ===== صفحات النصوص (الخصوصية والشروط) ===== */
.doc { max-width: 760px; margin: 0 auto; padding: 32px 16px 60px; }
.doc h1 { font-size: 28px; font-weight: 800; margin: 18px 0 4px; }
.doc h2 { font-size: 19px; margin-top: 28px; }
.doc p, .doc li { color: var(--ink-2); }

/* ================= الكمبيوتر ================= */
@media (min-width: 900px) {
  .hero { padding: 130px 0 120px; border-radius: 0 0 48px 48px; }
  .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
  .hero h1 { font-size: 46px; }
  .hero p { font-size: 18px; max-width: 560px; }
  .login-card { padding: 32px; }
  .marquee { margin-top: -54px; }
  .marquee img { width: 84px; height: 84px; border-radius: 22px; }
  .pub-section { padding-top: 56px; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 18px; }

  .app-header-in { height: 72px; gap: 28px; }
  .app-header .brand { display: inline-flex; }
  .top-nav { display: flex; gap: 4px; flex: 1; }
  .top-nav button { height: 40px; padding: 0 16px; border-radius: 12px; font-weight: 700; color: var(--ink-2); }
  .top-nav button:hover { background: var(--soft); }
  .top-nav button.on { background: var(--soft); color: var(--p1); }
  .user-box { flex: 0 0 auto; }
  .who { max-width: 170px; }
  .bal-chip { display: flex; flex-direction: column; align-items: flex-end; order: -1; padding-inline-end: 14px; margin-inline-end: 4px; border-inline-end: 1px solid var(--line); line-height: 1.3; }
  .bal-chip span { font-size: var(--fs-xs); color: var(--muted); }
  .bal-chip b { direction: ltr; font-size: var(--fs-md); }
  .tabbar { display: none !important; }
  .app-main { padding-top: 32px; padding-bottom: 60px; }

  .page-head h1 { font-size: 28px; }
  .home-top { grid-template-columns: 1.1fr .9fr; align-items: stretch; }
  .balance-card { padding: 32px; display: flex; flex-direction: column; justify-content: center; }
  .balance-card .amt { font-size: 52px; }
  .balance-card .row { max-width: 420px; }
  .recent { display: block; }
  .apps { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 18px 12px; }
  .app-tile .ic { width: 72px; height: 72px; border-radius: 20px; }

  .split { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .split-side.sticky { position: sticky; top: 96px; }
  .picker { flex-wrap: wrap; overflow: visible; }
  .picker.grid { max-height: 300px; overflow-y: auto; }
  .methods { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .item { padding: 14px 18px; }

  .sheet { top: 50%; bottom: auto; transform: translate(-50%, -46%) scale(.97); opacity: 0; pointer-events: none; border-radius: var(--r-lg); padding: 28px; transition: transform .2s ease, opacity .2s; max-height: 86vh; }
  .sheet.open { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
  .sheet .grab { display: none; }
  .sheet-x { display: block; }
}

/* الحقول المطلوبة لطريقة السحب بعد خانة المبلغ */
#wFields .field:first-child { margin-top: 16px; }

/* ===== تأكيد راتب على الموبايل: خطوتين (اختيار التطبيق ← البيانات) ===== */
.back-link { display: none; }
@media (max-width: 899px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  [data-view=claim] .picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 6px; overflow: visible; padding: 4px 0 0; }
  [data-view=claim] .picker .app-tile { flex: none; }
  [data-view=claim].step1 #claimForm, [data-view=claim].step1 .split-side { display: none; }
  [data-view=claim].step2 .pick-card { display: none; }
  [data-view=claim].step2 .back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--p1); font-weight: 700; font-size: var(--fs-sm); margin-bottom: 12px; }
}
