<?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" class="mt_primelink-label">
                <?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 ); ?>"
            />
            <small class="description 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>
            </small>
        </div>

        <div class="mt-primelink-wizard-form-group" style="margin-top: 20px;">
            <label for="wizard-client-name" class="mt_primelink-label">
                <?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' ); ?>"
            />
            <small class="description mt-primelink-wizard-help">
                <?php esc_html_e( 'Enter your Envato username (the one you used to purchase) or your full name.', 'primelink' ); ?>
            </small>
        </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 glass">
            <h4 style="margin:0 0 12px;font-size:15px;color:#1d2327;"><?php esc_html_e( 'Why activate?', 'primelink' ); ?></h4>
            <ul style="margin:0;padding-left:20px;list-style:none;">
                <li style="margin-bottom:8px;padding-left:20px;position:relative;color:#646970;font-size:14px;">
                    <span style="position:absolute;left:0;color:#28a745;font-weight:bold;">✓</span>
                    <?php esc_html_e( 'Receive automatic updates', 'primelink' ); ?>
                </li>
                <li style="margin-bottom:8px;padding-left:20px;position:relative;color:#646970;font-size:14px;">
                    <span style="position:absolute;left:0;color:#28a745;font-weight:bold;">✓</span>
                    <?php esc_html_e( 'Get priority support', 'primelink' ); ?>
                </li>
                <li style="margin-bottom:0;padding-left:20px;position:relative;color:#646970;font-size:14px;">
                    <span style="position:absolute;left:0;color:#28a745;font-weight:bold;">✓</span>
                    <?php esc_html_e( 'Access to all features', 'primelink' ); ?>
                </li>
            </ul>
        </div>
    </div>
</div>

