# 📱 SDC (Surrogate & Donor Connect) — Mobile App Master Implementation Prompt

> **Instructions for the AI Assistant / Mobile Developer:**  
> You are tasked with developing a 100% production-ready, ultra-smooth, premium mobile application (iOS & Android) for **Surrogate & Donor Connect (SDC)**.  
> You must strictly follow the UI design system, color palette, typography, visual hierarchy, and user flows illustrated in the reference design screenshots, the **`beefplan.md`** specification, and the **`sdc_postman_collection.json`** backend API collection (93 endpoints).  
> **Rule 0:** Write complete, fully wired, non-placeholder code. Zero mock data when backend endpoints exist. Ensure 60 FPS silky smooth micro-animations, instant role-switching, responsive layouts, and robust offline token persistence.

---

## 🎨 1. Design System & Brand Identity Tokens

Match the exact design aesthetics from the provided UI screenshots:

### 1.1 Color Palette
```css
/* Primary Brand & Medical Greens */
--color-primary: #1b7a43;             /* Deep Emerald Medical Green (Buttons, Active Pills, Logos) */
--color-primary-hover: #166534;       /* Pressed State */
--color-primary-light: #f0fdf4;       /* Light Green Badge / Active Background */
--color-primary-border: #bbf7d0;      /* Green Accent Border */

/* Backgrounds & Canvas */
--color-bg-canvas: #ffffff;           /* Clean Pure White Canvas */
--color-bg-sheet: #ffffff;            /* Bottom Sheet / Card Surface */
--color-bg-subtle: #f9fafb;           /* Input Field Background */
--color-bg-segmented: #f3f4f6;        /* Segmented Role Switcher Track */

/* Typography & Neutrals */
--color-text-main: #0f172a;           /* Pure Dark Slate (Headings, Main Labels) */
--color-text-body: #1e293b;           /* Body Text */
--color-text-muted: #64748b;          /* Subtitles, Placeholders, Helper Text */
--color-text-dim: #94a3b8;            /* Icons in inactive inputs */

/* Borders & Dividers */
--color-border-subtle: #e5e7eb;       /* Field & Card Borders */
--color-border-focus: #1b7a43;        /* Active Input Outline */

/* Feedback States */
--color-success: #15803d;             /* Verified Badges / Cleared */
--color-warning: #b45309;             /* Pending / Review Stages */
--color-danger: #dc2626;              /* Suspended / Error / Inactive */
```

### 1.2 Typography & Iconography
* **Font Family:** `Plus Jakarta Sans` or `Inter` (Google Fonts), fallback to system `San Francisco` (iOS) / `Roboto` (Android).
  * Headings (`h1`, `h2`): `800` (Extra Bold) / `700` (Bold)
  * Form Labels & Buttons: `600` (Semi Bold) / `700` (Bold)
  * Body & Descriptions: `400` (Regular) / `500` (Medium)
* **Icon Set:** FontAwesome 6 Free (`fa-solid`, `fa-regular`) or Lucide Icons with matching line-weights and soft rounded caps.

### 1.3 Shapes, Elevation & Shadows
* **Input Fields:** `border-radius: 12px`, `height: 52px`, `background: #f9fafb`, `border: 1px solid #e5e7eb`, inner padding `14px 16px`, left icon with `12px` right gap.
* **Pill Buttons:** `border-radius: 9999px`, `height: 52px`, font-size `16px`, font-weight `700`, smooth press scaling (`transform: scale(0.98)`).
* **Cards (Role Grid & Dossiers):** `border-radius: 16px`, `border: 1.5px solid #e5e7eb`, `background: #ffffff`, subtle elevation shadow `0 4px 14px rgba(0,0,0,0.04)`.
* **Onboarding Bottom Sheet:** `border-top-left-radius: 32px`, `border-top-right-radius: 32px`, full-width card overlapping the hero photography.

---

## 📱 2. Core UI Screens (Pixel-Perfect from Screenshots)

### Screen 1: Splash & Onboarding Carousel
* **Top Area (60% Height):**
  * Full-bleed warm lifestyle hero photograph (loving couple embracing their newborn wrapped in a soft white blanket).
  * Subtle gradient scrim at the bottom edge for seamless sheet blending.
