/* 5edmh | خدمة — shared visual system for the customer app and Partner Portal.
 *
 * World: the Kuwait Towers. Gulf-navy ink, daylight ground, and the Towers' glazed steel discs
 * ("sequins") in three glazes — blue, green, silver — as the product's mark: every trade wears a
 * disc, the hero carries a sphere of them. Light ground because the scene is a phone held in Gulf
 * daylight. Logical properties only (RTL is the default reading direction).
 */

@font-face {
  font-family: "Readex Pro";
  src: url("/fonts/readex-pro.woff2") format("woff2");
  font-weight: 200 700;
  font-display: swap;
}

:root {
  --ink: #0b2440;
  --ink-2: #3a4e66;
  --muted: #4f6074;
  --ground: #f2f5f8;
  --surface: #ffffff;
  --surface-2: #e9eff4;
  --line: #d6dfe7;
  --navy: #0a2342;
  --navy-2: #12325a;

  --glaze-blue: #0052e0;
  --glaze-blue-deep: #003fb0;
  --glaze-green: #00a650;
  --glaze-silver: #8795a3;
  --glaze-ink: #ffffff;

  --ok: #0e7a62;
  --ok-bg: #e3f3ee;
  --warn: #7a4d00;
  --warn-bg: #fff3d6;
  --danger: #b42318;
  --danger-bg: #fdeceb;

  --r-s: 10px;
  --r-m: 14px;
  --r-l: 22px;
  --shadow-1: 0 1px 2px rgba(11, 36, 64, .06), 0 2px 8px rgba(11, 36, 64, .05);
  --shadow-2: 0 10px 30px rgba(11, 36, 64, .18), 0 2px 6px rgba(11, 36, 64, .08);

  --fs-xs: .8125rem;
  --fs-s: .875rem;
  --fs-m: 1rem;
  --fs-l: 1.1875rem;
  --fs-xl: 1.4375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.125rem;

  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
  accent-color: var(--glaze-blue);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 var(--fs-m)/1.6 "Readex Pro", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  caret-color: var(--glaze-blue);
  font-variant-numeric: tabular-nums;
}
::selection { background: rgba(23, 87, 166, .18); color: var(--ink); }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
h1, h2, h3 { line-height: 1.25; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: var(--glaze-blue); text-underline-offset: 3px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid rgba(23, 87, 166, .45); outline-offset: 2px; border-radius: 6px; }

/* ---------- Controls ---------------------------------------------------- */
button, .btn {
  font: inherit; font-weight: 500; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s);
  min-height: 44px; padding: 10px 16px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease);
}
button:hover:not(:disabled), .btn:hover { border-color: #b8c5d2; background: #f8fafc; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: not-allowed; }
button.primary, .btn.primary {
  background: var(--glaze-blue); color: var(--glaze-ink); border-color: transparent; font-weight: 600;
}
button.primary:hover:not(:disabled) { background: var(--glaze-blue-deep); }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; }
button.ghost:hover:not(:disabled), .btn.ghost:hover { background: var(--surface-2); border-color: transparent; }
button.block { width: 100%; }
button.danger { color: var(--danger); border-color: #f1c3bf; }

label, .label { display: block; font-size: var(--fs-s); font-weight: 500; color: var(--ink-2); margin-block: 16px 6px; }
input, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-s); min-height: 48px; padding: 10px 14px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
input::placeholder { color: #5b6a7c; }
/* A phone number or code is always LTR, even inside an Arabic RTL page. */
input[type="tel"], input[inputmode="numeric"] { direction: ltr; text-align: start; }
input.otp { text-align: center; }
.tel { position: relative; direction: ltr; }
.tel .cc { position: absolute; inset-inline-start: 14px; inset-block-start: 50%; translate: 0 -50%; color: var(--ink-2); font-weight: 500; pointer-events: none; }
.tel input { padding-inline-start: 62px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
input:focus, select:focus { outline: none; border-color: var(--glaze-blue); box-shadow: 0 0 0 4px rgba(23, 87, 166, .14); }
input.otp { font-size: var(--fs-xl); letter-spacing: .35em; text-align: center; font-weight: 600; }

.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .icon.flip { transform: scaleX(-1); }

/* ---------- Test strip -------------------------------------------------- */
.test-strip {
  background: var(--warn-bg); color: var(--warn); font-size: var(--fs-xs); font-weight: 500;
  padding: 7px 16px; text-align: center; border-block-end: 1px solid #f2dca6;
}

/* ---------- Top bar ----------------------------------------------------- */
.topbar {
  position: sticky; inset-block-start: 0; z-index: 20;
  display: flex; align-items: center; gap: 6px;
  padding: 10px clamp(12px, 4vw, 28px);
  background: var(--ground);
  border-block-end: 1px solid transparent;
}
.topbar.scrolled { border-block-end-color: var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; cursor: pointer; background: none; border: 0; padding: 0; min-height: 44px; }
.brand-mark { width: 42px; height: 42px; flex: none; object-fit: contain; }
.topbar.partner .brand-mark { background: #fff; border-radius: 12px; padding: 3px; }
.brand-name { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name b { font-size: var(--fs-l); font-weight: 700; letter-spacing: -.01em; }
.brand-name small { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; letter-spacing: .04em; }
.spacer { flex: 1; }
.topbar .btn, .topbar button { padding-inline: 12px; font-size: var(--fs-s); }
.lang { font-weight: 600; }

/* ---------- Layout ------------------------------------------------------ */
.wrap { max-width: 1040px; margin-inline: auto; padding-inline: clamp(12px, 4vw, 28px); }

/* ---------- Toast ------------------------------------------------------- */
.toast {
  position: fixed; inset-block-end: 20px; inset-inline: 0; width: fit-content; max-width: min(92vw, 520px);
  margin-inline: auto; z-index: 60; background: var(--navy); color: #fff; font-size: var(--fs-s);
  padding: 12px 18px; border-radius: var(--r-m); box-shadow: var(--shadow-2);
  opacity: 0; transform: translateY(8px); transition: opacity .2s var(--ease), transform .2s var(--ease); pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }

/* ---------- Status pills ------------------------------------------------ */
.pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: var(--fs-xs); font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .75; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--danger-bg); color: var(--danger); }
.pill.live { background: #e4eefa; color: var(--glaze-blue); }

/* ---------- Discs (the Towers' sequins) --------------------------------- */
.disc {
  --g: var(--glaze-blue);
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: var(--fs-l);
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .55) 0 12%, rgba(255, 255, 255, 0) 38%),
    radial-gradient(circle at 50% 50%, var(--g) 0 62%, color-mix(in srgb, var(--g) 70%, #000) 100%);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12), 0 1px 2px rgba(11, 36, 64, .12);
}
.disc.g1 { --g: var(--glaze-blue); }
.disc.g2 { --g: var(--glaze-green); }
.disc.g3 { --g: var(--glaze-silver); }
.disc.sm { width: 36px; height: 36px; font-size: var(--fs-s); }
