Outiref

Code source de l'URL : http://www.ipercash.com

<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover, user-scalable=yes">
    
    <!-- META DESCRIPTION SEO -->
    <meta name="description" content="Envoyez de l'argent au Cameroun sans frais avec IPercash. Réception instantanée sur Orange Money et MTN Mobile Money. La nouvelle génération du transfert international.">
    <meta name="keywords" content="transfert argent Cameroun, Ipercash Cameroun, envoi mobile money, diaspora africaine, meilleure application transfert argent Afrique, envoyer argent Canada vers Cameroun, frais transfert internationaux, sécurité transfert argent, taux de change diaspora Afrique, money transfer Cameroon">
    <meta name="author" content="IPercash">
    <meta name="robots" content="index, follow">
    
    <!-- Google tag (gtag.js) -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-KE2TT1LRCN"></script>
    <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());
        gtag('config', 'G-KE2TT1LRCN');
    </script>
    
    <!-- HREFLANG MULTILINGUE -->
    <link rel="alternate" hreflang="fr" href="https://ipercash.com/">
    <link rel="alternate" hreflang="en" href="https://ipercash.com/en/">
    <link rel="alternate" hreflang="x-default" href="https://ipercash.com/">
    
<title>Transfert d'argent Cameroun sans frais | Orange Money & MTN MoMo | IPercash</title>
    
    <!-- PWA MANIFEST -->
    <link rel="manifest" href="/manifest.json">
    <meta name="theme-color" content="#C62828">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="apple-mobile-web-app-title" content="IPercash">
    <link rel="apple-touch-icon" href="/icon-192x192.png">
    
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700;14..32,800&display=swap" rel="stylesheet">
    
    <style>
        /* ========== STYLES GÉNÉRAUX ========== */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', sans-serif;
            background-color: #ffffff;
            color: #1E1E1E;
            scroll-behavior: smooth;
            overflow-x: hidden;
            width: 100%;
        }

        .container {
            max-width: 1280px;
            width: 100%;
            margin: 0 auto;
            padding: 0 20px;
        }

        /* ========== HEADER + MENU HAMBURGER ========== */
        .navbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 0;
            border-bottom: 1px solid #F0F0F0;
            position: relative;
        }

        .logo h1 {
            font-size: 24px;
            font-weight: 800;
            letter-spacing: -0.5px;
            color: #C62828;
        }
        .logo span {
            color: #1E1E1E;
            font-weight: 500;
        }
        .logo a {
            text-decoration: none;
        }

        /* Bouton hamburger (caché sur desktop) */
        .hamburger {
            display: none;
            background: none;
            border: none;
            font-size: 1.8rem;
            color: #C62828;
            cursor: pointer;
            z-index: 1001;
            transition: 0.2s;
        }
        .hamburger:hover {
            transform: scale(1.05);
        }

        /* Navigation desktop + mobile (retractable) */
        .nav-links {
            display: flex;
            gap: 16px;
            align-items: center;
            flex-wrap: wrap;
            transition: all 0.3s ease;
        }
        .nav-links a {
            text-decoration: none;
            font-weight: 500;
            color: #2D2D2D;
            transition: 0.2s;
            font-size: 0.85rem;
        }
        .nav-links a:hover {
            color: #C62828;
        }
        .nav-links a.active {
            color: #C62828;
            font-weight: 700;
        }
        .btn-outline {
            border: 1.5px solid #E0E0E0;
            padding: 6px 14px;
            border-radius: 40px;
            background: transparent;
            font-weight: 600;
            transition: 0.2s;
        }
        .btn-outline:hover {
            border-color: #C62828;
            background: #FFF5F5;
            color: #C62828;
        }
        .btn-red-light {
            background: #C62828;
            color: white !important;
            padding: 6px 16px;
            border-radius: 40px;
            font-weight: 600;
            transition: 0.2s;
            box-shadow: 0 2px 6px rgba(198,40,40,0.15);
        }
        .btn-red-light:hover {
            background: #B71C1C;
            transform: translateY(-1px);
        }
        
        .btn-install-app {
            background: linear-gradient(135deg, #C62828 0%, #B71C1C 100%);
            color: white !important;
            padding: 6px 16px;
            border-radius: 40px;
            font-weight: 600;
            font-size: 0.85rem;
            transition: all 0.2s ease;
            border: none;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            text-decoration: none;
        }
        .btn-install-app:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(198,40,40,0.3);
        }
        .btn-install-app i {
            font-size: 0.9rem;
        }
        .welcome-chip {
            background: #F8FAFC;
            border: 1px solid #E2E8F0;
            border-radius: 40px;
            padding: 6px 12px;
            font-size: 0.8rem;
            font-weight: 600;
            color: #334155;
        }

        /* ========== RESPONSIVE : MENU HAMBURGER ========== */
        @media (max-width: 768px) {
            .hamburger {
                display: block;
            }
            .nav-links {
                position: fixed;
                top: 80px;
                left: -100%;
                width: 80%;
                max-width: 300px;
                height: auto;
                background: white;
                flex-direction: column;
                align-items: flex-start;
                gap: 16px;
                padding: 24px 20px;
                box-shadow: 0 10px 25px rgba(0,0,0,0.1);
                border-radius: 20px;
                transition: left 0.3s ease;
                z-index: 1000;
                border: 1px solid #F0F0F0;
            }
            .nav-links.open {
                left: 20px;
            }
            .nav-links a, .nav-links .btn-outline, .nav-links .btn-red-light, .nav-links .btn-install-app, .nav-links .welcome-chip {
                width: 100%;
                text-align: left;
                padding: 10px 0;
            }
            .btn-outline, .btn-red-light, .btn-install-app {
                text-align: center;
                justify-content: center;
            }
        }

        /* ========== HERO ========== */
        .hero {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 30px;
            margin: 40px 0 48px 0;
        }
        .hero-left {
            flex: 1.2;
            min-width: 0;
            position: relative;
            border-radius: 28px;
            overflow: hidden;
            min-height: 480px;
        }
        .hero-video-bg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            z-index: 0;
        }
        .hero-video-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.3) 100%);
            z-index: 1;
        }
        .hero-left-content {
            position: relative;
            z-index: 2;
            background: transparent;
            padding: 30px 35px;
        }
        .hero-right {
            flex: 1;
            min-width: 0;
            background: #FFFFFF;
            border-radius: 28px;
            box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.12);
            border: 1px solid #EFEFEF;
            overflow: hidden;
        }
        .hero-badge {
            background: rgba(198, 40, 40, 0.85);
            backdrop-filter: blur(8px);
            color: white;
            display: inline-block;
            padding: 5px 12px;
            border-radius: 40px;
            font-size: 0.75rem;
            font-weight: 600;
            margin-bottom: 20px;
            border: 1px solid rgba(255,255,255,0.3);
        }
        .hero-left h2 {
            font-size: 2.2rem;
            font-weight: 800;
            line-height: 1.2;
            letter-spacing: -0.02em;
            color: white;
            margin-bottom: 16px;
            text-shadow: 0 2px 8px rgba(0,0,0,0.4);
        }
        .hero-left h2 .highlight {
            color: #FFA5A5;
            border-bottom: 3px solid #C62828;
            display: inline-block;
        }
        .hero-desc {
            font-size: 0.95rem;
            color: rgba(255,255,255,0.95);
            line-height: 1.5;
            margin-bottom: 24px;
            text-shadow: 0 1px 3px rgba(0,0,0,0.3);
        }
        .features-bullet {
            display: flex;
            gap: 16px;
            margin-bottom: 28px;
            flex-wrap: wrap;
        }
        .bullet-item {
            display: flex;
            align-items: center;
            gap: 6px;
            font-weight: 600;
            color: white;
            background: rgba(0,0,0,0.4);
            backdrop-filter: blur(8px);
            padding: 5px 12px;
            border-radius: 40px;
            font-size: 0.85rem;
            border: 1px solid rgba(255,255,255,0.2);
        }
        .bullet-item i {
            color: #FFA5A5;
            font-size: 0.9rem;
        }
        .hero-buttons {
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
        }
        .btn-primary {
            background: #C62828;
            color: white;
            padding: 10px 22px;
            border-radius: 44px;
            font-weight: 700;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            transition: 0.2s;
            box-shadow: 0 6px 14px rgba(198,40,40,0.25);
            font-size: 0.9rem;
        }
        .btn-primary:hover {
            background: #B71C1C;
            transform: translateY(-2px);
        }
        .btn-secondary {
            background: rgba(255,255,255,0.2);
            backdrop-filter: blur(8px);
            border: 1.5px solid rgba(255,255,255,0.5);
            color: white;
            padding: 10px 22px;
            border-radius: 44px;
            font-weight: 600;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: 0.2s;
            font-size: 0.9rem;
        }

        /* ========== TRANSFER CARD ========== */
        .transfer-card {
            padding: 24px;
        }
        .transfer-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            flex-wrap: wrap;
            gap: 10px;
        }
        .transfer-header h3 {
            font-size: 1.2rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .online-status {
            background: #E9F7EF;
            color: #1E7B48;
            padding: 3px 10px;
            border-radius: 60px;
            font-size: 0.65rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        .amount-section {
            background: #F9F9FB;
            border-radius: 20px;
            padding: 16px;
            margin-bottom: 16px;
            border: 1px solid #EFEFEF;
        }
        .amount-label {
            font-size: 0.75rem;
            text-transform: uppercase;
            font-weight: 600;
            color: #6B6B6B;
            letter-spacing: 0.5px;
            margin-bottom: 10px;
        }
        .amount-input {
            display: flex;
            align-items: baseline;
            flex-wrap: wrap;
            gap: 10px;
            border-bottom: 2px solid #E0E0E0;
            padding-bottom: 10px;
            margin-bottom: 8px;
        }
        .currency-symbol {
            font-size: 1.5rem;
            font-weight: 700;
            color: #1E1E1E;
        }
        .amount-input input {
            font-size: 1.6rem;
            font-weight: 700;
            border: none;
            background: transparent;
            outline: none;
            width: 150px;
            font-family: 'Inter', monospace;
            color: #111;
        }
        .rate-info {
            font-size: 0.7rem;
            color: #7c7c7c;
            display: flex;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 5px;
        }
        .recipient-card {
            background: #F9F9FB;
            border-radius: 20px;
            padding: 16px;
            margin-bottom: 16px;
            border: 1px solid #EFEFEF;
        }
        .recipient-row {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 12px;
        }
        .recipient-label {
            font-weight: 600;
            color: #3a3a3a;
            font-size: 0.85rem;
        }
        .recipient-value-group {
            display: flex;
            align-items: baseline;
            gap: 6px;
            flex-wrap: wrap;
            justify-content: flex-end;
        }
        .recipient-value-input {
            font-weight: 800;
            font-size: 1.3rem;
            color: #C62828;
            border: none;
            background: transparent;
            outline: none;
            text-align: right;
            font-family: 'Inter', monospace;
            width: 150px;
        }
        .xaf-currency {
            font-weight: 800;
            font-size: 1rem;
            color: #C62828;
        }
        .recipient-sub {
            font-size: 0.7rem;
            color: #777;
            margin-top: 4px;
        }
        .delivery-option {
            background: #F2F2F5;
            border-radius: 16px;
            padding: 10px 14px;
            margin: 12px 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-weight: 500;
            font-size: 0.85rem;
            flex-wrap: wrap;
            gap: 8px;
        }
        .instant-badge {
            background: #C62828;
            color: white;
            padding: 3px 10px;
            border-radius: 30px;
            font-size: 0.65rem;
            font-weight: 700;
        }
        .mobile-input-wrap {
            margin-top: 10px;
        }

        .mobile-phone-row {
            display: flex;
            gap: 10px;
            align-items: stretch;
            flex-wrap: wrap;
        }
        .mobile-phone-row .mobile-input {
            flex: 1;
            min-width: 140px;
        }
        .send-btn.send-btn-inline {
            width: auto;
            min-width: 100px;
            margin-top: 0;
            padding: 12px 18px;
            flex-shrink: 0;
        }
        .mobile-input {
            width: 100%;
            border: 1.5px solid #E1E1E1;
            border-radius: 14px;
            padding: 10px 14px;
            font-size: 0.9rem;
            outline: none;
            background: #fff;
        }
        .mobile-input:focus {
            border-color: #C62828;
            box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
        }
        .identity-status {
            margin-top: 8px;
            font-size: 0.78rem;
            color: #6b7280;
            min-height: 18px;
        }
        .send-btn {
            width: 100%;
            background: #C62828;
            border: none;
            color: white;
            padding: 14px;
            border-radius: 60px;
            font-weight: 800;
            font-size: 0.95rem;
            cursor: pointer;
            transition: 0.2s;
            margin-top: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        .send-btn:hover {
            background: #9e2a2a;
            transform: scale(0.98);
        }
        .small-note {
            font-size: 0.65rem;
            text-align: center;
            margin-top: 12px;
            color: #8e8e8e;
        }

        /* ========== ÉTAPES & DRAPEAUX ========== */
        .steps-section, .flags-section {
            margin: 40px 0;
            text-align: center;
        }
        .steps-section h2, .flags-section h2 {
            font-size: 1.6rem;
            font-weight: 700;
            margin-bottom: 24px;
            color: #111;
        }
        .steps-container, .flags-container {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 16px;
        }
        .step {
            background: #F9F9FB;
            border-radius: 20px;
            padding: 16px 20px;
            flex: 1;
            min-width: 160px;
            font-weight: 600;
            color: #C62828;
            border: 1px solid #EFEFEF;
            font-size: 0.9rem;
        }
        .flag-item {
            text-align: center;
            width: 70px;
        }
        .flag-item img {
            width: 40px;
            height: auto;
            transition: transform 0.2s;
        }
        .flag-item p {
            font-size: 0.7rem;
            margin-top: 6px;
            color: #555;
        }

        /* ========== SECTION PRÉSENTATION IPERCASH (conservée à l'identique) ========== */
        .presentation-section {
            margin: 40px 0;
            padding: 20px 0;
            background: #F9F9FC;
            border-radius: 32px;
        }
        .presentation-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 24px;
        }
        .presentation-title {
            text-align: center;
            font-size: 1.8rem;
            font-weight: 700;
            margin-bottom: 30px;
            color: #111;
        }
        .presentation-title .red {
            color: #C62828;
        }
        .presentation-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 40px;
            margin-bottom: 40px;
        }
        .presentation-text {
            flex: 2;
            min-width: 280px;
            font-size: 0.9rem;
            line-height: 1.5;
            color: #444;
        }
        .presentation-text p, .presentation-text li {
            font-size: 0.85rem;
            margin-bottom: 12px;
        }
        .presentation-text h2 {
            font-size: 1.3rem;
            font-weight: 700;
            margin: 0 0 16px;
            color: #111;
        }
        .presentation-text h3 {
            font-size: 1.1rem;
            font-weight: 700;
            margin: 24px 0 12px;
            color: #C62828;
        }
        .presentation-list {
            padding-left: 20px;
            margin-bottom: 20px;
        }
        .presentation-list li i {
            color: #C62828;
            margin-right: 8px;
        }
        .presentation-highlight {
            background: linear-gradient(135deg, #FFF0F0, #FFF9F9);
            border-left: 4px solid #C62828;
            padding: 16px 20px;
            border-radius: 16px;
            margin: 24px 0;
            display: flex;
            gap: 12px;
        }
        .presentation-stats {
            flex: 1;
            background: white;
            border-radius: 20px;
            padding: 20px;
            box-shadow: 0 8px 20px rgba(0,0,0,0.05);
        }
        .stat-card {
            text-align: center;
            padding: 16px;
            border-bottom: 1px solid #F0F0F0;
        }
        .stat-number {
            font-size: 1.6rem;
            font-weight: 800;
            color: #C62828;
        }
        .stat-label {
            font-size: 0.75rem;
            color: #666;
            margin-top: 5px;
        }
        .presentation-cta {
            text-align: center;
            margin-top: 32px;
            padding: 24px;
            background: #C62828;
            border-radius: 24px;
            color: white;
        }
        .presentation-cta .btn-primary {
            background: white;
            color: #C62828;
            padding: 8px 20px;
            box-shadow: none;
        }
        .presentation-cta .btn-primary:hover {
            background: #FFF5F5;
            transform: translateY(-2px);
        }

        /* ========== NOUVELLE SECTION RÉVOLUTION IPERCASH ========== */
        .revolution-section {
            margin: 50px 0 40px;
            padding: 40px;
            background: #F9F9FC;
            border-radius: 32px;
        }
        .revolution-section h1 {
            font-size: 2rem;
            font-weight: 800;
            margin-bottom: 24px;
            color: #111;
            text-align: center;
        }
        .revolution-section h2 {
            font-size: 1.5rem;
            font-weight: 700;
            margin: 32px 0 16px;
            color: #C62828;
        }
        .revolution-section h3 {
            font-size: 1.2rem;
            font-weight: 700;
            margin: 24px 0 12px;
            color: #C62828;
        }
        .revolution-section p {
            font-size: 1rem;
            line-height: 1.6;
            color: #444;
            margin-bottom: 16px;
        }
        .revolution-section ul {
            margin: 16px 0 16px 30px;
            color: #444;
            line-height: 1.6;
        }
        .revolution-section li {
            margin-bottom: 8px;
        }
        .revolution-section strong {
            color: #C62828;
        }
        .revolution-highlight {
            background: linear-gradient(135deg, #FFF0F0 0%, #FFF9F9 100%);
            border-left: 4px solid #C62828;
            padding: 20px 24px;
            border-radius: 16px;
            margin: 24px 0;
        }

        /* ========== TECHNOLOGIE BLOCKCHAIN ========== */
        .tech-banner {
            background: #FBFBFB;
            border-radius: 32px;
            padding: 30px 32px;
            margin: 50px 0;
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 24px;
        }
        .tech-badge {
            background: #1E1E1E;
            color: white;
            padding: 10px 22px;
            border-radius: 60px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        footer {
            border-top: 1px solid #F0F0F0;
            padding: 40px 0 28px;
            margin-top: 30px;
        }
        .footer-content {
            display: flex;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 24px;
        }
        .footer-copyright {
            color: #777;
            font-size: 0.75rem;
        }

        /* ========== RESPONSIVE ========== */
        @media (max-width: 768px) {
            .hero { flex-direction: column; }
            .hero-left h2 { font-size: 1.6rem; }
            .presentation-grid { flex-direction: column; }
            .steps-container { flex-direction: column; align-items: stretch; }
            .flags-container { gap: 12px; }
            .flag-item { width: 60px; }
            .presentation-title { font-size: 1.4rem; }
            .revolution-section { padding: 24px; }
            .revolution-section h1 { font-size: 1.5rem; }
            .revolution-section h2 { font-size: 1.3rem; }
        }
        @media (max-width: 550px) {
            .hero-left h2 { font-size: 1.3rem; }
            .amount-input { flex-direction: column; align-items: stretch; }
            .mobile-phone-row { flex-direction: column; }
            .send-btn.send-btn-inline { width: 100%; }
            .flag-item { width: 55px; }
            .flag-item img { width: 32px; }
        }
    .Style1 {color: #CC0000}
    .Style2 {color: #000000}
    .Style4 {color: #000000; font-weight: bold; }
    </style>
    
    <!-- JSON-LD FAQ -->
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "FAQPage",
      "mainEntity": [
        {
          "@type": "Question",
          "name": "Comment envoyer de l'argent au Cameroun avec Ipercash ?",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "Créez un compte, choisissez le montant, entrez les coordonnées du bénéficiaire, effectuez le paiement et l'argent est envoyé instantanément sur son Mobile Money."
          }
        },
        {
          "@type": "Question",
          "name": "Quels sont les frais de transfert Ipercash ?",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "Les frais sont compétitifs : 1,5% du montant envoyé, sans commission cachée. Jusqu'à 700€, aucun KYC complet n'est requis."
          }
        },
        {
          "@type": "Question",
          "name": "Qu'est-ce que la circularité de la valeur chez Ipercash ?",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "Contrairement aux plateformes classiques qui bloquent les devises à l'étranger, Ipercash permet une double circulation (diaspora → Cameroun ⇄ Cameroun → diaspora), renforçant la liquidité locale et la souveraineté monétaire camerounaise."
          }
        }
      ]
    }
    </script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<body>

<div class="container">
    <!-- HEADER AVEC MENU HAMBURGER -->
    <div class="navbar">
        <div class="logo">
            <a href="template_ipercash.php">
                <h1><img src="images/logo_small.png" alt="IPercash Logo"><span></span></h1>
            </a>
        </div>
        <button class="hamburger" id="hamburgerBtn" aria-label="Menu">
            <i class="fas fa-bars"></i>
        </button>
        <div class="nav-links" id="navLinks">
            <a href="template_ipercash.php" class="active">ACCUEIL</a>
            <a href="faq_ipercash.php">FAQ</a>
            <a href="pourquoinouschoisir_ipercash.php">POURQUOI NOUS CHOISIR ?</a>
            <a href="comparatif.php">COMPARATIF</a>
            <a href="comment-ca-marche.php">COMMENT ÇA MARCHE</a>
                            <a href="connexion_ipercash.php" class="btn-outline">CONNEXION</a>
                <a href="inscription_ipercash.php" class="btn-red-light">INSCRIPTION</a>
                <a href="#" class="btn-install-app">
                    <i class="fas fa-download"></i> Télécharger l'app
                </a>
                    </div>
    </div>

    <!-- HERO AVEC VIDÉO -->
    <div class="hero">
        <div class="hero-left">
            <video class="hero-video-bg" autoplay loop muted playsinline>
                <source src="images/douala.mp4" type="video/mp4">
                <source src="images/douala.webm" type="video/webm">
            </video>
            <div class="hero-video-overlay"></div>
            <div class="hero-left-content">
                <div class="hero-badge"><i class="fas fa-bolt"></i> Nouvelle génération</div>
                <h2>Les devises de la diaspora <br> doivent profiter au <span class="highlight">Cameroun</span><br> pas aux multinationales.</h2>
                <p class="hero-desc">IPERCash utilise la blockchain pour réinventer le transfert d'argent. Transparent, traçable, rapide et équitable.</p>
                <div class="features-bullet">
                    <div class="bullet-item"><i class="fas fa-check-circle"></i> Transparent</div>
                    <div class="bullet-item"><i class="fas fa-rocket"></i> Rapide</div>
                    <div class="bullet-item"><i class="fas fa-scale-balanced"></i> Équitable</div>
                </div>
                <div class="hero-buttons">
                                            <a href="connexion_ipercash.php" class="btn-primary">Commencer maintenant <i class="fas fa-arrow-right"></i></a>
                                        <a href="#" class="btn-secondary">En savoir plus <i class="fas fa-chevron-right"></i></a>
                </div>
            </div>
        </div>

        <div class="hero-right">
            <div class="transfer-card">
                <div class="transfer-header">
                    <h3><i class="fas fa-paper-plane" style="color:#C62828;"></i> Envoyez de l'argent</h3>
                    <div class="online-status"><i class="fas fa-circle"></i> En ligne</div>
                </div>
                <div class="amount-section">
                    <div class="amount-label">VOUS ENVOYEZ</div>
                    <div class="amount-input">
                        <span class="currency-symbol" id="sendCurrencySymbol">€</span>
                        <input type="number" id="sendAmount" value="100" step="10" min="10">
                        <select id="sendCurrency">
                            <option value="USD">USD</option>
                            <option value="EUR" selected>EUR</option>
                            <option value="GBP">GBP</option>
                            <option value="CAD">CAD</option>
                            <option value="CHF">CHF</option>
                        </select>
                    </div>
                    <div class="rate-info"><span id="rateInfoText">Taux compétitif</span><span><i class="fas fa-chart-line"></i> Marché</span></div>
                </div>
                <div class="recipient-card">
                    <div class="recipient-row">
                        <span class="recipient-label">LE BÉNÉFICIAIRE RÉCOIT</span>
                        <div class="recipient-value-group">
                            <input type="text" id="receiveAmountInput" class="recipient-value-input" value="327400" inputmode="numeric">
                            <span class="xaf-currency">XAF</span>
                        </div>
                    </div>
                    <div class="recipient-sub">via Mobile Money (Orange, MTN) ou retrait espèces</div>
                </div>
                <div class="delivery-option">
                    <span><i class="fas fa-mobile-alt"></i> Via Mobile Money</span>
                    <span class="instant-badge"><i class="fas fa-bolt"></i> Instané</span>
                </div>
                <div class="mobile-input-wrap">
                    <div class="mobile-phone-row">
                        <input type="tel" id="beneficiaryPhone" class="mobile-input" placeholder="Numéro bénéficiaire (ex: 6XXXXXXXX)" inputmode="numeric" maxlength="12">
                        <button type="button" class="send-btn send-btn-inline" id="verifyPhoneBtn"><i class="fas fa-user-check"></i> Vérifiez</button>
                    </div>
                    <div id="identityStatus" class="identity-status"></div>
                </div>
                <button class="send-btn" id="sendBtn"><i class="fas fa-send"></i> Envoyez maintenant</button>
                <div class="small-note"><i class="fas fa-lock"></i> Transaction sécurisée par USDC-BASE et USDT-BEP20 • Sans KYC complet jusqu'à 700€</div>
            </div>
        </div>
    </div>

    <!-- ÉTAPES DU TRANSFERT -->
    <div class="steps-section">
        <h2>Comment envoyer de l'argent au Cameroun avec <strong>IPER<span class="Style1">Cash</span></strong> ?</h2>
        <div class="steps-container">
            <div class="step">1. Créer un compte</div>
            <div class="step">2. Renseignez le numéro de téléphone du destinataire</div>
            <div class="step">3. Vérifiez son identité</div>
            <div class="step">4. Effectuer le paiement</div>
            <div class="step">5. Le bénéficiaire reçoit l'argent sur OM ou Momo</div>
        </div>
    </div>

    <!-- DRAPEAUX PAYS CIBLES -->
    <div class="flags-section">
        <div class="flags-container">
            <div class="flag-item"><img src="drapeaux/canada.png" alt="Envoyer de l'argent depuis le Canada vers le Cameroun" loading="lazy"><p>Canada</p></div>
            <div class="flag-item"><img src="drapeaux/france.png" alt="Envoyer de l'argent depuis la France vers le Cameroun" loading="lazy"><p>France</p></div>
            <div class="flag-item"><img src="drapeaux/USA.png" alt="Money transfer from USA to Cameroon" loading="lazy"><p>États-Unis</p></div>
            <div class="flag-item"><img src="drapeaux/allemagne.png" alt="Transfert d'argent depuis l'Allemagne vers le Cameroun" loading="lazy"><p>Allemagne</p></div>
            <div class="flag-item"><img src="drapeaux/UK.png" alt="Send money from UK to Cameroon" loading="lazy"><p>Royaume-Uni</p></div>
            <div class="flag-item"><img src="drapeaux/suisse.png" alt="Envoyer de l'argent depuis la Suisse vers le Cameroun" loading="lazy"><p>Suisse</p></div>
        </div>
    </div>

    <!-- SECTION PRÉSENTATION IPERCASH (conservée à l'identique) -->
    <section class="presentation-section">
        <div class="presentation-container">
            <h1 class="presentation-title">IPER<span class="Style1">Cash</span> : <span class="red">Transfert d'argent</span> nouvelle génération vers le Cameroun et l'Afrique</h1>
            <div class="presentation-grid">
                <div class="presentation-text">
                    <h2>Envoyez de l'argent au Cameroun <strong>instantanément</strong> et <strong>sans frais</strong></h2>
                    <p><strong>IPER<span class="Style1">Cash</span></strong> est la <strong>meilleure application de transfert d'argent vers l'Afrique</strong>. Grâce à la technologie <strong>blockchain</strong> et aux stablecoins <strong>USDC (BASE)</strong> et <strong>USDT (BEP-20)</strong>, nous proposons des transferts <strong>rapides, transparents et équitables</strong>.</p>
                    
                    <h3>Pourquoi choisir <span class="Style2">IPER</span>Cash pour vos transferts ?</h3>
                    <ul class="presentation-list">
                        <li><i class="fas fa-check-circle"></i> <strong>Transfert d'argent instantané</strong> – Le bénéficiaire reçoit en moins de 5 minutes</li>
                        <li><i class="fas fa-check-circle"></i> <strong>Frais de transfert internationaux compétitifs</strong> – Zéro frais</li>
                        <li><i class="fas fa-check-circle"></i> <strong>Sécurité des transferts d'argent en ligne</strong> – 100% blockchain, traçable et infalsifiable</li>

                        <li><i class="fas fa-check-circle"></i> <strong>Sans KYC complet jusqu'à 700€</strong> – FastTrack Mercury pour les petits montants</li>
                        <li><i class="fas fa-check-circle"></i> <strong>Taux de change diaspora Afrique avantageux</strong> – 672 FCFA pour 1 EUR</li>
                    </ul>
                    
                    <h3>Une circularité de la valeur réelle</h3>
                    <p>Contrairement aux plateformes classiques qui créent une <strong>sortie asymétrique de valeur</strong> (la devise reste à l'étranger), <strong>IPER<span class="Style1">Cash</span></strong> agit en circuit fermé. Grâce à la <strong>double circulation</strong> (diaspora → Cameroun ⇄ Cameroun → diaspora), les devises étrangères ne sont pas « bloquées » : elles circulent aussi bien vers l'intérieur que vers l'extérieur, renforçant la liquidité locale et la <strong>souveraineté monétaire camerounaise</strong>.</p>
                    
                    <div class="presentation-highlight">
                        <i class="fas fa-sync-alt"></i>
                        <p><strong>Faire circuler la valeur, pas seulement l'argent.</strong> Chaque euro ou dollar envoyé ne se contente pas d'atteindre un proche : il alimente l'économie, soutient des entrepreneurs et crée des emplois, plutôt que de faire des profits pour des intermédiaires étrangers. <strong>IPER<span class="Style1">Cash</span> inverse cette logique.</strong></p>
                    </div>
                </div>
                
                <div class="presentation-stats">
                    <h3>Les chiffres</h3>
                    <div class="stat-card"><div class="stat-number">557 Mds</div><div class="stat-label">F CFA envoyés via mobile-money en zone CEMAC (2023)</div></div>
                    <div class="stat-card"><div class="stat-number">75%</div><div class="stat-label">du volume concentré au Cameroun</div></div>
                    <div class="stat-card"><div class="stat-number">603 M$</div><div class="stat-label">USD reçus par la diaspora au Cameroun (2024)</div></div>
                    <div class="stat-card">
                      <div class="stat-number">avec <span class="Style2">IPER</span>Cash 672 FCFA</div>
                      <div class="stat-label">pour 1 EUR – le meilleur taux du marché</div></div>
                </div>
            </div>
            
            <div class="presentation-cta">
                <p><strong>Envoyez de l'argent au Cameroun dès maintenant avec IPercash</strong> – La meilleure application de transfert d'argent vers l'Afrique.</p>
                <p>&nbsp;</p>
                <a href="connexion_ipercash.php" class="btn-primary">Commencer un transfert <i class="fas fa-arrow-right"></i></a>
            </div>
        </div>
    </section>

    <!-- NOUVELLE SECTION RÉVOLUTION IPERCASH -->
    <div class="revolution-section">
        <h1>Pourquoi IPER<span class="Style1">Cash</span> révolutionne le transfert d'argent vers le Cameroun</h1>
        
        <p><strong>Envoyer de l’argent au Cameroun ne devrait pas être lent, coûteux ou inefficace.</strong><br>
        Pourtant, pendant des décennies, les solutions existantes ont empêché une circulation fluide de la valeur entre la diaspora et les économies locales.</p>
        
        <p>IPercash marque une rupture : nous sommes la <strong>troisième génération du transfert d’argent international</strong>, celle qui permet enfin une circulation réelle, instantanée et sans frais de la valeur.</p>
        
        <h2>Première génération : les acteurs historiques du transfert</h2>
        <p>La première génération est dominée par des réseaux comme Western Union, MoneyGram ou encore Ria Money Transfer.</p>
        <p>Leur modèle repose sur :</p>
        <ul>
            <li>des réseaux physiques</li>
            <li>des agences de retrait</li>
            <li>des intermédiaires multiples</li>
        </ul>
        <p><strong>Conséquences pour l’utilisateur :</strong></p>
        <ul>
            <li>frais élevés</li>
            <li>taux de change défavorables</li>
            <li>déplacements obligatoires pour le bénéficiaire</li>
            <li>délais parfois longs</li>
        </ul>
        <p>Dans ce modèle, la valeur est lente, coûteuse et fragmentée.</p>
        
        <h2>Deuxième génération : les fintechs du transfert</h2>
        <p>Des acteurs comme TapTapSend, Sendwave, NALA ou LemFi ont introduit une amélioration majeure : la digitalisation.</p>
        <p>Leur promesse :</p>
        <ul>
            <li>envoyer de l’argent en ligne</li>
            <li>simplifier l’expérience utilisateur</li>
            <li>accélérer les transactions</li>
        </ul>
        <p>Mais un problème fondamental demeure :</p>
        <div class="revolution-highlight">
            <strong>&gt;  la valeur ne circule pas réellement</strong>        </div>
        <p>En pratique :</p>
        <ul>
            <li>l’argent envoyé par la diaspora est compensé localement</li>
            <li>les devises (euros, dollars) restent à l’étranger</li>
            <li>elles ne sont pas remises à disposition des économies locales</li>
        </ul>
        <p><strong>Résultat :</strong><br>
        - ces solutions améliorent l’expérience utilisateur<br>
        - mais ne transforment pas la circulation économique réelle</p>
        
        <h2>Troisième génération : <span class="Style4">IPER<span class="Style1">Cash</span></span> et la circulation réelle de la valeur</h2>
        <p>IPercash introduit un modèle totalement nouveau basé sur les stablecoins (USDT et USDC).</p>
      <p>Ici, la valeur ne se contente pas d’être simulée : <strong> elle circule réellement</strong></p>
        <p>Concrètement :</p>
        <ul>
            <li>les fonds transitent instantanément à l’échelle mondiale</li>
            <li>ils sont disponibles localement sans friction</li>
            <li>aucune perte de valeur dans le processus</li>
        </ul>
        
        <h3>Zéro frais, zéro friction</h3>
        <p>Avec <strong><span class="Style2">IPER<span class="Style1">Cash</span></span></strong> :</p>
        <ul>
            <li>aucun frais de transfert</li>
            <li>aucun coût caché</li>
            <li>aucune commission intermédiaire</li>
        </ul>
        
        <h3>Un taux de change extrêmement compétitif</h3>
        <p>Grâce à notre infrastructure :</p>
        <ul>
            <li>accès à des taux proches du marché réel</li>
            <li>optimisation maximale pour l’expéditeur et le bénéficiaire</li>
            <li>plus de perte invisible sur le change</li>
        </ul>
        
        <h2>Transfert direct vers Orange Money et MTN Mobile Money Cameroun</h2>
        <p>IPercash est conçu pour la réalité africaine.</p>
        <p>Vos transferts arrivent directement sur :</p>
        <ul>
            <li><strong>Orange Money Cameroun</strong></li>
            <li><strong>MTN Mobile Money Cameroun</strong></li>
        </ul>
        <p><strong>Avantages immédiats :</strong></p>
        <ul>
            <li>réception en quelques minutes</li>
            <li>aucun déplacement nécessaire</li>
            <li>utilisation directe (paiement, retrait, transfert)</li>
        </ul>
        
        <h2>Envoyer de l'argent au Cameroun n'a jamais été aussi simple</h2>
        <p>Que vous soyez en Europe, aux États-Unis ou ailleurs, IPercash vous permet de :</p>
        <ul>
            <li>envoyer de l’argent au Cameroun instantanément</li>
            <li>transférer vers Orange Money Cameroun</li>
            <li>envoyer vers MTN Mobile Money Cameroun</li>
            <li>éviter les frais de transfert internationaux</li>
            <li>bénéficier du meilleur taux de change</li>
        </ul>
        
        <h2><span class="Style4">IPER</span><strong>Cash</strong> : la dernière génération du transfert international</h2>
        <p>Après :</p>
        <ul>
            <li>les réseaux physiques coûteux</li>
            <li>les fintechs digitales sans circulation réelle de valeur</li>
        </ul>
        <div class="revolution-highlight">
            <strong> Voici la troisième génération : un transfert instantané, sans frais, avec circulation réelle de la valeur</strong>        </div>
        
        <h2>Passez à la nouvelle génération</h2>
        <p>IPercash n’est pas une amélioration.<br>
        C’est une transformation complète du transfert d’argent vers le Cameroun.</p>
        <p><strong>Envoyez. Recevez. Utilisez.</strong><br>
        Sans frais. Sans délai. Sans compromis.</p>
    </div>

    <!-- TECHNOLOGIE BLOCKCHAIN -->
    <div class="tech-banner">
        <div class="tech-text"><h3><i class="fas fa-link" style="color:#C62828;"></i> Sécurisé par la blockchain</h3><p>USDC sur BASE et USDT sur BEP-20 — rapidité et sécurité.</p></div>
        <div class="tech-badge"><i class="fab fa-bitcoin"></i> <span>USDC • USDT</span> <i class="fas fa-shield-alt"></i></div>
    </div>

    <!-- FASTTRACK MERCURY -->
    <div style="background:#FEF8F8; border-radius:24px; padding:20px 24px; margin:20px 0; border-left:5px solid #C62828;">
        <div style="display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px;">
            <div><h4 style="font-weight:800;">⚡ FastTrack Mercury</h4><p style="color:#333;">Jusqu'à 700 € sans KYC complet. Envoyez en quelques minutes.</p></div>
            <div style="background:white; padding:6px 14px; border-radius:40px; color:#C62828;"><i class="fas fa-bolt"></i> 100% numérique</div>
        </div>
    </div>

    <!-- FOOTER -->
    <footer>
        <div class="footer-content">
            <div><div class="logo"><h1><img src="images/logo_small.png" width="164" height="50" alt="IPercash Logo"></h1></div><p style="max-width:280px; color:#5A5A5A; font-size:0.8rem;">Transfert d'argent nouvelle génération. Transparence, rapidité, équité.</p></div>
            <div><h4 style="font-size:1rem;">Liens utiles</h4><p><a href="#" style="color:#C62828;">FAQ</a></p><p><a href="legal_document.php?doc=cgu" style="color:#C62828;">Conditions générales</a></p><p><a href="faq_ipercash.php" style="color:#C62828;">Sécurité blockchain</a></p></div>
            <div><h4 style="font-size:1rem;">Contact</h4><p><i class="fas fa-envelope"></i> support@ipercash.com</p><p><i class="fas fa-phone-alt"></i> +237 650 123 456</p></div>
        </div>
        <div class="footer-copyright" style="margin-top:40px; text-align:center;">© 2026 IPERCASH - Tous droits réservés.</div>
    </footer>
</div>

<script>
// Menu hamburger toggle
const hamburger = document.getElementById('hamburgerBtn');
const navLinks = document.getElementById('navLinks');
if (hamburger && navLinks) {
    hamburger.addEventListener('click', () => {
        navLinks.classList.toggle('open');
        const icon = hamburger.querySelector('i');
        if (navLinks.classList.contains('open')) {
            icon.classList.remove('fa-bars');
            icon.classList.add('fa-times');
        } else {
            icon.classList.remove('fa-times');
            icon.classList.add('fa-bars');
        }
    });
    document.addEventListener('click', (event) => {
        if (!navLinks.contains(event.target) && !hamburger.contains(event.target) && navLinks.classList.contains('open')) {
            navLinks.classList.remove('open');
            const icon = hamburger.querySelector('i');
            icon.classList.remove('fa-times');
            icon.classList.add('fa-bars');
        }
    });
}

// ========== FONCTIONNALITÉS MÉTIER (vérificateur d'identité mmgate) ==========
(function() {
    const RATE_MARKUP = {"EUR":1.0063,"USD":1.003,"CAD":1.015,"GBP":1.003,"CHF":1.003};
    const POLL_MS = 1000;
    const MAX_TRIES = 90;

    const sendAmountInput = document.getElementById('sendAmount');
    const sendCurrencySelect = document.getElementById('sendCurrency');
    const sendCurrencySymbol = document.getElementById('sendCurrencySymbol');
    const rateInfoText = document.getElementById('rateInfoText');
    const receiveAmountInput = document.getElementById('receiveAmountInput');
    const sendButton = document.getElementById('sendBtn');
    const verifyPhoneBtn = document.getElementById('verifyPhoneBtn');
    const beneficiaryPhoneInput = document.getElementById('beneficiaryPhone');
    const identityStatus = document.getElementById('identityStatus');
    const isLoggedIn = false;

    let verifiedIdentity = null;
    let verifyToken = 0;
    let lastEditedAmount = 'send';
    let currentRateToXaf = 654.8;
    const rateCache = new Map();
    const CURRENCY_SYMBOLS = { USD:'$', EUR:'€', GBP:'£', CAD:'$', CHF:'CHF' };

    function normalizeMomoAmount(xaf) {
        const n = Math.floor(Number(xaf) || 0);
        return n <= 0 ? 0 : Math.floor(n / 10) * 10;
    }

    async function fetchRateToXaf(currency) {
        const now = Date.now();
        const hit = rateCache.get(currency);
        if (hit && now - hit.ts < 120000) return hit.rate;
        try {
            const url = `https://api.exchangerate-api.com/v4/latest/${encodeURIComponent(currency)}`;
            const res = await fetch(url, { cache: 'no-store' });
            if (!res.ok) throw new Error();
            const payload = await res.json();
            const rate = Number(payload?.rates?.XAF || 0);
            if (rate > 0) rateCache.set(currency, { rate, ts: now });
            return rate || currentRateToXaf;
        } catch(e) { return currentRateToXaf; }
    }

    function markupFor(currency) {
        const m = RATE_MARKUP[currency || 'EUR'];
        return typeof m === 'number' && m > 0 ? m : 1;
    }

    async function refreshRateAndRecalc() {
        const currency = sendCurrencySelect.value || 'EUR';
        sendCurrencySymbol.textContent = CURRENCY_SYMBOLS[currency] || currency;
        try {
            currentRateToXaf = await fetchRateToXaf(currency);
            const eff = currentRateToXaf * markupFor(currency);
            rateInfoText.textContent = `1 ${currency} ≈ ${eff.toFixed(2)} XAF (cours ajusté)`;
        } catch(_) {
            const eff = currentRateToXaf * markupFor(currency);
            rateInfoText.textContent = `1 ${currency} ≈ ${eff.toFixed(2)} XAF (estimation)`;
        }
        updateTransfer(lastEditedAmount);
    }

    function parseAmountInput(value) {
        const cleaned = String(value || '').replace(/[^\d.,]/g, '').replace(',', '.');
        const n = parseFloat(cleaned);
        return Number.isFinite(n) ? n : 0;
    }

    function formatCfaDisplay(value) {
        const n = Math.max(0, Math.floor(Number(value) || 0));
        return n.toLocaleString('fr-FR').replace(/\u202f/g, ' ');
    }

    function updateTransfer(from) {
        const currency = sendCurrencySelect.value || 'EUR';
        const effectiveRate = currentRateToXaf * markupFor(currency);
        if (from === 'receive') {
            let receiveXaf = parseAmountInput(receiveAmountInput.value);
            if (isNaN(receiveXaf)) receiveXaf = 0;
            const normalized = normalizeMomoAmount(receiveXaf);
            receiveAmountInput.value = formatCfaDisplay(normalized);
            let computedSend = effectiveRate > 0 ? normalized / effectiveRate : 0;
            sendAmountInput.value = computedSend.toFixed(2);
        } else {
            let amount = parseFloat(sendAmountInput.value);
            if (isNaN(amount)) amount = 0;
            const xafAmount = normalizeMomoAmount(amount * effectiveRate);
            receiveAmountInput.value = formatCfaDisplay(xafAmount);
        }
    }

    function normalizePhone(value) {
        const digits = (value || '').replace(/\D/g, '');
        if (digits.startsWith('237') && digits.length >= 12) return digits.slice(3, 12);
        if (digits.length >= 9) return digits.slice(-9);
        return digits;
    }

    function deepFindStringKey(obj, wantedUpper, depth) {
        if (!obj || typeof obj !== 'object' || depth > 5) return '';
        for (const [k, v] of Object.entries(obj)) {
            if (String(k).toUpperCase() === wantedUpper && typeof v === 'string' && v.trim()) return v.trim();
            if (v && typeof v === 'object') {
                const found = deepFindStringKey(v, wantedUpper, depth + 1);
                if (found) return found;
            }
        }
        return '';
    }

    function deepFindAnyKey(obj, wantedUpper, depth) {
        if (!obj || typeof obj !== 'object' || depth > 5) return null;
        for (const [k, v] of Object.entries(obj)) {
            if (String(k).toUpperCase() === wantedUpper) return v;
            if (v && typeof v === 'object') {
                const found = deepFindAnyKey(v, wantedUpper, depth + 1);
                if (found !== null) return found;
            }
        }
        return null;
    }

    function setIdentityMessage(text, type) {
        if (!identityStatus) return;
        identityStatus.className = 'identity-status';
        if (type === 'ok') identityStatus.classList.add('ok');
        if (type === 'err') identityStatus.classList.add('err');
        if (type === 'info') identityStatus.classList.add('info');
        identityStatus.textContent = text || '';
    }

    async function fetchPhpJson(path, params) {
        const url = new URL(`/api/${path}`, window.location.origin);
        Object.entries(params || {}).forEach(([k, v]) => url.searchParams.set(k, String(v)));
        url.searchParams.set('_ts', Date.now());
        const res = await fetch(url, { cache: 'no-store' });
        const raw = await res.text();
        if (!res.ok) throw new Error(`HTTP ${res.status}`);
        let parsed;
        try { parsed = JSON.parse(raw); } catch { throw new Error('Réponse API invalide'); }
        return parsed?.data !== undefined ? parsed.data : parsed;
    }

    async function verifyIdentityForPhone(rawPhone) {
        const currentToken = ++verifyToken;
        const expo = normalizePhone(rawPhone);
        verifiedIdentity = null;
        if (expo.length < 9) { setIdentityMessage('Numéro invalide', 'err'); return; }
        if (verifyPhoneBtn) verifyPhoneBtn.disabled = true;
        setIdentityMessage('Vérification...', 'info');
        let insert;
        try { insert = await fetchPhpJson('mmgate_insertidentite.php', { expo }); } catch(e) {
            if (currentToken !== verifyToken) return;
            setIdentityMessage('Erreur vérification', 'err');
            if (verifyPhoneBtn) verifyPhoneBtn.disabled = false;
            return;
        }
        if (currentToken !== verifyToken) return;
        if (!insert || Number(insert.ETAT) !== 300 || !insert.IDOPE) {
            setIdentityMessage('Numéro non vérifié', 'err');
            if (verifyPhoneBtn) verifyPhoneBtn.disabled = false;
            return;
        }
        for (let i = 1; i <= MAX_TRIES; i++) {
            if (currentToken !== verifyToken) return;
            setIdentityMessage(`Vérification nom (${i}/${MAX_TRIES})`, 'info');
            try {
                const verif = await fetchPhpJson('mmgate_verifidentite.php', { idope: insert.IDOPE, expo });
                if (currentToken !== verifyToken) return;
                const nom = deepFindStringKey(verif, 'NOMPRB', 0);
                if (nom) {
                    verifiedIdentity = { phone: expo, name: nom, id: deepFindAnyKey(verif, 'IDTEMPORAIRE', 0) };
                    setIdentityMessage(`Identité vérifiée: ${nom}`, 'ok');
                    if (verifyPhoneBtn) verifyPhoneBtn.disabled = false;
                    return;
                }
            } catch {}
            await new Promise(r => setTimeout(r, POLL_MS));
        }
        setIdentityMessage('Vérification non confirmée', 'err');
        if (verifyPhoneBtn) verifyPhoneBtn.disabled = false;
    }

    function isIdentityVerifiedForExpo(expo) {
        return verifiedIdentity && normalizePhone(verifiedIdentity.phone) === expo && verifiedIdentity.name?.trim();
    }

    if (sendAmountInput) sendAmountInput.addEventListener('input', () => { lastEditedAmount = 'send'; updateTransfer('send'); });
    if (sendCurrencySelect) sendCurrencySelect.addEventListener('change', refreshRateAndRecalc);
    if (receiveAmountInput) receiveAmountInput.addEventListener('input', () => { lastEditedAmount = 'receive'; updateTransfer('receive'); });
    if (beneficiaryPhoneInput) {
        beneficiaryPhoneInput.addEventListener('input', function() {
            this.value = this.value.replace(/\D/g, '').slice(0, 12);
            verifiedIdentity = null;
            setIdentityMessage('', null);
        });
    }
    if (verifyPhoneBtn) verifyPhoneBtn.addEventListener('click', () => verifyIdentityForPhone(beneficiaryPhoneInput.value));

    if (sendButton) {
        sendButton.addEventListener('click', async function(e) {
            e.preventDefault();
            let amount = parseFloat(sendAmountInput.value);
            if (isNaN(amount) || amount <= 0) { alert("Montant invalide"); return; }
            if (!isLoggedIn) {
                window.location.assign('connexion_ipercash.php?next=' + encodeURIComponent(window.location.href));
                return;
            }
            const expo = normalizePhone(beneficiaryPhoneInput?.value || '');
            if (expo.length < 9) { setIdentityMessage('Numéro bénéficiaire requis', 'err'); if(beneficiaryPhoneInput) beneficiaryPhoneInput.focus(); return; }
            if (!isIdentityVerifiedForExpo(expo)) {
                setIdentityMessage('Vérification identité requise', 'info');
                await verifyIdentityForPhone(beneficiaryPhoneInput.value);
                if (!isIdentityVerifiedForExpo(expo)) {
                    setIdentityMessage('Vérifiez le nom du bénéficiaire', 'err');
                    if(beneficiaryPhoneInput) beneficiaryPhoneInput.focus();
                    return;
                }
            }
            const cur = sendCurrencySelect.value || 'EUR';
            const finalXAF = normalizeMomoAmount(amount * currentRateToXaf * markupFor(cur));
            sendButton.disabled = true;
            const originalLabel = sendButton.innerHTML;
            sendButton.innerHTML = '<i class="fas fa-circle-notch fa-spin"></i> Préparation...';
            setIdentityMessage('Création commande paiement...', 'info');
            try {
                const payload = { expo, monto: finalXAF, fiatCurrency: cur, fiatAmount: amount, currency: 'USDC' };
                const res = await fetch('/api/payment_create_order.php', {
                    method: 'POST',
                    headers: { 'Content-Type': 'application/json' },
                    body: JSON.stringify(payload),
                });
                const data = await res.json();
                if (!res.ok || !data?.widgetUrl) throw new Error(data?.error || 'Erreur création commande');
                window.location.assign(data.widgetUrl);
            } catch (err) {
                setIdentityMessage('Erreur paiement: ' + err.message, 'err');
                sendButton.disabled = false;
                sendButton.innerHTML = originalLabel;
            }
        });
    }

    function syncAmountsNow() { updateTransfer(lastEditedAmount); setTimeout(() => updateTransfer(lastEditedAmount), 50); }
    window.addEventListener('pageshow', syncAmountsNow);
    window.addEventListener('focus', syncAmountsNow);
    refreshRateAndRecalc().finally(syncAmountsNow);
})();

// PWA Installation
if ('serviceWorker' in navigator) navigator.serviceWorker.register('/sw.js').catch(e => console.log('SW error:', e));
let deferredPrompt;
const installBtn = document.getElementById('installPwaBtn');
window.addEventListener('beforeinstallprompt', (e) => { e.preventDefault(); deferredPrompt = e; if (installBtn) installBtn.style.display = 'inline-flex'; });
if (installBtn) installBtn.addEventListener('click', async () => {
    if (deferredPrompt) { deferredPrompt.prompt(); const { outcome } = await deferredPrompt.userChoice; console.log(outcome); deferredPrompt = null; installBtn.style.display = 'none'; }
    else alert('Pour installer : Menu ⋮ → "Ajouter à l\'écran d\'accueil" (Android) ou Partager → "Sur l\'écran d\'accueil" (iOS)');
});
window.addEventListener('appinstalled', () => { if (installBtn) installBtn.style.display = 'none'; deferredPrompt = null; });
</script>
</body>
</html>