* **Bottom Sheet (40% Height):**
  * Clean white background with rounded top corners (`32px` radius).
  * **Heading:** `"Your Journey to Parenthood Starts Here"` (`24px` - `26px`, Bold, `#0f172a`, line-height `1.2`).
  * **Subtitle:** `"Connect with trusted surrogates, donors and agencies. Safe. Secure. Transparent."` (`14px`, `#64748b`, margin-top `10px`).
  * **Carousel Indicators (3 Steps):**
    * Step 1 (Active): Elongated emerald green pill (`width: 24px`, `height: 6px`, `#1b7a43`, `border-radius: 9999px`).
    * Step 2 & 3 (Inactive): Small circular dots (`width: 6px`, `height: 6px`, `#cbd5e1`, `border-radius: 50%`).
  * **Bottom Action Row:**
    * Left: `"Skip"` text button (`#64748b`, bold `14px`, navigates straight to Role Selector).
    * Right: `"Next"` pill button (`background: #1b7a43`, text `#ffffff`, padding `12px 30px`, `border-radius: 9999px`, font-weight `700`).

---

### Screen 2: Role Selection Screen (`Select Your Role`)
* **Top Header:**
  * Centered circular **SDC Logo** (Magnifying glass with pregnant silhouette and heart emblem).
  * Brand Title: `"Surrogate & Donor Connect"` (`18px`, bold, `#1b7a43`).
* **Title & Subtitle:**
  * Heading: `"Select Your Role"` (`24px`, bold, `#0f172a`, margin-top `18px`).
  * Subtitle: `"Choose how you want to use the platform"` (`14px`, `#64748b`).
* **2x2 Role Grid:**
  * **Card 1 (Intending Parents):**
    * Icon: Heart (`fa-solid fa-heart`, `#1b7a43`, `24px`).
    * Title: `"Intending Parents"` (`16px`, bold `#0f172a`).
    * Subtitle: `"Find your perfect match"` (`12px`, `#64748b`).
    * Target Action: Sets role to `parent` and routes to Register / Dashboard.
  * **Card 2 (Surrogate):**
    * Icon: User (`fa-solid fa-user`, `#1b7a43`, `24px`).
    * Title: `"Surrogate"` (`16px`, bold `#0f172a`).
    * Subtitle: `"Help others build families"` (`12px`, `#64748b`).
    * Target Action: Sets role to `surrogate`.
  * **Card 3 (Donor):**
    * Icon: Community / Users (`fa-solid fa-user-group`, `#1b7a43`, `24px`).
    * Title: `"Donor"` (`16px`, bold `#0f172a`).
    * Subtitle: `"Make a difference"` (`12px`, `#64748b`).
    * Target Action: Sets role to `donor`.
  * **Card 4 (Agency):**
    * Icon: Building / Clinic (`fa-solid fa-building`, `#1b7a43`, `24px`).
    * Title: `"Agency"` (`16px`, bold `#0f172a`).
    * Subtitle: `"Manage & connect"` (`12px`, `#64748b`).
    * Target Action: Sets role to `agency`.
* **Footer:**
  * `"Already have an account? Login"` (with `"Login"` styled as bold green `#1b7a43`, clicking navigates to Welcome Back Screen).

---

### Screen 3: Unified Login Screen (`Welcome Back`)
* **Top Brand Header:**
  * SDC Logo + `"Surrogate & Donor Connect"` title.
  * Heading: `"Welcome Back"` (`24px`, bold `#0f172a`).
  * Subtitle: `"Sign in to continue your journey"` (`14px`, `#64748b`).
* **Segmented Role Switcher:**
  * Label: `"Logging in as:"` (`13px`, font-weight `700`, `#0f172a`, margin-bottom `8px`).
  * Segmented Track: Background `#f3f4f6`, `padding: 4px`, `border-radius: 12px`, 4 tabs:
    * `[Parents]` | `[Surrogate]` | `[Donor]` | `[Agency]`
    * Active Tab: Pill with `#1b7a43` green background, white text, bold font, animated sliding indicator.
