<!DOCTYPE html>
<html lang="en">
<?php
$pagetitle = "Request a Platform Demo | Nesvra";
include 'components/head.php';
?>
<body class="bg-[#F8F9FA]">
<?php include 'components/navbar.php'; ?>

<section class="min-h-screen w-full">
    <div class="max-w-[1200px] mx-auto px-4 md:px-[5%] py-16 md:py-24">

        <!-- Page heading -->
        <div class="mb-12" data-aos="fade-up">
            <a href="/" class="inline-flex items-center gap-2 font-mono text-[10px] uppercase tracking-widest text-soft hover:text-royal transition-colors mb-6 group">
                <i class="ri-arrow-left-line group-hover:-translate-x-1 transition-transform"></i> Back to Nesvra
            </a>
            <span class="font-mono text-[11px] uppercase tracking-[0.4em] text-brandOrange font-semibold block mb-3">Live Platform Demo</span>
            <h1 class="text-4xl md:text-5xl font-[400] tracking-tighter text-royal leading-[1.1] mb-3">
                See Our Platforms <br><span class="italic font-serif text-soft">Live & In Action</span>
            </h1>
            <p class="text-soft text-base leading-relaxed max-w-xl border-l-2 border-electric pl-4">
                Request a personalised live walkthrough of any Nesvra platform. We'll demo the exact product relevant to your use case — no generic slides, just the real thing.
            </p>
        </div>

        <!-- Step 1: Platform picker -->
        <div id="rdStep1" data-aos="fade-up">
            <div class="flex items-center gap-3 mb-8">
                <div class="w-7 h-7 rounded-full bg-royal text-white flex items-center justify-center font-mono text-[11px] font-semibold">1</div>
                <h2 class="text-xl font-semibold text-royal tracking-tight">Which platform would you like to see?</h2>
            </div>

            <?php
            $platforms = [
                [
                    "val"   => "digital-wallet",
                    "icon"  => "ri-wallet-3-line",
                    "label" => "Digital Wallet Platform",
                    "sub"   => "Payments · P2P · Virtual Accounts · Mobile Apps",
                    "tag"   => "Fintech",
                    "color" => "electric",
                    "img"   => "https://i.pinimg.com/736x/7b/6b/7d/7b6b7db5466516425fad2eeb558b3103.jpg",
                ],
                [
                    "val"   => "esim",
                    "icon"  => "ri-router-line",
                    "label" => "eSIM Platform",
                    "sub"   => "150+ Countries · Instant Activation · White-label",
                    "tag"   => "Telecom",
                    "color" => "brandOrange",
                    "img"   => "https://i.pinimg.com/736x/9d/49/c8/9d49c8f35662614db6f4fd383ba7eebd.jpg",
                ],
                [
                    "val"   => "virtual-card",
                    "icon"  => "ri-bank-card-2-line",
                    "label" => "Virtual Card Platform",
                    "sub"   => "Card Issuing · Spend Controls · Multi-currency",
                    "tag"   => "Fintech",
                    "color" => "electric",
                    "img"   => "https://i.pinimg.com/1200x/6e/96/96/6e969680ae4d4624d4b068138b89d1b1.jpg",
                ],
                [
                    "val"   => "lms",
                    "icon"  => "ri-graduation-cap-line",
                    "label" => "LMS / EdTech Platform",
                    "sub"   => "Courses · Live Classes · Certifications · Mobile",
                    "tag"   => "EdTech",
                    "color" => "brandOrange",
                    "img"   => "https://i.pinimg.com/736x/0c/74/fb/0c74fbb15a04ef5cd89e39205344bd76.jpg",
                ],
                [
                    "val"   => "ecommerce",
                    "icon"  => "ri-shopping-bag-3-line",
                    "label" => "eCommerce / Marketplace",
                    "sub"   => "Multi-vendor · D2C · Payments · Inventory",
                    "tag"   => "Commerce",
                    "color" => "electric",
                    "img"   => "https://i.pinimg.com/736x/5f/be/9e/5fbe9eab02aeb84178124457d287ff63.jpg",
                ],
                [
                    "val"   => "school",
                    "icon"  => "ri-school-line",
                    "label" => "School Management System",
                    "sub"   => "SIS · Fees · Parent Portals · Gradebook",
                    "tag"   => "EdTech",
                    "color" => "brandOrange",
                    "img"   => "https://i.pinimg.com/1200x/39/79/ca/3979cafea548c6745f9eb1bf9808305e.jpg",
                ],
                [
                    "val"   => "custom",
                    "icon"  => "ri-code-s-slash-line",
                    "label" => "Custom Platform Build",
                    "sub"   => "Any industry · API-first · Full white-label",
                    "tag"   => "Custom",
                    "color" => "electric",
                    "img"   => "https://plus.unsplash.com/premium_photo-1686244745499-9c81d2aa48da?q=80&w=870&auto=format&fit=crop",
                ],
            ];
            ?>

            <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-8" id="platformCards">
                <?php foreach ($platforms as $p): ?>
                    <label class="platform-card group relative overflow-hidden rounded-[28px] border-2 border-transparent cursor-pointer transition-all duration-300 hover:border-electric/40 hover:shadow-[0_12px_40px_-12px_rgba(8,31,92,0.15)]">
                        <input type="radio" name="platform" value="<?= $p['val'] ?>" class="sr-only" />

                        <!-- Image bg -->
                        <div class="relative h-[140px] overflow-hidden rounded-t-[26px]">
                            <img src="<?= $p['img'] ?>" alt="<?= $p['label'] ?>"
                                 class="w-full h-full object-cover transition-transform duration-[2s] group-hover:scale-105" />
                            <div class="absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"></div>
                            <span class="absolute top-3 left-3 font-mono text-[9px] uppercase tracking-widest px-3 py-1 bg-white/20 backdrop-blur-md border border-white/20 rounded-full text-white font-semibold"><?= $p['tag'] ?></span>
                            <div class="absolute bottom-3 right-3 w-8 h-8 rounded-full border-2 border-white/30 flex items-center justify-center check-circle-outer transition-all">
                                <div class="w-3 h-3 rounded-full bg-white/30 check-circle-inner transition-all"></div>
                            </div>
                        </div>

                        <!-- Content -->
                        <div class="bg-white p-4 rounded-b-[26px] border-t border-zinc-100">
                            <div class="flex items-center gap-2 mb-1">
                                <i class="<?= $p['icon'] ?> text-soft group-hover:text-<?= $p['color'] ?> text-base transition-colors"></i>
                                <h3 class="font-semibold text-dark text-sm"><?= $p['label'] ?></h3>
                            </div>
                            <p class="text-soft text-xs leading-relaxed"><?= $p['sub'] ?></p>
                        </div>
                    </label>
                <?php endforeach; ?>
            </div>

            <div class="flex justify-end">
                <button id="rdToStep2" disabled
                        class="inline-flex items-center gap-2 px-8 py-3.5 bg-royal text-white rounded-full font-semibold text-sm hover:bg-electric transition-colors disabled:opacity-40 disabled:cursor-not-allowed">
                    Next — Your Details <i class="ri-arrow-right-line"></i>
                </button>
            </div>
        </div>

        <!-- Step 2: Details form -->
        <div id="rdStep2" class="hidden" data-aos="fade-up">

            <div class="flex items-center justify-between mb-8">
                <div class="flex items-center gap-3">
                    <div class="w-7 h-7 rounded-full bg-electric text-white flex items-center justify-center font-mono text-[11px] font-semibold">✓</div>
                    <div class="h-px w-8 bg-royal"></div>
                    <div class="w-7 h-7 rounded-full bg-royal text-white flex items-center justify-center font-mono text-[11px] font-semibold">2</div>
                    <h2 class="text-xl font-semibold text-royal tracking-tight ml-2">Your Details</h2>
                </div>
                <div id="rdSelectedBadge" class="flex items-center gap-2 px-4 py-2 bg-electric/10 border border-electric/20 rounded-full">
                    <span class="w-1.5 h-1.5 rounded-full bg-electric animate-pulse"></span>
                    <span class="font-mono text-[10px] uppercase tracking-widest text-electric font-semibold" id="rdBadgeText">Platform</span>
                </div>
            </div>

            <div class="grid lg:grid-cols-[58%_42%] gap-8 items-start">

                <!-- Form card -->
                <div class="bg-white border border-zinc-100 rounded-[32px] shadow-[0_20px_60px_-20px_rgba(8,31,92,0.1)] p-8">
                    <form id="requestDemoForm" novalidate class="flex flex-col gap-5">
                        <input type="hidden" name="platform" id="rdPlatformHidden" />

                        <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
                            <div class="form-group" data-field="rdname">
                                <label class="block font-semibold text-dark text-sm mb-1.5">Full Name <span class="text-brandOrange">*</span></label>
                                <input type="text" name="rdname" required autocomplete="name"
                                       class="field w-full px-4 py-3 text-sm border border-zinc-200 rounded-[16px] outline-none focus:border-electric focus:ring-2 focus:ring-electric/10 transition-all font-[400] text-dark placeholder:text-zinc-300"
                                       placeholder="Alex Johnson" />
                                <p class="error-msg hidden text-xs text-red-500 mt-1"></p>
                            </div>
                            <div class="form-group" data-field="rdcompany">
                                <label class="block font-semibold text-dark text-sm mb-1.5">Company <span class="text-brandOrange">*</span></label>
                                <input type="text" name="rdcompany" required autocomplete="organization"
                                       class="field w-full px-4 py-3 text-sm border border-zinc-200 rounded-[16px] outline-none focus:border-electric focus:ring-2 focus:ring-electric/10 transition-all font-[400] text-dark placeholder:text-zinc-300"
                                       placeholder="Acme Ltd" />
                                <p class="error-msg hidden text-xs text-red-500 mt-1"></p>
                            </div>
                        </div>

                        <div class="form-group" data-field="rdemail">
                            <label class="block font-semibold text-dark text-sm mb-1.5">Work Email <span class="text-brandOrange">*</span></label>
                            <input type="email" name="rdemail" required autocomplete="email"
                                   class="field w-full px-4 py-3 text-sm border border-zinc-200 rounded-[16px] outline-none focus:border-electric focus:ring-2 focus:ring-electric/10 transition-all font-[400] text-dark placeholder:text-zinc-300"
                                   placeholder="alex@company.com" />
                            <p class="error-msg hidden text-xs text-red-500 mt-1"></p>
                        </div>

                        <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
                            <div class="form-group" data-field="rdphone">
                                <label class="block font-semibold text-dark text-sm mb-1.5">Phone / WhatsApp <span class="text-brandOrange">*</span></label>
                                <input type="tel" name="rdphone" required autocomplete="tel"
                                       class="field w-full px-4 py-3 text-sm border border-zinc-200 rounded-[16px] outline-none focus:border-electric focus:ring-2 focus:ring-electric/10 transition-all font-[400] text-dark placeholder:text-zinc-300"
                                       placeholder="+1 555 123 4567" />
                                <p class="error-msg hidden text-xs text-red-500 mt-1"></p>
                            </div>
                            <div>
                                <label class="block font-semibold text-dark text-sm mb-1.5">Role</label>
                                <select name="role"
                                        class="w-full px-4 py-3 text-sm border border-zinc-200 rounded-[16px] outline-none focus:border-electric focus:ring-2 focus:ring-electric/10 transition-all font-[400] text-dark appearance-none bg-white">
                                    <option>Founder / CEO</option>
                                    <option>CTO / Tech Lead</option>
                                    <option>Product Manager</option>
                                    <option>Investor</option>
                                    <option>Other</option>
                                </select>
                            </div>
                        </div>

                        <div>
                            <label class="block font-semibold text-dark text-sm mb-1.5">Preferred Demo Format</label>
                            <div class="grid grid-cols-3 gap-2">
                                <?php foreach (["Zoom","Google Meet","MS Teams"] as $m): ?>
                                    <label class="flex items-center justify-center gap-2 px-3 py-2.5 border border-zinc-200 rounded-[14px] cursor-pointer text-xs font-semibold text-dark hover:border-electric/40 transition-all has-[:checked]:bg-electric/10 has-[:checked]:border-electric has-[:checked]:text-electric">
                                        <input type="radio" name="format" value="<?= $m ?>" class="sr-only" <?= $m==='Zoom' ? 'checked' : '' ?> />
                                        <?= $m ?>
                                    </label>
                                <?php endforeach; ?>
                            </div>
                        </div>

                        <div>
                            <label class="block font-semibold text-dark text-sm mb-1.5">Specific Questions for the Demo <span class="text-zinc-300 font-[400]">(optional)</span></label>
                            <textarea name="questions" rows="3"
                                      class="field w-full px-4 py-3 text-sm border border-zinc-200 rounded-[16px] outline-none focus:border-electric focus:ring-2 focus:ring-electric/10 transition-all font-[400] text-dark placeholder:text-zinc-300 resize-none"
                                      placeholder="Anything specific you'd like us to focus on during the demo..."></textarea>
                        </div>

                        <label class="flex items-start gap-3 cursor-pointer">
                            <input type="checkbox" id="rdGdpr" required class="w-4 h-4 mt-0.5 rounded accent-electric flex-shrink-0" />
                            <span class="text-xs text-soft leading-relaxed">
                                I agree to Nesvra's <a href="/privacy" class="text-royal hover:text-electric transition-colors">Privacy Policy</a>. No spam, no third-party sharing.
                            </span>
                        </label>

                        <div class="flex items-center justify-between pt-1">
                            <button type="button" id="rdBackBtn"
                                    class="inline-flex items-center gap-2 px-6 py-3 bg-[#F8F9FA] border border-zinc-200 text-dark rounded-full font-semibold text-sm hover:border-royal/30 transition-colors">
                                <i class="ri-arrow-left-line"></i> Back
                            </button>
                            <button type="submit" id="rdSubmitBtn"
                                    class="inline-flex items-center gap-2 px-8 py-3.5 bg-royal text-white rounded-full font-semibold text-sm hover:bg-electric transition-colors">
                                <i class="ri-presentation-line"></i> Request My Demo
                            </button>
                        </div>
                    </form>
                </div>

                <!-- Right: what to expect -->
                <div class="flex flex-col gap-5 lg:sticky lg:top-28">

                    <div class="bg-white border border-zinc-100 rounded-[32px] p-7">
                        <h3 class="text-base font-semibold text-royal tracking-tight mb-5">What happens in the demo</h3>
                        <div class="flex flex-col gap-4">
                            <?php
                            $demoSteps = [
                                ["icon"=>"ri-calendar-check-line", "t"=>"Demo booked — calendar invite in 2 hrs"],
                                ["icon"=>"ri-eye-line",             "t"=>"Live walkthrough of your chosen platform"],
                                ["icon"=>"ri-question-answer-line", "t"=>"Q&A — ask anything in real time"],
                                ["icon"=>"ri-file-text-line",       "t"=>"Custom quote delivered within 48 hrs"],
                            ];
                            foreach ($demoSteps as $i => $ds):
                            ?>
                                <div class="flex items-start gap-3">
                                    <div class="w-8 h-8 rounded-full bg-[#F8F9FA] border border-zinc-100 flex items-center justify-center flex-shrink-0 font-mono text-[10px] text-soft font-semibold">0<?= $i+1 ?></div>
                                    <div class="flex items-start gap-2 mt-1">
                                        <i class="<?= $ds['icon'] ?> text-electric text-sm flex-shrink-0"></i>
                                        <p class="text-dark text-sm font-semibold leading-snug"><?= $ds['t'] ?></p>
                                    </div>
                                </div>
                            <?php endforeach; ?>
                        </div>
                    </div>

                    <div class="flex flex-wrap gap-2">
                        <?php foreach (["Live platform walkthrough","Ask any questions","No commitment","Fixed quote in 48hrs"] as $b): ?>
                            <span class="flex items-center gap-1.5 px-3 py-1.5 bg-white border border-zinc-100 rounded-full text-xs font-semibold text-dark">
                                <span class="w-1.5 h-1.5 rounded-full bg-electric"></span><?= $b ?>
                            </span>
                        <?php endforeach; ?>
                    </div>

                    <div class="border-l-2 border-zinc-200 pl-5 bg-white rounded-r-[24px] p-5 border border-l-0 border-zinc-100">
                        <p class="text-dark font-[400] italic text-sm leading-relaxed mb-3">
                            "The demo was exactly what I needed — I could see the whole wallet platform live and ask our CTO's technical questions on the spot."
                        </p>
                        <div class="flex items-center gap-3">
                            <div class="w-8 h-8 rounded-full bg-royal flex items-center justify-center text-white font-semibold text-xs">OA</div>
                            <div>
                                <span class="font-semibold text-royal text-xs block">Olawale A.</span>
                                <span class="font-mono text-[9px] uppercase tracking-widest text-soft">CEO, PayQuick Nigeria</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</section>

