/* Customer page. Mobile first, Arabic RTL, light and dark. No web fonts: fast on slow connections. */
:root {
  --bg: #f3f1ec;
  --card: #ffffff;
  --ink: #17201b;
  --muted: #5b665f;
  --line: #e2ded5;
  --field: #faf9f6;
  --accent: #0e6b4f;
  --accent-ink: #ffffff;
  --accent-soft: #e2f1ea;
  --warn: #7f4d00;
  --warn-soft: #fff3da;
  --info: #1d4f7a;
  --info-soft: #e6f0f9;
  --bad: #a3271f;
  --wa: #128c4a;
  --shadow: 0 1px 2px rgb(20 30 25 / 6%), 0 4px 16px rgb(20 30 25 / 5%);
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1412;
    --card: #171d1a;
    --ink: #e8ece9;
    --muted: #9ba69f;
    --line: #29312d;
    --field: #121815;
    --accent: #3cc08e;
    --accent-ink: #05140e;
    --accent-soft: #143024;
    --warn: #f2bd62;
    --warn-soft: #2c2412;
    --info: #8cc1ee;
    --info-soft: #14222f;
    --bad: #ff8f85;
    --wa: #3fd27f;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 system-ui, "Segoe UI", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
}
[hidden] { display: none !important; }
button, input, a { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.mono { font-family: ui-monospace, "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace; letter-spacing: .02em; }
svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- layout ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 520px; margin: 0 auto; padding: 14px 16px 0;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; }
.top-link {
  min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); font-weight: 600;
}
main { max-width: 520px; margin: 0 auto; padding: 8px 16px 48px; }
h1 { font-size: 1.45rem; line-height: 1.3; margin: 14px 0 4px; }
h2 { font-size: 1.1rem; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px; box-shadow: var(--shadow); margin-top: 14px;
}
.view > .card:first-child { margin-top: 8px; }

/* ---------- form ---------- */
.field { margin-top: 16px; }
.field:first-child { margin-top: 0; }
label, legend { display: block; font-weight: 700; margin-bottom: 6px; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.label-row label { margin-bottom: 6px; }
input {
  width: 100%; min-height: 52px; padding: 10px 14px; font-size: 1.1rem;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--field);
}
input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input[dir="ltr"] { text-align: left; }
input.invalid { border-color: var(--bad); }
input.valid { border-color: var(--accent); }
.hint { color: var(--muted); font-size: .9rem; margin: 6px 0 0; }
.money-input { position: relative; }
.money-input input { padding-left: 38px; }
.money-input span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.label { display: block; font-weight: 700; margin-bottom: 6px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 64px; padding: 8px; border-radius: 14px; border: 2px solid var(--line); background: var(--field);
}
.seg-btn b { font-size: 1.15rem; }
.seg-btn small { color: var(--muted); font-size: .8rem; }
.seg-btn[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.seg-btn[aria-checked="true"] b { color: var(--accent); }
.seg-btn:disabled { opacity: .45; cursor: not-allowed; }
.phone-input { display: flex; align-items: stretch; }
.phone-input .prefix {
  display: flex; align-items: center; padding: 0 12px; border: 1.5px solid var(--line); border-right: 0;
  border-radius: 12px 0 0 12px; background: var(--card); color: var(--muted); font-weight: 700; font-size: 1.1rem;
}
.phone-input .prefix + input { border-radius: 0 12px 12px 0; }
.phone-input input { text-align: left; }
.group { border: 0; padding: 0; margin: 22px 0 0; }
.group legend { font-size: 1.05rem; padding: 0; margin-bottom: 4px; }
.counter {
  font: 600 .9rem/1 ui-monospace, Menlo, Consolas, monospace; direction: ltr;
  padding: 4px 8px; border-radius: 999px; background: var(--field); color: var(--muted);
}
.counter.ok { background: var(--accent-soft); color: var(--accent); }
.counter.over { color: var(--bad); }
.tools { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; margin-top: 8px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chip {
  flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 0;
  min-height: 48px; padding: 6px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--field); text-align: start; max-width: 70vw;
}
.chip b { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.chip small { color: var(--muted); direction: ltr; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; }
.breakdown { margin: 20px 0 0; padding: 8px 14px; border-radius: 12px; background: var(--field); }
.breakdown > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 4px 0; }
.breakdown dt { color: var(--muted); }
.breakdown dd { margin: 0; font-weight: 700; }
.breakdown .get { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 8px; }
.breakdown .get dt { color: var(--ink); font-weight: 700; }
.breakdown .get dd { font-size: 1.3rem; color: var(--accent); }
.err { color: var(--bad); min-height: 1.6em; margin: 10px 0 0; }
.err:empty { min-height: 0; margin: 0; }
.turnstile { margin-top: 14px; min-height: 65px; }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 54px; margin-top: 16px; padding: 12px 16px;
  border: 0; border-radius: 14px; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 1.08rem; text-decoration: none; text-align: center;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-soft {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 8px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--field); font-weight: 600; text-decoration: none;
}
.btn-ghost {
  display: block; width: 100%; min-height: 50px; margin-top: 8px; border: 0;
  background: transparent; color: var(--accent); font-weight: 700;
}
.link { border: 0; background: none; color: var(--accent); font-weight: 600; min-height: 44px; padding: 0 4px; }

