<?php
declare(strict_types=1);
// ==================================================
// Nuclear Fancy Pants Edition™ -- NUCLEAR+++
// File: /home/ploi/automarketer-ai.com/public/wp-content/plugins/automarketer-ai/templates/install-onboarding.php
// Description: Post-purchase one-click install onboarding page template - NUCLEAR+++
// Last Edited: 2026-05-11
// ==================================================

if (!defined('ABSPATH')) {
    exit;
}
?>
<div class="amai-onboard-wrap">
    <div class="amai-onboard-card">

        <div class="amai-onboard-logo">
            <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
                <rect width="40" height="40" rx="10" fill="#D97757"/>
                <path d="M12 28L20 12L28 28M16 23H24" stroke="white" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
            </svg>
            <span class="amai-onboard-brand">AutoMarketer AI</span>
        </div>

        <h1 class="amai-onboard-title">Install on your WordPress site</h1>
        <p class="amai-onboard-sub">Enter your site URL below and we'll give you a one-click install link. No FTP, no file uploads, no technical steps.</p>

        <?php if (isset($_GET['installed']) && sanitize_key((string) $_GET['installed']) === '1'): ?>
            <div class="amai-onboard-success">
                <span class="amai-onboard-success-icon">&#10003;</span>
                AutoMarketer AI is installed and active. You're all set.
            </div>
        <?php endif; ?>

        <div class="amai-onboard-form" id="amai-onboard-form">
            <label class="amai-onboard-label" for="amai-site-url">Your WordPress site URL</label>
            <input
                type="url"
                id="amai-site-url"
                class="amai-onboard-input"
                placeholder="https://yoursite.com"
                autocomplete="url"
                spellcheck="false"
            />
            <button type="button" class="amai-onboard-btn" id="amai-generate-btn">
                <span class="amai-onboard-btn-label">Generate Install Link</span>
                <span class="amai-onboard-btn-spinner" style="display:none;">Generating...</span>
            </button>
            <p class="amai-onboard-error" id="amai-onboard-error" style="display:none;"></p>
        </div>

        <div class="amai-onboard-result" id="amai-onboard-result" style="display:none;">
            <p class="amai-onboard-result-intro">Your install link is ready. Click the button below <strong>while logged into the WordPress admin</strong> on <span id="amai-result-site"></span>.</p>
            <a class="amai-onboard-install-btn" id="amai-install-link" href="#" target="_blank" rel="noopener noreferrer">
                Install AutoMarketer AI
            </a>
            <p class="amai-onboard-expire-note">This link expires in 24 hours. <button type="button" class="amai-onboard-regen" id="amai-regen-btn">Generate a new one</button></p>
        </div>

        <div class="amai-onboard-steps">
            <div class="amai-onboard-step">
                <span class="amai-onboard-step-num">1</span>
                <span>Enter your site URL and click Generate</span>
            </div>
            <div class="amai-onboard-step">
                <span class="amai-onboard-step-num">2</span>
                <span>Log into your WordPress admin on that site</span>
            </div>
            <div class="amai-onboard-step">
                <span class="amai-onboard-step-num">3</span>
                <span>Click the install link -- plugin installs and activates automatically</span>
            </div>
        </div>

    </div>
</div>