# Madaar Mobile Design Guide (for app developers)

**Who this is for:** The developers building the native Customer app and the Provider app ("Madaar Pro").
**Source of truth:** `Customer.html` and `Provide.html` in this folder. Every value below comes from their CSS.
**Read with:** `Madaar-App-Flow-Guide.md`, which explains what each app does and how a job moves from step to step.

> The prototype has two parts. The dark navy page around the phone is only the viewer (sidebar, notes, tours). **Build only what is inside the phone frame.** The app itself has a light theme.

---

## 1. Colors

### 1.1 Brand

| Token | Hex | Use |
|---|---|---|
| `navy` | `#0E2A5C` | Main brand color. Primary buttons, selected chips, checkboxes, the user's own chat bubbles, avatars, dark hero cards |
| `navy2` | `#17397A` | End of the navy gradient (`#0E2A5C → #17397A`, 135°) |
| `navyDeep` | `#0A1E45` | End of the dark hero gradient (`#0E2A5C → #0A1E45`, 160°) on splash and intro screens |
| `orange` | `#F26B1D` | Accent and call to action. "Request help" FAB, orange buttons, active tab, links, progress, radio buttons, unread dots |
| `orangeLight` | `#FF8A45` | Lighter orange for pressed or hover states and on dark backgrounds |
| `orangeBg` | `#FFF3EA` | Tint behind a selected orange item (selected service category, selected account type) |

**Rule of thumb:** use navy for most actions and orange for the single most important action on a screen, such as Request help, Authorize payment, or Submit quote.

### 1.2 Neutrals (light app theme)

| Token | Hex | Use |
|---|---|---|
| `bg` | `#F4F6FA` | Screen background |
| `card` | `#FFFFFF` | Cards, lists, inputs, tab bar, bottom bar, sheets |
| `ink` | `#0D1A3A` | Main text. Also the toast background |
| `mute` | `#667396` | Secondary text, labels, inactive tab icons |
| `line` | `#E2E7F1` | Borders, dividers, inactive step bars |
| `surfaceAlt` | `#EEF1F7` | "Regular" badge background, system chat messages |
| `segmentBg` | `#E9EDF5` | Segmented control track, progress bar track |
| `controlBorder` | `#C4CCDD` | Unchecked checkbox and radio borders, dashed "add photo" border |
| `toggleOff` | `#CBD2E0` | Switch track when off |
| `handle` | `#D5DBE8` | Bottom-sheet grab handle, inactive page dots |
| `tintCard` | `#F8FAFD` | Very light card fill (quick actions, chat shortcut) |

### 1.3 Status colors

Each status color has a strong version for text and icons and a light background. Callout boxes use a darker text color so they stay readable.

| Status | Strong | Background | Text in callouts | Meaning in the app |
|---|---|---|---|---|
| Success | `#15945A` | `#E4F5EC` | `#0F5C39` | Funds secured, completed, Certified badge, switch on |
| Warning | `#B7730B` | `#FDF1DC` | `#7A4C07` | Awaiting approval, documents expiring, pending |
| Error | `#C8362B` | `#FBE6E4` | `#8E2019` | Card declined, dispute, rejected, destructive actions (red button border `#F3C9C5`) |
| Info | `#0E2A5C` (navy) | `#E6EDFA` | `#0E2A5C` | Tips, icon tiles, neutral info |

### 1.4 Other colors

| Hex | Use |
|---|---|
| `#F5A524` | Rating stars |
| `#6B4BB8` | Extra avatar color (purple) |
| Avatar colors | `#0E2A5C`, `#F26B1D`, `#15945A`, `#F5A524`, `#6B4BB8`. Pick one per person and keep it the same everywhere |
| `rgba(8,16,40,.45)` | Dark overlay behind bottom sheets |
| Photo placeholders | Gradients `#3B4252→#1E2432`, `#4A4238→#241F1A`, `#2F4A3E→#18261F` |
| Payment card art | `linear-gradient(135deg, #0E2A5C 0%, #1D4C9A 60%, #F26B1D 160%)` |

