<?php
/**
 * Copyright © Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *  http://aws.amazon.com/apache2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

use Magento\Framework\Escaper;

/**
 * @var Escaper $escaper
 */

?>
<div class="amazon-validate-container">
    <div class="block block-amazon-validate">
        <div class="block-title">
            <strong id="block-amazon-login-heading" role="heading" aria-level="2">
                <?= $escaper->escapeHtml(__('Welcome back!')) ?>
            </strong>
        </div>
        <div class="block-content" aria-labelledby="block-amazon-login-heading">
            <p><?= $escaper->escapeHtml(__('A shop account for this email address already exists. Please enter your ' .
                'shop accounts password to log in without leaving the shop.')) ?>
            </p>
            <form class="form password validate"
                  action="<?= $escaper->escapeUrl($block->getUrl('*/*/validatepost')) ?>"
                  method="post"
                  id="form-validate"
                  data-mage-init='{"validation":{}}'>

                <fieldset class="fieldset" data-hasrequired="<?= $escaper->escapeHtml(__('* Required Fields')) ?>">
                    <div class="field email required">
                        <label for="password" class="label">
                            <span><?= $escaper->escapeHtml(__('Password')) ?></span>
                        </label>
                        <div class="control">
                            <input type="password"
                                   name="password"
                                   alt="password"
                                   id="password"
                                   class="input-text"
                                   value=""
                                   data-validate="{required:true}">
                        </div>
                    </div>
                    <div class="actions-toolbar">
                        <div class="primary">
                            <button type="submit" class="action submit primary">
                                <span><?= $escaper->escapeHtml(__('Ok')) ?></span>
                            </button>
                        </div>
                        <?php if ($block->isGuestCheckoutEnabled()): ?>
                        <div class="secondary continue-as-guest">
                            <a class="action secondary"
                               href="<?= $escaper->escapeUrl($block->getContinueAsGuestUrl())?>"
                            >
                                <span><?= $escaper->escapeHtml(__('Continue as Guest')) ?></span>
                            </a>
                        </div>
                        <?php endif; ?>
                        <div class="secondary forgot-password">
                            <a class="action secondary"
                               href="<?= $escaper->escapeUrl($block->getForgotPasswordUrl()) ?>"
                            >
                                <span><?= $escaper->escapeHtml(__('Forgot Your Password?')) ?></span>
                            </a>
                        </div>
                        <div class="secondary amazon-logout">
                            <a class="amazon-logout-button" href="#"
                               data-mage-init='{"amazonPayLogoutButton": {}}'>Sign out from Amazon</a>
                        </div>
                    </div>
                </fieldset>
            </form>
        </div>
    </div>
</div>