/* ---------- notices ---------- */
.notice { display: block; padding: 12px 14px; border-radius: 12px; margin: 12px 0 0; background: var(--info-soft); color: var(--info); }
.notice p { margin: 0; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.info { background: var(--info-soft); color: var(--info); }
.notice .btn-soft { margin-top: 10px; width: 100%; background: var(--card); }
.resume { text-decoration: none; font-weight: 600; }
.wa { color: var(--wa); }

/* ---------- confirm ---------- */
.confirm h1 { margin-top: 0; }
.confirm-text { font-size: 1.1rem; margin: 6px 0 12px; }
.rows { margin: 0; }
.rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.rows > div:last-child { border-bottom: 0; }
.rows dt { color: var(--muted); }
.rows dd { margin: 0; font-weight: 700; text-align: end; overflow-wrap: anywhere; }
.note { color: var(--warn); background: var(--warn-soft); padding: 10px 12px; border-radius: 12px; font-size: .95rem; margin: 14px 0 0; }

/* ---------- pay ---------- */
.pay { text-align: center; }
.pay-label { margin: 0; color: var(--muted); font-weight: 600; }
.amount-big {
  display: block; width: 100%; border: 0; background: none; padding: 4px 0;
  font-size: 3rem; font-weight: 800; line-height: 1.15; letter-spacing: -.01em;
}
.amount-big::after, .copy-chip::after, .ussd::after {
  content: "⧉"; font-size: .45em; color: var(--muted); margin-inline-start: 8px; vertical-align: middle; font-weight: 400;
}
.pay-sub { margin: 2px 0 0; color: var(--muted); }
.copyline { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; }
.copy-chip {
  min-height: 44px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--field); font: 700 1.2rem/1 ui-monospace, Menlo, Consolas, monospace;
}
.dial { margin-top: 18px; font-size: 1.15rem; }
.ussd {
  display: block; width: 100%; margin-top: 10px; padding: 10px; border-radius: 12px;
  border: 1.5px dashed var(--line); background: var(--field);
  font: 700 1.25rem/1.3 ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere;
}
.alt { color: var(--muted); font-size: .92rem; margin: 10px 0 0; }
.howto { text-align: start; margin: 16px 0 0; padding-inline-start: 22px; }
.howto li { margin-bottom: 6px; }
.countdown { margin: 12px 0 0; font-weight: 600; color: var(--muted); }