### 1.5 Contrast (WCAG): please read

| Pair | Ratio | Result |
|---|---|---|
| ink `#0D1A3A` on bg `#F4F6FA` | 15.8 : 1 | ✅ |
| white on navy `#0E2A5C` | 14.0 : 1 | ✅ |
| mute `#667396` on white | 4.7 : 1 | ✅ AA |
| mute `#667396` on bg `#F4F6FA` | 4.35 : 1 | ⚠️ Just below AA for small text |
| **white on orange `#F26B1D`** | **3.05 : 1** | ⚠️ Passes only for large text (≥ 18 pt, or ≥ 14 pt bold) |
| orange text on white (links) | 3.05 : 1 | ⚠️ Same limit |
| green `#15945A` on `#E4F5EC` (pills) | 3.4 : 1 | ⚠️ Small pill text fails AA |
| amber `#B7730B` on `#FDF1DC` (pills) | 3.4 : 1 | ⚠️ Same |

**What to do:** keep orange buttons at 16 pt bold or larger, and don't use orange for small body text. For small status pills, darken the text to the callout colors (`#0F5C39`, `#7A4C07`, `#8E2019`). Talk to design before changing the brand orange itself.

---

## 2. Typography

| Role | Font | Notes |
|---|---|---|
| Headings, big numbers, OTP digits, avatar initials | **Bricolage Grotesque** (variable, weight 200–800) | Use weight 700 |
| Everything else | **Manrope** (400, 500, 600, 700, 800) | Body, buttons, labels, inputs |
| Arabic | **IBM Plex Sans Arabic** (400, 500, 600, 700) | Takes over for Arabic glyphs. Latin text stays Manrope or Bricolage |

The font files are in `assets/fonts/` (`.woff2`). For mobile, download the `.ttf` or `.otf` versions of the same families from Google Fonts. All three are free under the OFL license.

### Type scale (sizes in px; treat as pt on iOS and sp on Android)

| Style | Font | Size / line height | Weight | Extra |
|---|---|---|---|---|
| Display / H1 | Bricolage | 30 / 1.05 | 700 | Letter spacing +0.01em |
| H2 | Bricolage | 22 / 1.1 | 700 | |
| Screen title (header) | Bricolage | 21 / 1.1 | 700 | |
| Stat number | Bricolage | 22 / 1.15 | 700 | Tabular numbers |
| OTP digit | Bricolage | 24 | 700 | |
| Button | Manrope | 16 | 700 | Small button 14, extra-small 12.5 |
| Input value | Manrope | 15 | 600 | |
| Body | Manrope | 14 / 1.45 | 400–600 | List titles 14 bold |
| Small body | Manrope | 13–13.5 | 500–600 | Chips, notes, chat |
| Caption | Manrope | 12 | 500 | Muted color |
| Section label | Manrope | 11 | 700 | UPPERCASE, letter spacing 0.08em, muted |
| Pill / badge | Manrope | 11 | 700 | Letter spacing 0.02em |
| Tab label | Manrope | 10.5 | 600 | |

**Money and numbers:** always use tabular (fixed-width) digits so amounts line up. Format money as `$1,234.00` (US dollars, two decimals).

---

## 3. Spacing, corners, shadows

**Screen padding:** 18 horizontal. **Gaps:** 6, 8, 10, 12, 14, 16, 20 (10 is the default between items in a row or column).

### Corner radius

| Element | Radius |
|---|---|
| Phone screen / bottom sheet top | 24 (sheet top corners) |
| Payment card art, intro slide image | 16–22 |
| Card, list group | 14 |
| Primary button | 13 |
| Input field, OTP box, segmented control, category tile | 12 |
| Icon button (36×36), list icon tile (38×38) | 11 |
| Avatar | 12 (40 px), 18 (64 px), 9 (32 px) |
| Small button | 10 / 8 |
| Checkbox | 7 |
| Pill / badge | 6 |
| Chip, toggle, radio | Fully rounded |