<!-- ═══ SUCCESS MODAL ═══ -->
<div id="rdModal" class="fixed inset-0 z-50 hidden items-center justify-center p-4">
    <!-- Sophisticated deep overlay canvas -->
    <div class="absolute inset-0 bg-zinc-950/40 backdrop-blur-md" id="rdModalBackdrop"></div>
    
    <!-- Editorial Minimalist Card Box -->
    <div class="relative bg-white rounded-[32px] shadow-[0_50px_100px_-20px_rgba(0,0,0,0.12)] w-full  max-w-md p-8 md:p-10 text-center z-10 animate-[scaleIn_0.3s_cubic-bezier(0.16,1,0.3,1)]">
        
        <div class="w-16 h-16 rounded-full bg-electric/10 flex items-center justify-center mx-auto mb-5">
            <i class="ri-calendar-line text-3xl text-electric"></i>
        </div>

        <!-- Status Indicator Pin -->
       <span class="font-mono text-[10px] uppercase tracking-widest text-brandOrange font-semibold block mb-2">You're Booked!</span>

        <!-- High-End Editorial Typography Matrix -->
        <h2 class="text-3xl font-[400] tracking-[-0.03em] text-zinc-950 leading-none mb-3">
            We're on it, <span id="rdModalName" class="italic font-serif font-normal text-zinc-400">Alex</span>.
        </h2>
        
        <p class="text-soft text-sm leading-relaxed mb-7 mx-auto  ">
            Your demo instance for the <span id="rdModalPlatform" class="text-zinc-900 font-bold">platform</span> is routing. Expect a private calendar link in your inbox within 2 hours.
        </p>

        

        <!-- Premium Button Hierarchy Block -->
        <div class="flex flex-col sm:flex-row gap-3">
            <a href="/platforms" class="flex-1 py-3 bg-[#F8F9FA] border border-zinc-100 text-royal rounded-full text-sm font-semibold hover:bg-white hover:border-royal/20 transition-all">
                Explore Platforms →
            </a>
            <a href="/" class="flex-1 py-3 bg-royal text-white rounded-full text-sm font-semibold hover:bg-electric transition-colors">
                Back to Home
            </a>
        </div>
    </div>
