<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Inscription - <?= APP_NAME ?></title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        body { font-family: 'Inter', sans-serif; }
        .input-focus:focus { box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15); }
    </style>
</head>
<body class="bg-slate-900 min-h-screen flex">
    
    <!-- Left Side - Branding -->
    <div class="hidden lg:flex lg:w-1/2 bg-gradient-to-br from-slate-800 to-slate-900 relative overflow-hidden">
        <!-- Decorative Elements -->
        <div class="absolute top-20 left-20 w-72 h-72 bg-cyan-500/10 rounded-full blur-3xl"></div>
        <div class="absolute bottom-20 right-20 w-96 h-96 bg-emerald-500/10 rounded-full blur-3xl"></div>
        
        <div class="relative z-10 flex flex-col justify-center px-16">
            <!-- Logo -->
            <div class="flex items-center space-x-4 mb-12">
                <div class="w-14 h-14 bg-gradient-to-br from-cyan-500 to-emerald-500 rounded-2xl flex items-center justify-center shadow-lg shadow-cyan-500/30">
                    <i class="fas fa-headset text-white text-2xl"></i>
                </div>
                <span class="text-3xl font-bold text-white"><?= APP_NAME ?></span>
            </div>
            
            <!-- Tagline -->
            <h1 class="text-4xl xl:text-5xl font-bold text-white leading-tight mb-6">
                Rejoignez la<br>
                <span class="bg-gradient-to-r from-cyan-400 to-emerald-400 bg-clip-text text-transparent">Révolution Client</span>
            </h1>
            
            <p class="text-slate-400 text-lg mb-12 max-w-md">
                Créez votre compte et transformez votre service client avec notre plateforme intelligente.
            </p>
            
            <!-- Benefits -->
            <div class="space-y-4">
                <div class="flex items-center space-x-3 text-slate-300">
                    <div class="w-8 h-8 bg-cyan-500/20 rounded-lg flex items-center justify-center">
                        <i class="fas fa-check text-cyan-400 text-sm"></i>
                    </div>
                    <span>Configuration en moins de 5 minutes</span>
                </div>
                <div class="flex items-center space-x-3 text-slate-300">
                    <div class="w-8 h-8 bg-emerald-500/20 rounded-lg flex items-center justify-center">
                        <i class="fas fa-check text-emerald-400 text-sm"></i>
                    </div>
                    <span>Essai gratuit sans engagement</span>
                </div>
                <div class="flex items-center space-x-3 text-slate-300">
                    <div class="w-8 h-8 bg-blue-500/20 rounded-lg flex items-center justify-center">
                        <i class="fas fa-check text-blue-400 text-sm"></i>
                    </div>
                    <span>Support dédié pour démarrer</span>
                </div>
            </div>
        </div>
    </div>
    
    <!-- Right Side - Register Form -->
    <div class="w-full lg:w-1/2 flex items-center justify-center p-8">
        <div class="w-full max-w-md">
            <!-- Mobile Logo -->
            <div class="lg:hidden flex items-center justify-center space-x-3 mb-8">
                <div class="w-12 h-12 bg-gradient-to-br from-cyan-500 to-emerald-500 rounded-xl flex items-center justify-center">
                    <i class="fas fa-headset text-white text-xl"></i>
                </div>
                <span class="text-2xl font-bold text-white"><?= APP_NAME ?></span>
            </div>
            
            <!-- Form Card -->
            <div class="bg-slate-800/50 backdrop-blur-xl rounded-3xl p-8 border border-slate-700/50 shadow-2xl">
                <div class="text-center mb-8">
                    <h2 class="text-2xl font-bold text-white mb-2">Créer un compte</h2>
                    <p class="text-slate-400">Commencez votre essai gratuit</p>
                </div>
                
                <?php if (!empty($error)): ?>
                    <div class="mb-6 p-4 bg-red-500/10 border border-red-500/30 text-red-400 rounded-xl text-center text-sm">
                        <i class="fas fa-exclamation-circle mr-2"></i><?= htmlspecialchars($error) ?>
                    </div>
                <?php endif; ?>
                
                <?php if (!empty($success)): ?>
                    <div class="mb-6 p-4 bg-emerald-500/10 border border-emerald-500/30 text-emerald-400 rounded-xl text-center text-sm">
                        <i class="fas fa-check-circle mr-2"></i><?= htmlspecialchars($success) ?>
                    </div>
                <?php endif; ?>
                
                <form action="<?= BASE_URL ?>/auth/register" method="POST" class="space-y-4">
                    <input type="hidden" name="csrf_token" value="<?= $csrf_token ?? '' ?>">
                    
                    <!-- Nom de l'entreprise -->
                    <div>
                        <label class="block text-slate-300 text-sm font-medium mb-2" for="entreprise">
                            Nom de l'entreprise
                        </label>
                        <div class="relative">
                            <span class="absolute inset-y-0 left-0 pl-4 flex items-center text-slate-500">
                                <i class="fas fa-building"></i>
                            </span>
                            <input type="text" id="entreprise" name="entreprise" required
                                   class="w-full pl-12 pr-4 py-3.5 bg-slate-700/50 border border-slate-600/50 rounded-xl text-white placeholder-slate-500 focus:border-cyan-500 focus:outline-none input-focus transition"
                                   placeholder="Votre entreprise">
                        </div>
                    </div>
                    
                    <!-- Nom et Prénom -->
                    <div class="grid grid-cols-2 gap-4">
                        <div>
                            <label class="block text-slate-300 text-sm font-medium mb-2" for="prenom">
                                Prénom
                            </label>
                            <input type="text" id="prenom" name="prenom" required
                                   class="w-full px-4 py-3.5 bg-slate-700/50 border border-slate-600/50 rounded-xl text-white placeholder-slate-500 focus:border-cyan-500 focus:outline-none input-focus transition"
                                   placeholder="Prénom">
                        </div>
                        <div>
                            <label class="block text-slate-300 text-sm font-medium mb-2" for="nom">
                                Nom
                            </label>
                            <input type="text" id="nom" name="nom" required
                                   class="w-full px-4 py-3.5 bg-slate-700/50 border border-slate-600/50 rounded-xl text-white placeholder-slate-500 focus:border-cyan-500 focus:outline-none input-focus transition"
                                   placeholder="Nom">
                        </div>
                    </div>
                    
                    <!-- Email -->
                    <div>
                        <label class="block text-slate-300 text-sm font-medium mb-2" for="email">
                            Email professionnel
                        </label>
                        <div class="relative">
                            <span class="absolute inset-y-0 left-0 pl-4 flex items-center text-slate-500">
                                <i class="fas fa-envelope"></i>
                            </span>
                            <input type="email" id="email" name="email" required
                                   class="w-full pl-12 pr-4 py-3.5 bg-slate-700/50 border border-slate-600/50 rounded-xl text-white placeholder-slate-500 focus:border-cyan-500 focus:outline-none input-focus transition"
                                   placeholder="vous@entreprise.com">
                        </div>
                    </div>
                    
                    <!-- Téléphone -->
                    <div>
                        <label class="block text-slate-300 text-sm font-medium mb-2" for="telephone">
                            Téléphone
                        </label>
                        <div class="relative">
                            <span class="absolute inset-y-0 left-0 pl-4 flex items-center text-slate-500">
                                <i class="fas fa-phone"></i>
                            </span>
                            <input type="tel" id="telephone" name="telephone" required
                                   class="w-full pl-12 pr-4 py-3.5 bg-slate-700/50 border border-slate-600/50 rounded-xl text-white placeholder-slate-500 focus:border-cyan-500 focus:outline-none input-focus transition"
                                   placeholder="+223 XX XX XX XX">
                        </div>
                    </div>
                    
                    <!-- Mot de passe -->
                    <div>
                        <label class="block text-slate-300 text-sm font-medium mb-2" for="password">
                            Mot de passe
                        </label>
                        <div class="relative">
                            <span class="absolute inset-y-0 left-0 pl-4 flex items-center text-slate-500">
                                <i class="fas fa-lock"></i>
                            </span>
                            <input type="password" id="password" name="password" required minlength="8"
                                   class="w-full pl-12 pr-4 py-3.5 bg-slate-700/50 border border-slate-600/50 rounded-xl text-white placeholder-slate-500 focus:border-cyan-500 focus:outline-none input-focus transition"
                                   placeholder="Minimum 8 caractères">
                        </div>
                    </div>
                    
                    <!-- Confirmer mot de passe -->
                    <div>
                        <label class="block text-slate-300 text-sm font-medium mb-2" for="password_confirm">
                            Confirmer le mot de passe
                        </label>
                        <div class="relative">
                            <span class="absolute inset-y-0 left-0 pl-4 flex items-center text-slate-500">
                                <i class="fas fa-lock"></i>
                            </span>
                            <input type="password" id="password_confirm" name="password_confirm" required
                                   class="w-full pl-12 pr-4 py-3.5 bg-slate-700/50 border border-slate-600/50 rounded-xl text-white placeholder-slate-500 focus:border-cyan-500 focus:outline-none input-focus transition"
                                   placeholder="Confirmez votre mot de passe">
                        </div>
                    </div>
                    
                    <!-- Terms -->
                    <div class="flex items-start">
                        <input type="checkbox" id="terms" name="terms" required
                               class="w-4 h-4 mt-1 rounded border-slate-600 bg-slate-700 text-cyan-500 focus:ring-cyan-500 focus:ring-offset-0">
                        <label for="terms" class="ml-3 text-slate-400 text-sm">
                            J'accepte les <a href="#" class="text-cyan-400 hover:text-cyan-300">conditions d'utilisation</a> et la <a href="#" class="text-cyan-400 hover:text-cyan-300">politique de confidentialité</a>
                        </label>
                    </div>
                    
                    <button type="submit"
                            class="w-full bg-gradient-to-r from-cyan-500 to-emerald-500 text-white py-3.5 px-4 rounded-xl font-semibold hover:from-cyan-600 hover:to-emerald-600 transition duration-200 flex items-center justify-center shadow-lg shadow-cyan-500/25 hover:shadow-cyan-500/40 mt-6">
                        <i class="fas fa-rocket mr-2"></i>Créer mon compte
                    </button>
                </form>
                
                <div class="mt-8 pt-6 border-t border-slate-700/50">
                    <p class="text-center text-slate-400 text-sm">
                        Déjà un compte? 
                        <a href="<?= BASE_URL ?>/auth/login" class="text-cyan-400 hover:text-cyan-300 font-medium transition">Se connecter</a>
                    </p>
                </div>
            </div>
            
            <!-- Footer -->
            <div class="text-center mt-8">
                <p class="text-slate-600 text-sm">&copy; <?= date('Y') ?> <?= APP_NAME ?></p>
            </div>
        </div>
    </div>
</body>
</html>
