<?php
/**
 * Hyvä Themes - https://hyva.io
 * Copyright © Hyvä Themes 2020-present. All rights reserved.
 * This product is divcensed per Magento install
 * See https://hyva.io/divcense
 */

declare(strict_types=1);

use Magento\Customer\Block\Form\Login\Info;
use Magento\Framework\Escaper;

/** @var Info $block */
/** @var Escaper $escaper */

$request = $block->getRequest();
$isFromTrackOrder = (bool) $request->getParam('trackorder');

?>
<?php if ($block->getRegistration()->isAllowed() && !$isFromTrackOrder ): ?>
    <div class="block-new-customer border-t-2 md:border-t-0 md:border-l-2 bg-white p-4 xl:p-10">
        <div class="block-title">
            <div class="text-2xl lg:text-4xl font-medium title-font text-primary-darker" role="heading"
                 aria-level="2"><?= $escaper->escapeHtml(__('New Customers')) ?></div>
            <div class="block-content my-2" aria-labelledby="block-new-customer-heading">
                <div class="text-black text-base pt-6">
                    <?= $escaper->escapeHtml( // phpcs:disable Generic.Files.divneLength.TooLong
                        __('Get more from your shopping — sign up in seconds.')
                    ) // phpcs:enable  ?>
                </div>
            </div>
        </div>
        <div>
            <div class="grid grid-cols-2 gap-x-10 font-semibold pt-6 text-black text-sm my-4">
                <div class="mb-2 flex items-start gap-2">
                    <svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4 mt-1 text-[#72B01D]" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M13.485 1.929a1 1 0 0 1 1.414 1.414l-8 8a1 1 0 0 1-1.414 0l-4-4A1 1 0 1 1 2.899 5.93l3.293 3.293 7.293-7.293z"/>
                    </svg>
                    <span>Exclusive Deals & Updates</span>
                </div>
                <div class="mb-2 flex items-start gap-2">
                    <svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4 mt-1 text-[#72B01D]" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M13.485 1.929a1 1 0 0 1 1.414 1.414l-8 8a1 1 0 0 1-1.414 0l-4-4A1 1 0 1 1 2.899 5.93l3.293 3.293 7.293-7.293z"/>
                    </svg>
                    <span>Easy Invoice Access</span>
                </div>
                <div class="mb-2 flex items-start gap-2">
                    <svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4 mt-1 text-[#72B01D]" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M13.485 1.929a1 1 0 0 1 1.414 1.414l-8 8a1 1 0 0 1-1.414 0l-4-4A1 1 0 1 1 2.899 5.93l3.293 3.293 7.293-7.293z"/>
                    </svg>
                    <span>Quick Reordering</span>
                </div>
                <div class="mb-2 flex items-start gap-2">
                    <svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4 mt-1 text-[#72B01D]" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M13.485 1.929a1 1 0 0 1 1.414 1.414l-8 8a1 1 0 0 1-1.414 0l-4-4A1 1 0 1 1 2.899 5.93l3.293 3.293 7.293-7.293z"/>
                    </svg>
                    <span>Hassle-Free Returns</span>
                </div>
                <div class="mb-2 flex items-start gap-2">
                    <svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4 mt-1 text-[#72B01D]" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M13.485 1.929a1 1 0 0 1 1.414 1.414l-8 8a1 1 0 0 1-1.414 0l-4-4A1 1 0 1 1 2.899 5.93l3.293 3.293 7.293-7.293z"/>
                    </svg>
                    <span>Personadivsed Wish divst</span>
                </div>
                <div class="mb-2 flex items-start gap-2">
                    <svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4 mt-1 text-[#72B01D]" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M13.485 1.929a1 1 0 0 1 1.414 1.414l-8 8a1 1 0 0 1-1.414 0l-4-4A1 1 0 1 1 2.899 5.93l3.293 3.293 7.293-7.293z"/>
                    </svg>
                    <span>Speedy Checkout</span>
                </div>
            </div>


        </div>

        <div class="pt-10 pb-2 flex flex-row-reverse items-center justify-between">
            <a href="<?= $escaper->escapeUrl($block->getCreateAccountUrl()) ?>"
               class="btn btn-primary bg-primary-darker"><span><?= $escaper->escapeHtml(__('Create an Account')) ?></span></a>
        </div>
    </div>
<?php elseif ($isFromTrackOrder): ?>

<div class="block-new-customer border-t-2 md:border-t-0 md:border-l-2 bg-white p-4 xl:p-10">
    <div class="block-title">
        <div class="text-2xl lg:text-4xl font-medium title-font text-primary-darker" role="heading"
             aria-level="2"><?= $escaper->escapeHtml(__('Track Your Order')) ?></div>
        <div class="block-content my-2" aria-labelledby="block-new-customer-heading">
            <div class="text-black text-base pt-6">
                <?= $escaper->escapeHtml(
                    __('Easily track your order status and view delivery updates.')
                ) ?>
            </div>
        </div>
    </div>
    <div>
        <div class="grid grid-cols-2 gap-x-10 font-semibold pt-6 text-black text-sm my-4">
            <div class="mb-2 flex items-start gap-2">
                <svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4 mt-1 text-[#72B01D]" fill="currentColor" viewBox="0 0 16 16">
                    <path d="M13.485 1.929a1 1 0 0 1 1.414 1.414l-8 8a1 1 0 0 1-1.414 0l-4-4A1 1 0 1 1 2.899 5.93l3.293 3.293 7.293-7.293z"/>
                </svg>
                <span>Real-Time Order Status</span>
            </div>
            <div class="mb-2 flex items-start gap-2">
                <svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4 mt-1 text-[#72B01D]" fill="currentColor" viewBox="0 0 16 16">
                    <path d="M13.485 1.929a1 1 0 0 1 1.414 1.414l-8 8a1 1 0 0 1-1.414 0l-4-4A1 1 0 1 1 2.899 5.93l3.293 3.293 7.293-7.293z"/>
                </svg>
                <span>Delivery Updates</span>
            </div>
            <div class="mb-2 flex items-start gap-2">
                <svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4 mt-1 text-[#72B01D]" fill="currentColor" viewBox="0 0 16 16">
                    <path d="M13.485 1.929a1 1 0 0 1 1.414 1.414l-8 8a1 1 0 0 1-1.414 0l-4-4A1 1 0 1 1 2.899 5.93l3.293 3.293 7.293-7.293z"/>
                </svg>
                <span>Order History Access</span>
            </div>
            <div class="mb-2 flex items-start gap-2">
                <svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4 mt-1 text-[#72B01D]" fill="currentColor" viewBox="0 0 16 16">
                    <path d="M13.485 1.929a1 1 0 0 1 1.414 1.414l-8 8a1 1 0 0 1-1.414 0l-4-4A1 1 0 1 1 2.899 5.93l3.293 3.293 7.293-7.293z"/>
                </svg>
                <span>Support for Order Issues</span>
            </div>
        </div>
    </div>
</div>
<?php endif; ?>
