/* MCpos Delivery — هوية CM SYSTEMS: أسود فحمي + ذهبي، خلفية فاتحة للعمل اليومي. CSP صارم: لا أنماط مضمّنة. */
@font-face { font-family: Tajawal; src: url("/fonts/Tajawal-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Tajawal; src: url("/fonts/Tajawal-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --ink: #0a0a0c; --ink2: #1b1b1f; --gold: #d4af37; --gold2: #f5d060; --gold-ink: #1a1400;
  --bg: #f4f4f2; --card: #fff; --line: #e4e2dc; --muted: #6b6a66; --text: #18181b;
  --ok: #15803d; --ok-bg: #e7f6ec; --warn: #a16207; --warn-bg: #fdf3d7; --bad: #b91c1c; --bad-bg: #fde8e8; --info: #1d4ed8; --info-bg: #e6eefc;
  --r: 14px; --r2: 10px; --pad: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Tajawal, system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.55; min-height: 100vh; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── الرأس والتبويبات ── */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px var(--pad); background: var(--ink); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.05rem; }
.brand img { border-radius: 10px; }
.brand b { color: #fff; } .brand i { font-style: normal; color: var(--gold); font-weight: 700; }
.top-status { font-size: .8rem; }
.main { max-width: 640px; margin: 0 auto; padding: var(--pad) var(--pad) calc(96px + var(--safe-b)); outline: none; }
.main.bare { padding-bottom: 32px; }
.tabs { position: fixed; inset-inline: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--ink); padding: 6px 6px calc(6px + var(--safe-b)); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; color: #a8a6a0; text-decoration: none; font-size: .78rem; border-radius: 10px; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: var(--gold); background: rgba(212, 175, 55, .12); }

/* ── عناصر عامة ── */
h1 { font-size: 1.35rem; margin: 4px 0 12px; }
h2 { font-size: 1.08rem; margin: 0 0 10px; }
h3 { font-size: .95rem; margin: 0 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: var(--pad); margin-bottom: 12px; }
.card.flat { box-shadow: none; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; text-decoration: none; font-weight: 700; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.primary:active { background: var(--gold2); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.danger { color: var(--bad); border-color: #f1c4c4; }
.btn.wa { background: #1fa855; border-color: #1fa855; color: #fff; }
.btn.block { display: flex; width: 100%; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: .88rem; border-radius: 10px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--info); text-decoration: underline; cursor: pointer; }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: .85rem; font-weight: 700; margin-bottom: 4px; }
.field > span em { color: var(--bad); font-style: normal; }
.field small { display: block; color: var(--muted); font-size: .78rem; margin-top: 3px; }
.input, select.input, textarea.input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cfccc4; border-radius: 10px; background: #fff; }
.input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.input[dir="ltr"] { text-align: left; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
@media (max-width: 420px) { .grid2 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--ink); flex-shrink: 0; }

.alert { padding: 12px 14px; border-radius: var(--r2); margin-bottom: 12px; font-size: .92rem; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.info { background: var(--info-bg); color: var(--info); }
.alert b { display: block; margin-bottom: 2px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.pending { background: var(--warn-bg); color: var(--warn); }
.pill.approved { background: var(--info-bg); color: var(--info); }
.pill.active { background: var(--ok-bg); color: var(--ok); }
.pill.suspended, .pill.rejected { background: var(--bad-bg); color: var(--bad); }
.top .pill { background: rgba(255, 255, 255, .1); }
.top .pill.active { color: #7ee2a0; } .top .pill.pending { color: var(--gold2); } .top .pill.approved { color: #9cc0ff; } .top .pill.suspended, .top .pill.rejected { color: #ff9b9b; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: #efeee9; font-size: .85rem; }
.chip button { border: 0; background: none; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 2px; color: var(--muted); }

/* ── الترحيب ── */
.hero { min-height: calc(100vh - 32px); display: flex; flex-direction: column; justify-content: center; text-align: center; gap: 14px; }
.hero-logo { width: 132px; height: 132px; margin: 0 auto; border-radius: 30px; box-shadow: 0 14px 40px rgba(0, 0, 0, .25); }
.hero h1 { font-size: 1.7rem; margin: 6px 0 0; }
.hero h1 i { font-style: normal; color: #9a7b14; }
.hero .lead { color: var(--muted); max-width: 30ch; margin: 0 auto 8px; }
.hero .btns { display: grid; gap: 10px; margin-top: 8px; }
.points { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 6px; text-align: start; font-size: .9rem; color: #3f3e3a; }
.points li::before { content: "✓"; color: #9a7b14; font-weight: 700; margin-inline-end: 8px; }

/* ── المعالج (التسجيل) ── */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.steps li { text-align: center; font-size: .72rem; color: var(--muted); }
.steps li::before { content: attr(data-n); display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin: 0 auto 4px; border-radius: 50%; background: #e7e5df; font-weight: 700; color: var(--muted); }
.steps li.on { color: var(--text); font-weight: 700; }
.steps li.on::before { background: var(--ink); color: var(--gold); }
.steps li.done::before { content: "✓"; background: var(--gold); color: var(--gold-ink); }
.wizard-nav { display: flex; gap: 10px; margin-top: 6px; }
.wizard-nav .btn { flex: 1; }
.vtypes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.vtype { position: relative; }
.vtype input { position: absolute; opacity: 0; }
.vtype span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px; padding: 8px; border: 1px solid #cfccc4; border-radius: 12px; background: #fff; font-size: .9rem; cursor: pointer; }
.vtype input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--gold); font-weight: 700; }
.vtype input:focus-visible + span { outline: 2px solid var(--gold); }
.terms ol { padding-inline-start: 20px; margin: 0; }
.terms li { margin-bottom: 8px; font-size: .9rem; }
.terms li b { display: block; }

/* ── التحقق عبر واتساب ── */
.code { direction: ltr; font: 700 2rem/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .12em; text-align: center; background: var(--ink); color: var(--gold); border-radius: 12px; padding: 14px; margin: 8px 0 12px; user-select: all; }
.wait { display: flex; align-items: center; gap: 10px; justify-content: center; color: var(--muted); font-size: .9rem; margin-top: 12px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #e2dfd6; border-top-color: var(--gold); animation: sp 1s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* ── الرئيسية ── */
.avail { display: flex; align-items: center; gap: 14px; padding: 18px var(--pad); border-radius: var(--r); background: var(--ink); color: #fff; margin-bottom: 12px; }
.avail.on { background: linear-gradient(135deg, #0f3d22, #14532d); }
.avail .grow b { display: block; font-size: 1.15rem; }
.avail .grow small { color: #c9c7c0; }
.switch { position: relative; width: 70px; height: 40px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #3f3e3a; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 4px; inset-inline-start: 4px; width: 32px; height: 32px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + i { background: #22c55e; }
.switch input:checked + i::after { transform: translateX(-30px); }
html[dir="ltr"] .switch input:checked + i::after { transform: translateX(30px); }
.switch input:focus-visible + i { outline: 3px solid var(--gold); outline-offset: 2px; }
.switch input[disabled] + i { opacity: .5; }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .9rem; }
.checklist li { display: flex; gap: 8px; align-items: flex-start; }
.checklist li::before { content: "✓"; flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; background: var(--ok-bg); color: var(--ok); }
.checklist li.no::before { content: "!"; background: var(--warn-bg); color: var(--warn); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat b { display: block; font-size: 1.3rem; }
.stat span { color: var(--muted); font-size: .8rem; }
.empty { text-align: center; color: var(--muted); padding: 18px 8px; font-size: .9rem; }
.gps { display: flex; gap: 8px; align-items: center; font-size: .85rem; color: #c9c7c0; margin-top: 4px; }
.gps .dot { width: 9px; height: 9px; border-radius: 50%; background: #9ca3af; }
.gps .dot.ok { background: #4ade80; } .gps .dot.bad { background: #f87171; }

/* ── الأسعار ── */
.prow { display: grid; grid-template-columns: 1fr 110px 40px; gap: 8px; align-items: end; margin-bottom: 8px; }
.prow .field { margin: 0; }
.prow .x { min-height: 46px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-size: 1.1rem; color: var(--muted); }
.money { position: relative; }
.money .input { padding-inline-end: 38px; }
.money::after { content: "دج"; position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); font-size: .8rem; color: var(--muted); pointer-events: none; }
.km::after { content: "كم"; }
.sim { background: #faf7ec; border: 1px dashed #d9c78a; border-radius: 12px; padding: 12px; }
.sim-out { font-size: 1.2rem; font-weight: 700; margin-top: 6px; }
.savebar { position: sticky; bottom: calc(72px + var(--safe-b)); padding: 10px 0 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }

/* ── حسابي ── */
.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: #e7e5df; display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.vphoto { width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; background: #e7e5df; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .9rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
details.card > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.card > summary::after { content: "▾"; color: var(--muted); }
details.card[open] > summary { margin-bottom: 12px; }
details.card[open] > summary::after { content: "▴"; }

.toast { position: fixed; inset-inline: 12px; bottom: calc(84px + var(--safe-b)); z-index: 50; max-width: 520px; margin: 0 auto; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: .92rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.toast.bad { background: #7f1d1d; }
.foot { text-align: center; color: var(--muted); font-size: .78rem; margin-top: 18px; }
.foot b { color: var(--text); }
.vtypes { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
