/* Customer web portal (/me): navy and gold like the app, with a light option. */
:root {
  --bg: #001030; --bar: #000c28; --surface: #0b1f4d; --accent: #f3c63c; --on-accent: #000c28;
  --text: #fbf3df; --muted: #a9b6d6; --line: #1b2f63; --good: #6ee7a0; --bad: #ff8a8a;
  --gold-grad: linear-gradient(135deg, #f8e27a, #f3c63c 40%, #9c7416 70%, #f3c63c);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f7fc; --bar: #ffffff; --surface: #ffffff; --accent: #0b2a66; --on-accent: #ffffff;
  --text: #101a33; --muted: #5b6786; --line: #d5ddee; --good: #0e8f4f; --bad: #c62828;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --bg: #f4f7fc; --bar: #ffffff; --surface: #ffffff; --accent: #0b2a66; --on-accent: #ffffff;
    --text: #101a33; --muted: #5b6786; --line: #d5ddee; --good: #0e8f4f; --bad: #c62828; color-scheme: light;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
  font: 16px/1.55 "Segoe UI", "Noto Sans Arabic", Tahoma, system-ui, -apple-system, sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
button, input { font: inherit; color: inherit; }
a { color: var(--accent); }
.boot { text-align: center; color: var(--muted); padding: 40px; }
.muted { color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 560px; margin: 0 auto; padding: 16px; }
.center { text-align: center; }
h1 { font-size: 24px; color: var(--accent); margin: 8px 0; }
h2 { font-size: 17px; color: var(--accent); margin: 24px 0 8px; }

/* buttons and fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; padding: 10px 18px;
  border-radius: 12px; border: 0; cursor: pointer; font-weight: 700; background: var(--accent); color: var(--on-accent);
  transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.07); } .btn:active { transform: scale(.985); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn.quiet { background: transparent; color: var(--muted); font-weight: 600; min-height: 40px; }
.btn.danger { background: transparent; color: var(--bad); border: 1.5px solid var(--bad); }
.btn.sm { width: auto; min-height: 38px; padding: 6px 14px; font-size: 14px; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.input {
  width: 100%; min-height: 50px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--text);
}
.input:focus { border-color: var(--accent); outline: none; }
.input[readonly] { opacity: .75; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.note { color: var(--accent); text-align: center; font-weight: 600; margin: 0 0 12px; }
.err { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); padding: 10px 14px; border-radius: 10px; margin: 0 0 12px; font-weight: 600; }
.seg { display: flex; gap: 8px; margin: 14px 0; }

/* sign in */
.logo { display: block; margin: 16px auto 4px; width: 110px; height: 110px; border-radius: 50%; border: 2px solid #f3c63c; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.topline { display: flex; justify-content: flex-end; padding: 8px 12px 0; }

/* top bar + tabs */
.bar { position: sticky; top: 0; z-index: 5; background: var(--bar); border-bottom: 1px solid var(--line); }
.bar .in { max-width: 560px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 10px; }
.bar img { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #f3c63c; }
.bar b { color: var(--accent); flex: 1; }
.tabs {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 6; display: flex; background: var(--bar); border-top: 1px solid var(--line);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
}
.tabs button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border: 0; background: none;
  color: var(--muted); font-size: 11.5px; cursor: pointer; border-radius: 10px;
}
.tabs button svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabs button[aria-current="page"] { color: var(--on-accent); background: var(--accent); }
@media (min-width: 760px) {
  body { padding-bottom: 24px; }
  .tabs { position: sticky; top: 51px; bottom: auto; justify-content: center; border-top: 0; border-bottom: 1px solid var(--line); padding: 4px; }
  .tabs button { flex: 0 0 110px; flex-direction: row; justify-content: center; gap: 8px; font-size: 14px; }
}

/* membership card (navy and gold in both themes) */
.mcard {
  border-radius: 24px; padding: 20px; color: #fbf3df; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #000c28, #0b2a66 55%, #000c28); border: 1.6px solid transparent;
  background-clip: padding-box; box-shadow: 0 0 0 1.6px #d8a92b, 0 10px 30px rgba(0,0,0,.3);
}
.mcard .brand { display: flex; align-items: center; gap: 12px; }
.mcard .brand img { width: 56px; height: 56px; border-radius: 50%; border: 1.5px solid #f3c63c; }
.mcard .brand b { font: 700 24px Georgia, serif; color: #f3c63c; display: block; }
.mcard .brand span { font-size: 10px; letter-spacing: 2px; }
.mcard hr { border: 0; height: 1px; background: var(--gold-grad); margin: 14px 0; }
.mcard .nm { font-size: 19px; font-weight: 600; }
.mcard .lb { color: #a9b6d6; font-size: 13px; }
.mcard .pts { font: 700 52px Georgia, serif; color: #f3c63c; line-height: 1.1; }
.mcard .pts small { font: 400 17px "Segoe UI", sans-serif; color: #fbf3df; }
.mcard .ft { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 13px; }
.mcard .ft i { font-style: normal; font-size: 10px; letter-spacing: 3px; color: #f8e27a; }

/* sections */
.box { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; }
.voucher { background: #f3c63c; color: #000c28; border-radius: 16px; padding: 16px; text-align: center; margin-top: 12px; }
.voucher .code { font: 800 32px "Segoe UI", sans-serif; letter-spacing: 2px; direction: ltr; }
.gift { display: flex; align-items: center; gap: 12px; }
.gift .g { flex: 1; } .gift .g small { display: block; color: var(--muted); }
.hist { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hist:last-child { border-bottom: 0; }
.hist small { color: var(--muted); display: block; }
.pos { color: var(--good); font-weight: 700; } .neg { color: var(--bad); font-weight: 700; }
.qrbox { background: #fff; border-radius: 22px; padding: 16px; margin: 0 auto 12px; width: min(290px, 100%); text-align: center; color: #3b4a6b; }
.qrbox svg { width: 100%; height: auto; display: block; }
.qrbox b { display: block; color: #000c28; font-size: 18px; margin-top: 6px; direction: ltr; }
.kv { padding: 8px 0; border-bottom: 1px solid var(--line); } .kv small { display: block; color: var(--muted); }
.sw { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }
.items { margin: 8px 0 0; padding: 0; list-style: none; }
.items li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 14px; }
.items small { color: var(--muted); display: block; }
.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 10px; border-radius: 99px; }
.chip.good { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.chip.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
button.head { display: flex; width: 100%; justify-content: space-between; gap: 10px; background: none; border: 0; padding: 0; text-align: start; cursor: pointer; }

/* dialog + toast */
.veil { position: fixed; inset: 0; z-index: 20; background: rgba(0,8,24,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dlg { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; max-width: 420px; width: 100%; }
.dlg h3 { margin: 0 0 8px; color: var(--accent); } .dlg .row { margin-top: 16px; }
.toast { position: fixed; inset-inline: 16px; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); z-index: 30; margin: 0 auto; max-width: 420px; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: 12px; font-weight: 700; text-align: center; }
@media (prefers-reduced-motion: no-preference) { .wrap, .dlg { animation: rise .25s ease-out both; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