/* ---------- tracker ---------- */
.tracker { list-style: none; margin: 0; padding: 0; }
.tracker li { position: relative; display: flex; gap: 14px; padding-bottom: 18px; color: var(--muted); }
.tracker li:last-child { padding-bottom: 0; }
.tracker li::before {
  content: ""; position: absolute; top: 24px; bottom: 0; right: 11px; width: 2px; background: var(--line);
}
.tracker li:last-child::before { display: none; }
.tracker .dot {
  position: relative; z-index: 1; flex: none; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--card);
}
.tracker b { display: block; font-weight: 600; }
.tracker time { display: block; font-size: .85rem; min-height: 1em; }
.tracker li.done { color: var(--ink); }
.tracker li.done::before { background: var(--accent); }
.tracker li.done .dot { background: var(--accent); border-color: var(--accent); }
.tracker li.done .dot::after {
  content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px;
  border: solid var(--accent-ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.tracker li.active { color: var(--ink); }
.tracker li.active b { font-weight: 800; }
.tracker li.active .dot { border-color: var(--accent); }
.tracker li.active .dot::after {
  content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent);
  animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { transform: scale(.55); opacity: .55; } 50% { transform: scale(1); opacity: 1; } }

/* ---------- receipt ---------- */
.receipt { border-top: 4px solid var(--accent); }
.receipt-head { display: flex; gap: 12px; align-items: center; }
.receipt-head p { margin: 0; color: var(--muted); font-size: .9rem; direction: ltr; text-align: right; }
.check {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 1.2rem;
}
.receipt-amount { font-size: 2.2rem; font-weight: 800; text-align: center; margin: 12px 0 4px; }
.receipt .btn-soft { width: 100%; margin-top: 12px; }

.order-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; color: var(--muted); font-size: .95rem; }

/* ---------- my orders ---------- */
.mine ul { list-style: none; margin: 0; padding: 0; }
.mine li + li { border-top: 1px solid var(--line); }
.mine a { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 56px; padding: 8px 0; text-decoration: none; }
.mine .who { min-width: 0; }
.mine .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mine .who small { color: var(--muted); direction: ltr; display: block; text-align: right; }
.pill { flex: none; font-size: .85rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--field); color: var(--muted); }
.pill.ok { background: var(--accent-soft); color: var(--accent); }
.pill.wait { background: var(--info-soft); color: var(--info); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600;
  pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.offscreen { position: fixed; top: -1000px; opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media (min-width: 560px) {
  main { padding-top: 16px; }
  .card { padding: 22px; }
}

/* ---------- payment-method logos: small badges, never the main identity ---------- */
.logo-badge {
  height: 22px; width: auto; flex: none; padding: 2px 5px; border-radius: 6px;
  background: #fff; box-shadow: 0 0 0 1px var(--line);
}
.seg-btn .logo-badge { margin-bottom: 2px; }
.foot { max-width: 520px; margin: 0 auto; padding: 0 16px 32px; color: var(--muted); font-size: .85rem; text-align: center; }
.methods { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px; margin-bottom: 8px; }
.methods-title { font-weight: 700; color: var(--ink); }
.methods-to::before { content: "← "; }
.method { display: inline-flex; align-items: center; gap: 6px; }
.method .logo-badge { height: 18px; padding: 1px 4px; }
.disclaimer { margin: 0; }

/* ---------- version 2: offices, promotions, news, staging ---------- */
select {
  width: 100%; min-height: 52px; padding: 10px 14px; font: inherit; font-size: 1.05rem; color: inherit;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--field);
}
select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
select.invalid { border-color: var(--bad); }
.avail { font-weight: 600; color: var(--accent); }
.warn-text { color: var(--warn) !important; }
.notice.promo { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.env-banner { margin: 0; padding: 8px 16px; text-align: center; background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.news { margin-top: 18px; }
.news-card h2 { margin-top: 0; }
.news-card p { margin: 6px 0 0; color: var(--muted); white-space: pre-line; }
.news-card img { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; margin-bottom: 12px; }
.news-card .btn-soft { margin-top: 12px; width: 100%; }
.receipt-img { display: block; margin-top: 12px; }
.receipt-img img { display: block; width: 100%; max-height: 420px; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); background: var(--field); }