* **Form Inputs:**
  * **Email or Phone Number:**
    * Label: `"Email or Phone Number"` (`13px`, bold).
    * Input Field: Left icon (Lock / Envelope), placeholder: `"sarah.john@example.com"`.
  * **Password:**
    * Label: `"Password"` (`13px`, bold).
    * Input Field: Left icon (Lock), right icon (Eye toggle to show/hide plaintext password).
  * Right-aligned Link: `"Forgot password?"` (`13px`, `#1b7a43`, bold).
* **Action Button:**
  * Full-width pill: `"Login"` (`height: 52px`, `#1b7a43`, white text, `border-radius: 9999px`).
  * Loading state: Replaces text with a white spinner during API call.
* **Bottom Redirect:**
  * `"Don't have an account? Sign Up"` (`"Sign Up"` in bold `#1b7a43`).

---

### Screen 4: Sectioned Dynamic Registration Screen
* **Top Navigation Bar:**
  * Left back arrow icon `<` (`onPress: popScreen()`).
  * Centered SDC Logo.
* **Dynamic Header:**
  * Heading: `"Register Intending Parent"` (changes dynamically: `"Register Surrogate"`, `"Register Egg/Sperm Donor"`, `"Register Agency & Clinic"`).
  * Subtitle: `"Connect with pre-screened surrogates and egg donors"`.
* **Segmented Role Switcher:**
  * Label: `"I want to register as:"`.
  * 4 Tabs: `[Parents]` `[Surrogate]` `[Donor]` `[Agency]` (switching tabs instantly re-renders role-specific sections without losing shared input data).
* **Sectioned Multi-Step Layout:**
  * **`1. ACCOUNT & SIGN-IN`** (Section header in emerald green `#1b7a43`, uppercase, `13px` bold, with subtle divider):
    * `Full Name (as on ID) *` (User icon)
    * `Email Address (Sign-in ID) *` (Mail icon)
    * `Phone Number *` (Phone icon, e.g., `+2348050000001`)
    * `Password (Min. 12 characters) *` (Lock icon, eye toggle)
    * `Confirm Password *` (Lock icon)
  * **`2. PERSONAL INFORMATION`**:
    * 2-Column row: `Date of Birth *` (Calendar picker) + `Nationality *` (Globe icon, e.g., Nigerian).
    * `Residential Address *` (Location pin icon).
    * `Marital Status` (Dropdown: Single, Married, Divorced, Widowed).
  * **`3. ROLE-SPECIFIC REQUIREMENTS (From beefplan.md)`**:
    * **If Parent:** Service needed (Surrogate Only ₦500, Donor Only ₦150,000, Both ₦150,500), Genotype preference, State preference.
    * **If Surrogate:** Age (21-35), Height, Weight, Blood Group, Genotype (AA/AS), Prior natural deliveries count, C-section count, Previous surrogate experience (Yes/No), Guarantor Full Name & Phone.
    * **If Donor:** Donor Type (Egg Donor vs Sperm Donor), Age (18-29), Genotype, Blood Group, Complexion, Eye Colour, Hair Colour, Highest Education, Special Talents.
    * **If Agency:** CAC Company Registration Number, Organization Legal Name, Authorized Representative Name, Clinic Accreditation info.
* **Action Button:**
  * Full-width pill: `"Submit Registration & Continue"` (`#1b7a43`, white text).

---

## 🧭 3. Four Role-Specific Navigation Footers (Bottom Nav Bars)

Once authenticated via Bearer token, the app mounts the appropriate role bottom navigation bar:

### 3.1 Intending Parent Bottom Navigation
1. **Home / Dashboard (`fa-solid fa-house`):**
   * Greeting with Parent Name & KYC badge (`Verified` / `Pending`).
   * Active Package Banner (e.g. "Surrogate Matching Package — ₦500").
   * GTBank Manual Payment Instructions card (Account: `0123456789`, SDC Healthcare).
   * Quick action buttons: "New Sourcing Request", "Submit GTBank UTR".
2. **Browse / Match (`fa-solid fa-magnifying-glass`):**
   * Filterable candidate directory: Filter by Category (Surrogate, Egg Donor, Sperm Donor), Genotype (AA, AS), Blood Group, State.
   * Candidate cards with Doctor Clearance badge, obstetric history, and blurred photo mode.
3. **My Requests (`fa-solid fa-clipboard-list`):**
   * Sourcing Requests list showing `ref_no` (e.g. `REQ-20261101-3006`), matched candidate summary, and current request status (`pending`, `matched`, `handover_cleared`).
