<?php
/**
 * Activation Wizard - Step 1: License Activation.
 *
 * @package PrimeLink
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

$settings = \PrimeLink\Core\Rest\ImportRest::get_settings();
$license_key = $settings['license_key'] ?? '';
$license_status = $settings['license_status'] ?? '';
?>
<div class="mt-primelink-wizard-step-inner">
    <div class="mt-primelink-wizard-icon">
        <span class="dashicons dashicons-admin-network"></span>
    </div>
    <h2><?php esc_html_e( 'Activate Your License', 'primelink' ); ?></h2>
    <p class="mt-primelink-wizard-description">
        <?php esc_html_e( 'Enter your Envato purchase code and username to activate PrimeLink and receive updates.', 'primelink' ); ?>
    </p>

    <div class="mt-primelink-wizard-form">
        <div class="mt-primelink-wizard-form-group">
            <label for="wizard-license-key">
                <?php esc_html_e( 'Purchase Code', 'primelink' ); ?>
                <span class="required">*</span>
            </label>
            <input 
                type="text" 
                id="wizard-license-key" 
                class="mt-primelink-wizard-input" 
                placeholder="<?php esc_attr_e( 'Enter your Envato purchase code', 'primelink' ); ?>"
                value="<?php echo esc_attr( $license_key ); ?>"
            />
            <p class="mt-primelink-wizard-help">
                <?php esc_html_e( 'You can find your purchase code in your Envato account under Downloads.', 'primelink' ); ?>
                <a href="https://help.market.envato.com/hc/en-us/articles/202822600-Where-Is-My-Purchase-Code-" target="_blank">
                    <?php esc_html_e( 'Where to find it?', 'primelink' ); ?>
                </a>
            </p>
        </div>

        <div class="mt-primelink-wizard-form-group" style="margin-top: 20px;">
            <label for="wizard-client-name">
                <?php esc_html_e( 'Envato Username / Your Name', 'primelink' ); ?>
                <span class="required">*</span>
            </label>
            <input 
                type="text" 
                id="wizard-client-name" 
                class="mt-primelink-wizard-input" 
                placeholder="<?php esc_attr_e( 'Enter your Envato username or your name', 'primelink' ); ?>"
            />
            <p class="mt-primelink-wizard-help">
                <?php esc_html_e( 'Enter your Envato username (the one you used to purchase) or your full name.', 'primelink' ); ?>
            </p>
        </div>

        <div class="mt-primelink-wizard-license-status" id="wizard-license-status" style="display: none;">
            <div class="mt-primelink-wizard-alert" id="wizard-license-message"></div>
        </div>

        <div class="mt-primelink-wizard-info-box">
            <h4><?php esc_html_e( 'Why activate?', 'primelink' ); ?></h4>
            <ul>
                <li><?php esc_html_e( 'Receive automatic updates', 'primelink' ); ?></li>
                <li><?php esc_html_e( 'Get priority support', 'primelink' ); ?></li>
                <li><?php esc_html_e( 'Access to all features', 'primelink' ); ?></li>
            </ul>
        </div>
    </div>
</div>