</div>

<?php include 'components/Scroll-to-top.php'; ?>
<?php include 'components/footer.php'; ?>

<style>
    @keyframes scaleIn { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
    .platform-card.selected { border-color: #2563FF; box-shadow: 0 8px 30px -8px rgba(37,99,255,0.25); }
    .platform-card.selected .check-circle-outer { border-color: #2563FF; background: #2563FF; }
    .platform-card.selected .check-circle-inner { background: white; }
    .form-group.has-error .field  { border-color: #ef4444; background: #fff5f5; }
    .form-group.has-success .field { border-color: #10b981; }
</style>

<script>
document.addEventListener('DOMContentLoaded', () => {

    const platformLabels = {
        'digital-wallet': 'Digital Wallet Platform',
        'esim':           'eSIM Platform',
        'virtual-card':   'Virtual Card Platform',
        'lms':            'LMS / EdTech Platform',
        'ecommerce':      'eCommerce / Marketplace',
        'school':         'School Management System',
        'custom':         'Custom Platform Build',
    };

    let selectedPlatform = '';

    // ── Platform card selection ────────────────────────────
    document.querySelectorAll('.platform-card').forEach(card => {
        card.addEventListener('click', () => {
            document.querySelectorAll('.platform-card').forEach(c => c.classList.remove('selected'));
            card.classList.add('selected');
            selectedPlatform = card.querySelector('input').value;
            card.querySelector('input').checked = true;
            document.getElementById('rdToStep2').disabled = false;
        });
    });

    // ── Step 1 → Step 2 ────────────────────────────────────
    document.getElementById('rdToStep2').addEventListener('click', () => {
        document.getElementById('rdStep1').classList.add('hidden');
        document.getElementById('rdStep2').classList.remove('hidden');
        document.getElementById('rdBadgeText').textContent = platformLabels[selectedPlatform] || 'Platform';
        document.getElementById('rdPlatformHidden').value = selectedPlatform;
        window.scrollTo({ top: 0, behavior: 'smooth' });
    });

    document.getElementById('rdBackBtn').addEventListener('click', () => {
        document.getElementById('rdStep2').classList.add('hidden');
        document.getElementById('rdStep1').classList.remove('hidden');
        window.scrollTo({ top: 0, behavior: 'smooth' });
    });

    // ── Validation ─────────────────────────────────────────
    function validateField(input) {
        const group = input.closest('.form-group');
        if (!group) return true;
        const err = group.querySelector('.error-msg');
        let valid = true, msg = '';
        if (input.required && !input.value.trim())                                      { valid = false; msg = 'This field is required.'; }
        else if (input.type === 'email' && !/^\S+@\S+\.\S+$/.test(input.value.trim())) { valid = false; msg = 'Valid email required.'; }
        else if (input.type === 'tel'   && input.value.trim().length < 6)               { valid = false; msg = 'Valid phone required.'; }
        group.classList.toggle('has-error',  !valid);
        group.classList.toggle('has-success', valid && !!input.value.trim());
        if (err) { err.textContent = msg; err.classList.toggle('hidden', valid); }
        return valid;
    }

    document.querySelectorAll('#requestDemoForm .field[required]').forEach(f => {
        f.addEventListener('blur',  () => validateField(f));
        f.addEventListener('input', () => { const g = f.closest('.form-group'); g?.classList.remove('has-error'); g?.querySelector('.error-msg')?.classList.add('hidden'); });
    });

    // ── Form submit → show modal ───────────────────────────
    document.getElementById('requestDemoForm').addEventListener('submit', async e => {
        e.preventDefault();
        let ok = true;
        e.target.querySelectorAll('.field[required]').forEach(f => { if (!validateField(f)) ok = false; });
        if (!document.getElementById('rdGdpr').checked) ok = false;
        if (!ok) return;

        const btn = document.getElementById('rdSubmitBtn');
        btn.innerHTML = '<span class="inline-block w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"></span>';
        btn.disabled = true;
        await new Promise(r => setTimeout(r, 900));

        const name = (document.querySelector('[name="rdname"]').value.trim().split(' ')[0]) || 'there';
        document.getElementById('rdModalName').textContent = name;
        document.getElementById('rdModalPlatform').textContent = platformLabels[selectedPlatform] || 'your chosen platform';

        const modal = document.getElementById('rdModal');
        modal.classList.remove('hidden');
        modal.classList.add('flex');
        document.body.style.overflow = 'hidden';
    });

    document.getElementById('rdModalBackdrop').addEventListener('click', () => {
        document.getElementById('rdModal').classList.add('hidden');
        document.getElementById('rdModal').classList.remove('flex');
        document.body.style.overflow = '';
    });
});
</script>
</body>
</html>