<?php
include ("connection.php");
// if(isset($_POST['submit'])){
//     $email = $_POST['users'];
//     $sql = "SELECT * FROM `login` WHERE `users` = '$email'";
//     $query = mysqli_query($con,$sql);
//     if(mysqli_num_rows($query) > 0){
//         header("location : reset.php");
//     }
// }

ob_start();

session_start();
    if(isset($_POST['submit'])){
      $email = $_POST['user'];
        $query = "SELECT * FROM `login` where user = '$email'";
        $sql= mysqli_query($con,$query) or die ("Error");
        if(mysqli_num_rows($sql) > 0){
            header('location:reset.php');
        }
    }
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">    
    <link href="https://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet">
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css">
    <title>Forget</title>
    <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    .form {
      display: flex;
      flex-direction: column;
      gap: 10px;
      background-color: #072645;

      padding: 30px;
      max-width: 450px;
      width: 100%;
      border-radius: 20px;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
      box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    }

    h2 {
      text-align: center;
      color: white;

    }

    ::placeholder {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
        color: white;
    }

    .form button {
      align-self: flex-end;
    }

    .flex-column>label {
      color: white;
      font-weight: 600;
    }

    .inputForm {
      border: 1.5px solid #ecedec;
      border-radius: 10px;
      height: 50px;
      display: flex;
      align-items: center;
      padding-left: 10px;
      transition: 0.2s ease-in-out;
    }

    .input {
      margin-left: 10px;
      border-radius: 10px;
      border: none;
      width: 85%;
      height: 100%;
      background: none;
      color: white;
      font-size: 15px;
    }

    .input:focus {
      outline: none;
    }

    .inputForm:focus-within {
      border: 1.5px solid #2d79f3;
    }

    .flex-row {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 10px;
      justify-content: space-between;
    }

    .flex-row>div>label {
      font-size: 14px;
      color: black;
      font-weight: 400;
    }

    .span {
      font-size: 14px;
      margin-left: 5px;
      color: #2d79f3;
      font-weight: 500;
      cursor: pointer;
    }

    .button-submit {
      margin: 20px 0 10px 0;
      background-color: #ebbe00;
      border: none;
      color: black;
      font-size: 15px;
      font-weight: 600;
      border-radius: 10px;
      height: 50px;
      width: 100%;
      cursor: pointer;
    }

    .button-submit:hover {
      background-color: #252727;
      color: white;
    }

    .p {
      text-align: center;
      color: black;
      font-size: 14px;
      margin: 5px 0;
    }

    .btn {
      margin-top: 10px;
      width: 30%;
      height: 50px;
      border-radius: 10px;
      display: flex;
      justify-content: center;
      align-items: center;
      font-weight: 500;
      gap: 10px;
      border: 1px solid #ededef;
      background-color: white;
      cursor: pointer;
      transition: 0.2s ease-in-out;
    }

    .btn:hover {
      border: 1px solid #2d79f3;
    }
  </style>
</head>
<body>
<form class="form" method="post">
    <h2>Username</h2>
    <div class="flex-column">
      <label>User</label>
    </div>
    <div class="inputForm">
      <svg xmlns="http://www.w3.org/2000/svg" color="white" width="16" height="16" fill="currentColor" class="bi bi-person-circle" viewBox="0 0 16 16">
        <path d="M11 6a3 3 0 1 1-6 0 3 3 0 0 1 6 0" />
        <path fill-rule="evenodd" d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8m8-7a7 7 0 0 0-5.468 11.37C3.242 11.226 4.805 10 8 10s4.757 1.225 5.468 2.37A7 7 0 0 0 8 1" />
      </svg>
      <input type="text" class="input" name="user" placeholder="Enter your User name" required/>
    </div>
    <!--  -->
    
    <button type="submit" class="button-submit" name="submit">Next Step</button>
    
  </form>
    
</body>
</html>