/* NARI UI — Approved Reference v1.0 implementation. Tokens from /brand/tokens.css (v3). */
@import url("/brand/fonts/fonts.css");

:root {
  --background: #FFFFFF; --surface: #FFFFFF; --surface-2: #F5F5F6;
  --primary: #B8323D; --primary-dark: #8E122B; --primary-text: #B8323D; --primary-soft: #FBE9EB;
  --text: #17191E; --text-2: #555963; --border: #E4E5E8; --button-text: #FFFFFF;
  --map-land: #F3F3F4; --map-road: #FFFFFF; --map-block: #E6E6E9;
  --shadow: 0 2px 10px rgba(23, 25, 30, .06);
  --font: "IBM Plex Sans Arabic", "Noto Sans Arabic", system-ui, sans-serif;
  --font-latin: "Manrope", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --r-card: 16px; --r-btn: 14px; --r-field: 14px; --action: 56px; --tap: 44px;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
[data-theme="dark"] {
  --background: #19191D; --surface: #242429; --surface-2: #2D2D33;
  --primary: #B8323D; --primary-dark: #8E122B; --primary-text: #F16B79; --primary-soft: #3A1E24;
  --text: #FFFFFF; --text-2: #C6C6CF; --border: #414149; --button-text: #FFFFFF;
  --map-land: #1F1F24; --map-road: #2A2A30; --map-block: #26262C;
  --shadow: 0 2px 10px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
a.btn, a.btn-outline { text-decoration: none; }
html, body { margin: 0; height: 100%; }
body { background: var(--background); color: var(--text); font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.num { font-family: var(--font-latin); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* app frame: full viewport on phones; centered 390 frame on wide screens */
.app { position: relative; min-height: 100dvh; background: var(--background); display: flex; flex-direction: column; }
@media (min-width: 600px) {
  body { background: #E9E9EC; display: grid; place-items: center; padding: 24px; }
  [data-theme="dark"] body { background: #0F0F12; }
  .app { width: 390px; min-height: 844px; height: 844px; border-radius: 44px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.25); border: 1px solid var(--border); }
}
.screen { display: none; flex: 1; flex-direction: column; min-height: 0; }
.screen.on { display: flex; }

/* status bar (demo only) */
.status { direction: ltr; display: flex; justify-content: space-between; align-items: center; padding: calc(10px + var(--safe-top)) 24px 0; font: 600 15px var(--font-latin); }
.status .pill { width: 120px; height: 34px; border-radius: 20px; background: var(--text); }
[data-theme="dark"] .status .pill { background: #000; }
.status .sig { display: flex; gap: 5px; align-items: center; }
.status .sig svg { width: 18px; height: 14px; }

/* icons */
.ic { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 20px; height: 20px; }
.ic.lg { width: 28px; height: 28px; }

/* header */
.hdr { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px; min-height: 64px; }
.hdr h1 { margin: 0; font-size: 22px; font-weight: 700; }
.iconbtn { width: var(--tap); height: var(--tap); display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: 12px; color: var(--text); }
.iconbtn:active { background: var(--surface-2); }
.logo { display: block; height: 28px; width: auto; }
.logo.hero { height: 86px; }

/* buttons */
.btn { width: 100%; min-height: var(--action); border: 0; border-radius: var(--r-btn); background: var(--primary); color: var(--button-text); font-size: 17px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 20px; }
.btn:active { background: var(--primary-dark); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: default; }
.btn .spin { width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-outline { flex: 1; min-height: var(--action); border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: var(--r-btn); display: inline-flex; align-items: center; justify-content: center; }
.btn-outline:active { background: var(--surface-2); }
.footer { padding: 12px 20px calc(20px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 12px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow); }
.body { flex: 1; min-height: 0; overflow: auto; padding: 8px 20px 16px; display: flex; flex-direction: column; gap: 12px; }

/* service rows (Home) */
.svc { display: flex; align-items: center; gap: 14px; padding: 16px 16px; text-decoration: none; color: inherit; min-height: 72px; }
.svc .tile { width: 56px; height: 56px; border-radius: 14px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.svc .art { width: 48px; height: 48px; }
.svc .lbl { flex: 1; font-size: 17px; font-weight: 600; }
.svc .chev { color: var(--text-2); }
.svc.primary { background: var(--primary-soft); border-color: var(--primary); }
.svc.primary .tile { background: rgba(255,255,255,.6); }
.svc.primary .chev { color: var(--primary-text); }

/* bottom nav */
.nav { display: flex; justify-content: space-around; border-top: 1px solid var(--border); background: var(--surface); padding: 8px 8px calc(14px + var(--safe-bottom)); }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 72px; min-height: var(--tap); padding: 6px 4px; text-decoration: none; color: var(--text-2); font-size: 12px; font-weight: 500; border-radius: 12px; }
.nav a[aria-current="page"] { color: var(--primary-text); font-weight: 600; }

/* map */
.map { position: relative; border-radius: var(--r-card); overflow: hidden; background: var(--map-land); border: 1px solid var(--border); }
.map svg.tiles { display: block; width: 100%; height: 100%; }
.map.short { height: 220px; }
.map.tall { flex: 1; min-height: 300px; border-radius: 0; border: 0; }
.eta { position: absolute; top: 14px; left: 14px; width: 56px; height: 56px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; box-shadow: var(--shadow); }
.eta b { font: 700 20px var(--font-latin); }
.eta small { font-size: 10px; color: var(--text-2); margin-top: 2px; }
.carmark { position: absolute; width: 30px; height: 56px; transform: translate(-50%, -50%) rotate(-28deg); filter: drop-shadow(0 4px 8px rgba(0,0,0,.35)); }
.carmark svg { width: 100%; height: 100%; }

/* location fields */
.loc { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 64px; }
.loc .t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.loc small { font-size: 13px; color: var(--text-2); }
.loc b { font-size: 16px; font-weight: 600; }
.loc .ic { color: var(--primary-text); }
.loc .ic.ink { color: var(--text); }
.loc-join { height: 18px; margin: -6px 0; display: flex; justify-content: flex-start; padding-right: 27px; }
.loc-join i { width: 2px; height: 100%; background: var(--border); display: block; }

/* vehicle options */
.veh { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 84px; cursor: pointer; }
.veh input { position: absolute; opacity: 0; width: 0; height: 0; }
.veh .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--text-2); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.veh .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: transparent; }
.veh .t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.veh .name { font-size: 17px; font-weight: 600; }
.veh .price { font-size: 16px; font-weight: 700; }
.veh .seats { font-size: 13px; color: var(--text-2); }
.veh .car { width: 92px; height: 48px; flex: none; }
.veh:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); }
.veh:has(input:checked) .radio { border-color: var(--primary); }
.veh:has(input:checked) .radio::after { background: var(--primary); }
.veh:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.pay { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 64px; }
.pay .t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pay small { font-size: 13px; color: var(--text-2); }
.pay b { font-size: 16px; font-weight: 600; }

/* driver card */
.driver { margin: 12px 20px 0; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.driver .row { display: flex; align-items: center; gap: 14px; }
.driver .avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; color: var(--text); flex: none; }
.driver .t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.driver .name { font-size: 18px; font-weight: 700; }
.driver .rate { font-size: 14px; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.driver .rate .star { color: #E0A100; width: 16px; height: 16px; fill: #E0A100; stroke: none; }
.driver .car { font-size: 14px; color: var(--text-2); }
.driver .plate { font-size: 16px; font-weight: 700; }
.driver .acts { display: flex; gap: 12px; }

/* splash */
.splash { align-items: center; text-align: center; position: relative; overflow: hidden; }
.splash .mid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 0 32px; width: 100%; }
.splash .tag { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.5; }
.splash .skyline { position: absolute; left: 0; right: 0; bottom: 96px; height: 150px; width: 100%; color: var(--primary); opacity: .12; pointer-events: none; }
[data-theme="dark"] .splash { background: radial-gradient(120% 60% at 50% 0%, #3A1016 0%, var(--background) 60%); }
[data-theme="dark"] .splash .skyline { opacity: .22; }
[data-theme="dark"] .logo { filter: brightness(1.45) saturate(1.05); }
.splash .footer { width: 100%; position: relative; }
.splash .status { width: 100%; }

/* home welcome */
.welcome { padding: 8px 20px 4px; }
.welcome h2 { margin: 0; font-size: 22px; font-weight: 700; }
.welcome p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }

/* states */
.toast { position: absolute; left: 20px; right: 20px; bottom: 100px; background: var(--text); color: var(--background); padding: 12px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }
.error { background: #FCE6E8; color: #8E122B; border-radius: 12px; padding: 12px 14px; font-size: 14px; display: flex; gap: 8px; align-items: center; }
[data-theme="dark"] .error { background: #3A1E24; color: #FF8993; }
.empty { text-align: center; color: var(--text-2); padding: 32px 16px; font-size: 14px; }

/* demo theme switch (not part of the product UI) */
.demo-bar { position: fixed; top: 12px; left: 12px; z-index: 9; display: flex; gap: 8px; }
.demo-bar button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }
@media (max-width: 599px) { .demo-bar { top: auto; bottom: 12px; } }
