<?php
if (!defined('ABSPATH')) {
    exit;
}
$user = wp_get_current_user();
?>
<div class="chama-account-page-wrapper">
    <div class="chama-form-wrapper">
    <div class="chama-form-header">&#x1F512; Change your password</div>
    <div class="chama-form-content">

	<?php
// show any error messages after form submission
chama_show_error_messages();?>
<?php 
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
if(isset($_GET['password-updated']) && $_GET['password-updated'] == 'true') {
?>
			<div class="chama-alert chama-alert-success">
				<span><?php esc_html_e('Password updated successfully', 'chama'); ?></span>
			</div>
		<?php } ?>
    <form id="chama-edit-password-form" class="chama-form" action="" method="POST">
    <p>
					<label for="current_password"><?php esc_html_e('Current Password' , 'chama');?></label>
					<input name="chama_current_password" id="current_password" class="required" type="password" required data-msg="Please enter your current password"/>
				</p>
				<p>
					<label for="password"><?php esc_html_e('Password' , 'chama');?></label>
					<input name="chama_password" id="password" class="required" type="password" required data-msg="Please enter your password"/>
				</p>
				<p>
					<label for="password_again"><?php esc_html_e('Password Again' , 'chama');?></label>
					<input name="chama_password_confirm" id="password_again" class="required" type="password" required data-msg="Please enter your password again" data-msg-equalto="Passwords must match!" />
				</p>
				<p>
                <p class="chama-hint">Hint: The password should be at least twelve characters long. To make it stronger, use upper and lower case letters, numbers, and symbols like ! " ? $ % ^ &amp; ).</p>
				<span id="password-strength"></span>
				</p>
				<p>
                    <input type="hidden" name="chama_action" value="edit-password"/>
                    <input type="hidden" name="chama_edit_password_nonce" value="<?php echo esc_attr(wp_create_nonce('chama-edit-password-nonce')); ?>"/>
                    <input type="submit" class="chama-button chama-account-submit" value="<?php esc_attr_e('Update' , 'chama');?>"/>
				</p>

		</form>
		</div>

</div>
</div>