<?php
declare(strict_types=1);

require_once dirname(__DIR__, 2) . '/includes/portal/layout.php';

portal_render_header('Support Center', 'home');
?>
<section class="fx-hero" style="padding-top:2rem">
    <h1>Support Center</h1>
    <p class="subtitle">Activation help, QR pairing, device replacement, and troubleshooting.</p>
</section>

<section class="fx-section fx-faq" id="faq">
    <h2 class="fx-section-title">FAQ</h2>
    <details open>
        <summary>What is an Access Key?</summary>
        <p>Your Access Key (VIP-XXXX-XXXX) links the app to your subscription. Enter it on first launch or via the Client Portal.</p>
    </details>
    <details>
        <summary>How many devices can I use?</summary>
        <p>Depends on your license plan. View active devices in the <a href="/client/">Client Portal</a>.</p>
    </details>
    <details>
        <summary>Stable vs Beta?</summary>
        <p>Stable is recommended for daily use. Beta includes preview features — download from the <a href="/downloads.php">Download Center</a>.</p>
    </details>
</section>

<section class="fx-section" id="qr">
    <h2 class="fx-section-title">QR Activation Guide</h2>
    <div class="fx-card">
        <ol style="color:var(--text-muted);line-height:1.8">
            <li>On Fire TV / Android TV, open <?= portal_h(portal_brand()['product']) ?> → QR Activation.</li>
            <li>Scan the on-screen QR code with your phone.</li>
            <li>Enter your Access Key on the mobile page and confirm.</li>
            <li>TV activates automatically within seconds.</li>
        </ol>
        <a class="fx-btn fx-btn-primary" href="/client/pair.php">Pairing help</a>
    </div>
</section>

<section class="fx-section">
    <h2 class="fx-section-title">Device Replacement Guide</h2>
    <div class="fx-card">
        <p style="color:var(--text-muted)">To move to a new device, revoke the old device in the Client Portal (or ask your reseller). Then activate on the new device with the same Access Key. If you hit the device limit, use Replace from admin/reseller tools.</p>
        <a class="fx-btn fx-btn-ghost" href="/client/dashboard.php">Manage devices</a>
    </div>
</section>

<section class="fx-section">
    <h2 class="fx-section-title">Troubleshooting</h2>
    <div class="fx-grid">
        <div class="fx-card">
            <h3>Invalid Access Key</h3>
            <p>Check format VIP-XXXX-XXXX. Ensure license is active and not expired.</p>
        </div>
        <div class="fx-card">
            <h3>Device limit reached</h3>
            <p>Revoke unused devices in Client Portal or upgrade your plan.</p>
        </div>
        <div class="fx-card">
            <h3>Force logout</h3>
            <p>Re-activate with your Access Key after reseller clears force logout.</p>
        </div>
        <div class="fx-card">
            <h3>Server status</h3>
            <p><a href="/status.php">Check status</a> · <a href="/health.php">Health API</a></p>
        </div>
    </div>
</section>
<?php portal_render_footer();