### Shadows

| Element | Shadow |
|---|---|
| Orange button | `0 6 16 rgba(242,107,29,.28)` |
| FAB | `0 8 20 rgba(242,107,29,.40)` |
| Highlighted card (orange border 1.5) | `0 6 18 rgba(242,107,29,.12)` |
| Bottom sheet | `0 -10 40 rgba(13,26,58,.20)` |
| Toast | `0 10 30 rgba(0,0,0,.25)` |
| Selected segment | `0 1 3 rgba(13,26,58,.15)` |

Most cards have **no shadow**, only a 1 px `line` border. Keep it flat.

---

## 4. Components

| Component | Spec |
|---|---|
| **Primary button** | Full width, 14 padding (about 50 tall), radius 13, Manrope 16/700. Kinds: navy (default), orange (main CTA, with shadow), ghost (white + 1.5 `line` border + navy text), red (white + red text + `#F3C9C5` border), green. Disabled = 45% opacity |
| **Input field** | White, 1.5 `line` border, radius 12, padding 10×12. Small label on top (11/600 muted), value 15/600. Focused: navy border + 3 px navy glow at 10% opacity. Error: red border |
| **OTP** | 6 boxes, 44×54 (40×52 in sign-up), radius 12, 1.5 border; the filled box gets a navy border |
| **Chip** | Fully rounded, padding 7×12, 1.5 `line` border, 13/600. Selected: navy fill, white text. Rows of chips scroll sideways |
| **Pill / badge** | Radius 6, padding 3×8, 11/700. Certified = green with a shield icon. Regular = `#EEF1F7` + muted text |
| **Card** | White, 1 `line` border, radius 14, padding 14 |
| **List row** | 12 vertical padding, 38×38 icon tile (blue tint + navy icon), title 14 bold, subtitle 12 muted on one line with "…", divider between rows |
| **Tab bar** | White, top border, 5 items, icon 22 + label 10.5/600. Active = orange. Badge = orange circle with white border. **Customer app:** the center item is a 52×52 orange FAB (radius 16) that sits 26 above the bar and opens "Request help" |
| **Header** | Back icon button (36×36, radius 11, bordered) + title (Bricolage 21) + optional subtitle and right action |
| **Segmented control** | `#E9EDF5` track, radius 12, padding 4. Selected segment = white, navy text, small shadow |
| **Toggle** | 46×26 track, 20 px white knob. On = green |
| **Checkbox / radio** | 22×22. Checkbox on = navy. Radio on = orange ring + orange dot |
| **Step progress** | Row of 4 px bars. Done = orange, todo = `line` |
| **Timeline** | 14 px dots joined by 2 px lines. Done = green, current = orange with a glow ring, failed = red |
| **Callout (note)** | Radius 12, padding 12, 13 text, icon on the left. Green, amber, red, or blue variants (see 1.3) |
| **Chat bubble** | Max 78% width, radius 16. Mine = navy, bottom-right corner 4. Theirs = white + border, bottom-left corner 4. System message = centered gray pill |
| **Bottom sheet** | White, top radius 24, grab handle 40×5, max 82% of screen height, dark overlay behind it |
| **Toast** | Dark `ink` background, white 13.5/600 text, radius 14, slides down from the top |
| **Empty state** | 80×80 icon tile (radius 24, blue tint), centered muted text |
| **Photo slots** | 64 tall, radius 10, dark gradient + camera icon, small "BEFORE"/"AFTER" tag. Add slot = dashed border |

**Touch targets:** make every tappable item at least 44×44 pt on iOS and 48×48 dp on Android, even when the visible icon is smaller (for example, the 36×36 header buttons).

---