4. **Billing & Invoices (`fa-solid fa-receipt`):**
   * Invoices list showing `invoice_no` (e.g. `INV-20261101-5EA6`), Amount (₦), Payment status (`paid`, `unpaid`, `under_review`).
   * 1-Click "Submit GTBank UTR & Proof" modal.
5. **Profile & KYC (`fa-solid fa-user-shield`):**
   * Personal details, KYC document upload (NIN / International Passport / Driver's License), change password, logout.

---

### 3.2 Surrogate Mother Bottom Navigation
1. **Home (`fa-solid fa-house`):**
   * Stage banner (e.g. "Stage 6: Approved for Consideration").
   * Monthly check-in prompt and clinical appointment reminders.
2. **My Availability (`fa-solid fa-toggle-on`):**
   * Interactive Switch: `Available for Matching` vs `Resting / Inactive`.
   * Monthly physical wellness check-in form.
3. **12-Stage Pipeline (`fa-solid fa-timeline`):**
   * Visual progress stepper across the 12 stages from Section 7 of `beefplan.md`:
     1. Registered ➔ 2. Under Review ➔ 3. Awaiting Screening ➔ 4. Clinic Screen Passed ➔ 5. Background & Guarantor Cleared ➔ 6. Approved for Consideration ➔ 7. Matched with Parent ➔ 8. Agreement Executed ➔ 9. Medical Cycle & Transfer ➔ 10. Confirmed Pregnancy ➔ 11. Delivery ➔ 12. Post-delivery Discharge.
4. **Guarantor & Vetting (`fa-solid fa-file-shield`):**
   * Guarantor details, doctor screening clearance certificate view, photo clearance status.
5. **My Profile (`fa-solid fa-user`):**
   * Personal bio, obstetric delivery records (prior births, c-sections), emergency contact.

---

### 3.3 Donor Bottom Navigation
1. **Home (`fa-solid fa-house`):**
   * Active catalog status, screening appointment status.
2. **Catalog & Traits (`fa-solid fa-dna`):**
   * Phenotypic & biological profile: Genotype, Blood Group, Complexion, Eye color, Hair color, Height, Weight, Education, Special Talents.
3. **Availability (`fa-solid fa-calendar-check`):**
   * Ready for donation cycle toggle and blackout dates calendar.
4. **Compensation & Logs (`fa-solid fa-wallet`):**
   * Medical allowance and travel reimbursement disbursement logs.
5. **Settings & Privacy (`fa-solid fa-gear`):**
   * Photo privacy toggle (Show blurred avatar to public vs verified parents only), security, sign out.

---

### 3.4 Agency & Clinic Bottom Navigation
1. **Dashboard (`fa-solid fa-chart-pie`):**
   * B2B Sourcing Quota tracker (e.g. `14 / 25 profiles viewed this month`).
   * Verification Badge Level:
     * `Registered Agency` (Level 1)
     * `Business Information Verified` (Level 2)
     * `Credentials Independently Verified` (Level 3 - Accredited Clinic)
2. **Candidates Roster (`fa-solid fa-users`):**
   * Clinic's managed surrogates and donors table. Add new candidate button with clinical attachment uploads.
3. **Sourcing Requests (`fa-solid fa-handshake`):**
   * B2B candidate requests and matched intended parent handovers.
4. **Subscriptions & Billing (`fa-solid fa-credit-card`):**
   * Annual/Monthly Tier plans (₦150k - ₦1.2M), UTR payment submission for quota top-ups.
5. **Agency Profile (`fa-solid fa-building-circle-check`):**
   * CAC registration certificate, clinic address, medical director contact, badge status.

---

### 3.5 In-App Live API Debug Tray / Network Inspector (Mandatory Bottom Toggle)
To enable instantaneous verification of all wired APIs directly on a physical phone or simulator:
* **Debug Toggle Switch / Button:**
  * Placed at the bottom of the screen (or as a floating discreet pill `[🛠️ Debug API Inspector]` above the bottom bar).
  * 1-Tap toggle switch: Easily turns the Debug Tray ON or OFF.
* **When Toggled ON (Expandable Bottom Drawer / Sheet):**
  * Displays every API endpoint connected to the current active role and active screen.
  * For each API request:
    * **HTTP Method Badge:** Green `GET`, Blue `POST`, Amber `PUT`, Red `DELETE`.
    * **Full Live Endpoint URL:** Complete live URL (e.g. `https://mydaddyonline.cloud/api/v1/parent/candidates/search.php?category=surrogate`).
    * **HTTP Response Code Badge:** Displays exact HTTP status (e.g. `200 OK`, `201 Created`, `401 Unauthorized`, `422 Unprocessable`, `500 Error`).
    * **Latency / Response Time:** Execution duration in milliseconds (e.g. `124 ms`).
    * **Formatted JSON Response Box:** Expandable code block showing formatted server response JSON with clean syntax indentation.
    * **Copy JSON Button:** 1-Click button to copy raw JSON response to device clipboard.
    * **Re-send Request Button:** Instant button to re-trigger the API and inspect fresh data without reloading the whole screen.
* **When Toggled OFF:**
  * Smoothly collapses into a minimal discreet button or hidden mode to preserve the app's clean, premium, production-grade aesthetics.

---

## ⚡ 4. Backend API & Postman Integration Guide

### 4.1 Production & Staging API Domains
* **Live Production API Domain:** `https://mydaddyonline.cloud/api/v1`
* **Local Development Staging URL:** `http://localhost/mdo/SDC/api/v1`
* **Official Postman Collection:** Reference `sdc_postman_collection.json` (61 customer & public discovery endpoints, organized into 5 flow folders).

### 🚫 Strict Boundary: NO Admin Role in Mobile Application
> **Important Rule for Mobile Development:**  
> The SDC Mobile App is **exclusively for the 4 customer roles** (`Intended Parents`, `Surrogate Mother`, `Egg & Sperm Donor`, and `Surrogacy Agency & Clinic`).  
> **Admin operations exist ONLY as a desktop web portal (`/admin/dashboard.php`).**  
> There is **NO Admin login**, **NO Admin role tab**, and **NO Admin screens** in the mobile app or in the mobile Postman collection.

### 4.2 Authentication & Token Handling
* All customer role authentication endpoints return a JWT Bearer Token:
  * `POST /parent/auth/login.php` or `register.php` ➔ returns `data.token`
  * `POST /surrogate/auth/login.php` or `register.php` ➔ returns `data.token`
  * `POST /donor/auth/login.php` or `register.php` ➔ returns `data.token`
  * `POST /agency/auth/login.php` or `register.php` ➔ returns `data.token`
* **Storage:** Store the token securely in `Flutter SecureStorage` / `React Native Expo SecureStore`.
* **HTTP Interceptor:** Inject header:  
  `Authorization: Bearer <stored_token>` and `Accept: application/json` on all authenticated calls.

### 4.3 Key Endpoint Mapping Table (Domain: `https://mydaddyonline.cloud/api/v1`)

| Flow / Action | HTTP Method & Endpoint | Description |
|---|---|---|
| **Parent Registration** | `POST /parent/auth/register.php` | Registers parent, creates initial sourcing request + invoice |
| **Parent Login** | `POST /parent/auth/login.php` | Authenticates parent and returns JWT bearer token |
| **Submit GTBank UTR** | `POST /parent/invoices/pay_utr.php` | Sends `invoice_no`, `utr_number`, `sender_bank_name`, `amount` |
| **Browse Candidates** | `GET /parent/candidates/search.php` | Filter by `category`, `genotype`, `blood_group` |
| **Upload Parent KYC** | `POST /parent/profile/kyc.php` | Multipart/form-data for ID document upload |
| **Surrogate Availability** | `POST /surrogate/availability.php` | Toggles `is_available` (1 or 0) |
| **Surrogate Pipeline** | `GET /surrogate/pipeline/status.php` | Returns current 1-12 stage, history & doctor clearances |
| **Donor Catalog** | `GET /donor/profile.php` | Returns phenotype, biological traits, and compensation logs |
| **Agency Quota Status** | `GET /agency/subscriptions.php` | Returns current tier, quota limit, candidates viewed |
| **Agency Post Candidate** | `POST /agency/candidates/register.php` | Agency intake of surrogate/donor |
| **Public Packages** | `GET /public/packages.php` | Public pricing (₦500 surrogate, ₦150k donor, ₦150.5k both) |
| **Public Directory** | `GET /public/directory.php` | Search accredited clinics & IVF hospitals |

---

## 🛠️ 5. Technical Stack & Implementation Architecture

Choose one of the modern mobile frameworks below and implement with strict architectural standards:

### Preferred Framework Options:
1. **Flutter (Dart 3.x):**
   * State Management: `flutter_riverpod` or `bloc`.
   * Networking: `dio` with custom interceptors for Bearer token & refresh, Base URL: `https://mydaddyonline.cloud/api/v1`.
   * Secure Storage: `flutter_secure_storage`.
   * Routing: `go_router` with shell routes for the 4 customer role bottom bars.
2. **React Native (Expo SDK 51+):**
   * State Management: `zustand` or `@reduxjs/toolkit`.
   * Networking: `axios` with interceptors, Base URL: `https://mydaddyonline.cloud/api/v1`.
   * Navigation: `expo-router` or `@react-navigation/bottom-tabs`.
   * Secure Storage: `expo-secure-store`.

### Architectural Directives:
* **Zero Dummy Stubs:** Every button must trigger its real API call or navigate to its designated screen.
* **Network Caching:** Cache images and candidate lists using `cached_network_image`.
* **Form Validation:** Strict regex validation on emails, Nigerian phone numbers (`+234...`), and minimum 12-character passwords.
* **In-App Network Logging:** Implement an HTTP interceptor (Dio Interceptor in Flutter or Axios Interceptor in React Native) that pushes every outgoing request and incoming response (URL, HTTP status, latency, request payload, response JSON) to the in-app Debug Tray state.
* **Error Handling:** Beautiful in-app toast/snackbar alerts showing exact backend error messages (`data.message`).
* **Haptic Feedback:** Subtle haptic ticks on role tabs switching and successful payment submissions.

---

## 🎯 6. Prompt to Give Directly to the AI Agent

```markdown
You are an expert Senior Mobile Engineer. Build the complete, production-grade SDC (Surrogate & Donor Connect) mobile app following the exact design system, colors (#1b7a43), typography (Plus Jakarta Sans), and layouts from `APP_MASTER_PROMPT.md` and the provided screenshots:

1. Target API Base URL: `https://mydaddyonline.cloud/api/v1` (with fallback to local `http://localhost/mdo/SDC/api/v1` for offline dev).
2. Strict Role Boundary: The mobile app has NO ADMIN ROLE. It exclusively serves 4 roles: Intended Parents, Surrogate Mother, Egg/Sperm Donor, and Surrogacy Agency/Clinic.
3. Build Screen 1: Splash & Onboarding Carousel with top family photography and curved bottom sheet (Indicators: green pill + 2 dots, Skip & Next buttons).
4. Build Screen 2: Role Selector with SDC logo and 2x2 grid (Intending Parents, Surrogate, Donor, Agency).
5. Build Screen 3: Unified Login Screen with 4-way segmented role switcher (Parents, Surrogate, Donor, Agency), left-icon input fields, eye password toggle, and pill Login button.
6. Build Screen 4: Sectioned Multi-Step Registration Screen with dynamic role switcher, Section 1 Account, Section 2 Personal Info (side-by-side DOB & Nationality), and Section 3 Role-specific clinical/corporate traits from beefplan.md.
7. Build 4 distinct Bottom Navigation Bar layouts for Parents, Surrogates, Donors, and Agencies.
8. Connect all screens to the SDC backend API using the 61 customer endpoints in `sdc_postman_collection.json` with Bearer token authentication, GTBank UTR payment verification, and 12-stage candidate pipeline tracking.
9. Build the In-App Live API Debug Tray / Network Inspector: Add a bottom toggle button `[🛠️ Debug API Inspector]` accessible across all screens. When toggled, it expands a slide-up drawer displaying all wired APIs for the active role, full request URLs (`https://mydaddyonline.cloud/api/v1/...`), HTTP response status codes (e.g. 200, 401), latency in ms, sent payload, and formatted response JSON with a 1-click copy button.
10. Ensure zero lag, 120 FPS animations, clean responsive layouts, and proper error handling. Provide complete, runnable code files.
```
