<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Rapido</title>
    <!-- bootstrap cdn -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" />
    <!-- custom css -->
    <!-- <link rel="stylesheet" href="./assets/css/style.css" /> -->
    <link rel="stylesheet" href="<?php echo base_url('assets/css/style.css'); ?>" />
    <!-- fontawesone link -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" />
</head>

<body class="bg-main pt-5 pb-5">
    <div class="container-flid bg-main mt-5 pt-5 mb-5 pb-5">
        <div class="container">
            <div class="row">
                <div class="col-md-12 my-2">
                    <img class="d-block m-auto w-50" src="./assets/images/dp.png" alt="" />
                    <div class="row mb-2 mt-5">
                        <div class="col-md-12 my-2">
                            <form action="<?php echo base_url().'login/login_action' ?>" method="post">
                            <div class="my-2 row justify-content-center">
            <?php 
            $successMessage =$this->session->flashdata('successmessage');
      $warningmessage = $this->session->flashdata('warningmessage');
      if (isset($successMessage)) {
        echo '<div id="alertmessage" class="col-md-6">
          <div class="alert alert-success ">
               
                   ' . output($successMessage) . '
                  </div>
          </div>';
      }
      if (isset($warningmessage)) {
        echo '<div id="alertmessage" class="col-md-6">
          <div class="alert alert-danger">
               
                   ' . output($warningmessage) . '
                  </div>
          </div>';
      }
      ?>
        </div>   
                            


                                <div class="my-2 row justify-content-center">
                                    <div class="col-md-6 my-2 align-self-center">
                                        <input class="form-control rounded-0 fInp py-3" type="email"
                                            placeholder="Email" name="email" required />
                                    </div>

                                </div>
                                <div class="my-2 row justify-content-center">
                                    <div class="col-md-6 my-2 align-self-center">
                                        <input class="form-control rounded-0 fInp py-3" type="text"
                                            placeholder=" Password" name="password" required/>
                                    </div>

                                </div>
                                <!--
                                <div class="my-2 d-flex justify-content-center" style="display:none;">
                                    <a href="#" class="text-center forgText">Forgot Password</a>
                                </div>
    -->
                        </div>

                        <div class="row my-2">
                            <div class="col-md-12">
                                <div class="d-flex flex-column justify-content-center align-items-center">
                                    <button type="submit"
                                        class="btn my-2 signB rounded-0 py-3 ">
                                        Login
    </button>
                                    <a href="<?php echo base_url().'login/register' ?>"
                                        class="btn my-2 LogB rounded-0 py-3 ">Sign Up</a>
                                </div>
                            </div>
                        </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
        integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous">
    </script>

    <script>
    document.addEventListener("DOMContentLoaded", function() {
        const eyeIcons = document.querySelectorAll(".eye");

        eyeIcons.forEach(function(icon) {
            icon.addEventListener("click", function() {
                const passwordField = this.previousElementSibling;
                if (passwordField.type === "password") {
                    passwordField.type = "text";
                    this.classList.remove("fa-eye");
                    this.classList.add("fa-eye-slash");
                } else {
                    passwordField.type = "password";
                    this.classList.remove("fa-eye-slash");
                    this.classList.add("fa-eye");
                }
            });
        });
    });
    </script>
</body>

</html>