## 5. Icons

- **Style:** outline icons in a 24×24 grid, **2 px stroke**, round caps and joins, colored with the current text color. The **Lucide** icon set matches this style closely.
- **Sizes:** 20 default, 22 in the tab bar, 18 in the header back button, 26 (2.6 stroke) on the FAB, 12 inside pills.
- **Icons used:** truck, tow, tire, wrench, bolt (jump start), fuel, key (lockout), pin, star, shield, chat, phone, camera, image, home, list, user, users, clock, back, chevron, down, close, bell, card, bank, lock, check, gps, dollar, grid, alert, info, file, upload, cog, filter, nav, plus, minus, search, edit, trash, send, mic, flag, help, logout, globe, mail, refresh, receipt, chart, eye, more, route, power, sparkle, award, map, copy, thumb, scale, calendar, hash.
- The exact SVG paths are in the `const P={…}` block near line 386 of `Customer.html` if you want to copy them.

---

## 6. Motion

| Transition | Duration | Curve |
|---|---|---|
| Push to the next screen (slides in from the right, old screen moves 28% left and dims) | 380 ms | `cubic-bezier(.22,.8,.26,1)` |
| Back | 340 ms | same |
| Bottom sheet up / down | 360 / 250 ms | same / ease |
| Toast in | 350 ms | same |
| Fade between tabs | 280 ms | ease |
| List items appear one after another | 450 ms, 40 ms apart | same |
| Button press | Scale to 0.97, 120 ms | ease |
| Success checkmark | Pops in, then the tick draws | 600 ms |
| "Finding providers" radar | 3 orange rings, 2.4 s loop | ease-out |
| Loading skeleton | Shimmer `#E8ECF4 → #F5F7FB` | 1.2 s loop |

`cubic-bezier(.22,.8,.26,1)` is a quick start with a soft landing. As control points: (0.22, 0.8) and (0.26, 1).

**When the user turns on Reduce Motion** (iOS) or **Remove animations** (Android), turn these animations off. The prototype already does this.

---

## 7. Languages (English, Arabic, French)

The apps are **multi-language**. The final set for now is:

| Language | Direction | Font |
|---|---|---|
| English (default) | Left to right | Manrope / Bricolage Grotesque |
| French | Left to right | Manrope / Bricolage Grotesque (both include French accents: é è ê à ç ô œ) |
| Arabic | **Right to left** | IBM Plex Sans Arabic for Arabic letters; Latin text and numbers stay Manrope / Bricolage |

**For all languages**
- Keep every piece of text in translation files. Don't put text directly in the screen code.
- Let the user pick the language in Settings, and start with the phone's language when it is one of the three.
- Format dates, times and numbers for the chosen language, but keep money in US dollars.
- Don't build sentences by joining pieces of text together (for example `"You have " + n + " quotes"`). Word order is different in each language. Use one full sentence with placeholders, and use proper plural rules (Arabic has several plural forms).
- Text length changes between languages. French is often 20–30% longer than English, so buttons, chips, tab labels and pills must grow or wrap without cutting words off.

**French**
- French uses a space before `: ; ? !` and the euro-style number format `1 234,56`. The money amount can still show as `$1,234.00` if that is what the business wants. Check with the product team.

**Arabic / right to left**
- `Arabic/Customer.html` and `Arabic/Provide.html` show every screen in Arabic and right to left.
- Mirror the whole layout: back arrows, list chevrons, tab order, and which side chat bubbles appear on.
- **Don't mirror:** phone numbers, plate numbers, VINs, money amounts, maps, or the logo.
- **Don't** add letter spacing or UPPERCASE styling to Arabic text. It breaks cursive script. The uppercase section labels need a plain style in Arabic.
- Use start and end padding, not left and right, so the layout flips by itself.

---

## 8. Ready-to-use tokens

```json
{
  "color": {
    "navy": "#0E2A5C", "navy2": "#17397A", "navyDeep": "#0A1E45",
    "orange": "#F26B1D", "orangeLight": "#FF8A45", "orangeBg": "#FFF3EA",
    "bg": "#F4F6FA", "card": "#FFFFFF", "ink": "#0D1A3A", "mute": "#667396", "line": "#E2E7F1",
    "surfaceAlt": "#EEF1F7", "segmentBg": "#E9EDF5", "controlBorder": "#C4CCDD", "toggleOff": "#CBD2E0",
    "success": "#15945A", "successBg": "#E4F5EC", "successText": "#0F5C39",
    "warning": "#B7730B", "warningBg": "#FDF1DC", "warningText": "#7A4C07",
    "error": "#C8362B",   "errorBg": "#FBE6E4",   "errorText": "#8E2019",
    "infoBg": "#E6EDFA", "star": "#F5A524", "scrim": "rgba(8,16,40,0.45)"
  },
  "radius": { "pill": 6, "check": 7, "icon": 11, "field": 12, "button": 13, "card": 14, "fab": 16, "sheet": 24, "full": 999 },
  "space": [4, 6, 8, 10, 12, 14, 16, 18, 20, 24],
  "font": { "display": "Bricolage Grotesque", "body": "Manrope", "arabic": "IBM Plex Sans Arabic" },
  "languages": ["en", "fr", "ar"],
  "motion": { "easing": [0.22, 0.8, 0.26, 1], "push": 380, "back": 340, "sheet": 360, "fade": 280 }
}
```

---

## 9. Logo and assets

| File | Use |
|---|---|
| `assets/madaar-logo.png` | Full logo (splash, sign-in) |
| `assets/madaar-mark.png` | Square mark. Use for the app icon, push notification icon, and small avatar |
| `assets/fonts/` | Web font files (get `.ttf` versions for mobile, see section 2) |

The splash screen is white with the logo in the middle. The dark hero screens use the navy gradient.

---

## 10. Screen map and API notes

- Each prototype file includes **108 screens**: about 62 Customer screens (IDs start with `c-`) and 46 Provider screens (IDs start with `p-`). They are grouped as Onboarding, Home & trucks, Create request, Quotes & payment, Service & completion, Disputes, Jobs & account, Fleet manager (Customer), and Registration & KYC, Requests & quoting, Job execution, Earnings & profile (Provider).
- **Open any screen and look at the right-hand notes panel.** It lists:
  - the **API calls** that screen makes (for example `POST /api/v1/auth/otp/send`, `GET /api/v1/app/config`)
  - the **job states** where the screen appears (`REQUESTED`, `QUOTES_RECEIVED`, `PAYMENT_AUTHORIZED`, `EN_ROUTE`, `COMPLETED`, `CONFIRMED`, `PAYMENT_CAPTURED`, `PAID_OUT`, `DISPUTED`, `CANCELLED`, `EXPIRED`)
  - business rules (spending limits, the 10% fee, cancellation fees, auto-confirm after 24 h)
- Use the screen IDs (`c-pay`, `p-quote`, …) as route names in the app. That keeps design, QA, and code talking about the same screen.
- The intro slide copy comes from `GET /api/v1/app/config`. Don't hard-code it.

---

## 11. Quick checklist before you ship a screen

- [ ] Colors come from the tokens, with no hard-coded hex values
- [ ] Headings use Bricolage, everything else uses Manrope
- [ ] Money uses tabular digits and `$0.00` format
- [ ] Touch targets are at least 44 pt / 48 dp
- [ ] Orange is used for one main action, not for small text
- [ ] Empty, loading (shimmer), and error states are built
- [ ] All text comes from translation files and has been checked in English, French and Arabic
- [ ] Long French text fits, and Arabic is right to left with no letter spacing
- [ ] Reduce Motion is respected
- [ ] Safe areas (notch, home indicator) are respected and the tab bar sits above the home indicator
