<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>BrewVerse</title>
    <link
      href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"
      rel="stylesheet"
      integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN"
      crossorigin="anonymous"
    />
    <script
      defer
      src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
      integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
      crossorigin="anonymous"
    ></script>
  </head>
  <body >
    <style>

.header {
        border-end-end-radius: 25px;
        border-end-start-radius: 25px;
        overflow: hidden;
        background-color: #d0740b;
        padding: 20px 10px;
      }

      .cardHover :hover{
        cursor: pointer;
      }

      h2, label{
        color: whitesmoke;
      }
      form {
        color:#f18d1b;
      }

      /* Style the header links */
      .header a {
        float: left;
        color: black;
        text-align: center;
        padding: 12px;
        text-decoration: none;
        font-size: 18px;
        line-height: 25px;
        border-radius: 4px;
      }

      /* Style the logo link (notice that we set the same value of line-height and font-size to prevent the header to increase when the font gets bigger */
      .header a.logo {
        font-size: 25px;
        font-weight: bold;
      }

      /* Change the background color on mouse-over */
      .header a:hover {
        border: 1px solid black;
        border-radius: 5px;
        background-color: #ddd;
        color: black;
      }

      /* Style the active/current link*/
      .header a.active {
        background-color: dodgerblue;
        color: white;
      }

      #cardHolder{
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
      }

      /* Float the link section to the right */
      .header-right {
        float: right;
      }

      .dropdown {
    position: absolute;
    top: 50px; /* Adjust the vertical position as needed */
    right: 0;
    display: block;
    }

      /* Add media queries for responsiveness - when the screen is 500px wide or less, stack the links on top of each other */
      @media screen and (max-width: 500px) {
        .header a {
          float: none;
          display: block;
          text-align: left;
        }
        .header-right {
          float: none;
        }
      }

      @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap");

  body {
			background: url(https://t4.ftcdn.net/jpg/03/92/25/09/240_F_392250914_2Od8jNRBPgpMu8W29vCh4hiu5EUXbgGU.jpg) no-repeat center center fixed; 
			-webkit-background-size: cover;
			-moz-background-size: cover;
			-o-background-size: cover;
			background-size: cover;
  }


  .rating-box {
    width: fit-content;
    position: relative;
    background: #f8c78f;
    padding: 25px 50px 35px;
    border-radius: 25px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
  }
  .rating-box header {
    font-size: 22px;
    color: #000000;
    font-weight: 500;
    margin-bottom: 20px;
    text-align: center;
  }
  .rating-box .stars {
    display: flex;
    align-items: center;
    gap: 25px;
  }
  .stars i {
    color: #e6e6e6;
    font-size: 35px;
    cursor: pointer;
    transition: color 0.2s ease;
  }
  .stars i.active {
    color: #ff9c1a;
  }

  .brewDetailsHolder{
    justify-content: center;
    align-items: center;
    display: flex;
    flex-direction: column;
  }
    </style>

    <div style="display: flex;justify-content: center; align-items: center; text-align: center;" class="header">
      <p style="font-size: xx-large; font-style: italic;" ><strong>BrewVerse</strong></p>
      <img src="beer.png" width="50px" class="logo" onclick="location.href='/'"></img>
      <div class="header-right">
      </div>
    </div>
    <div class="mt-5" style="display: flex; padding: 10px; justify-content: center; align-items: center; height: 100vh;">
    <div style="display: flex; flex-wrap: wrap; width: fit-content; border: 2px solid whitesmoke;border-radius: 10px; padding: 20px; justify-content: center; align-items: center;">
        <div style="border: 1px solid grey; border-radius: 10px;" class="mx-5 ms-2 p-3">
            <h2>Login</h2>
        <form action="/login" method="POST" style="display: flex; flex-direction: column;">
            <label for="username">Username:</label>
            <input type="text" name="username" required autocomplete="off">
            <label for="password">Password:</label> 
            <input type="password" name="password" required autocomplete="off">
            <button style="background-color: #f18d1b;" class="btn mt-2" type="submit">Login</button>
        </form>
        </div>

        <!-- <div style="z-index: 100; background-color: red; height: max-content; height: max-content; border: 3px solid black;" id="LoginSignupSlider">
          <button>SIGNUP</button>
        </div> -->
        
        <div style="border: 1px solid grey; border-radius: 10px;" class="m-2 me-2 p-3">
        <h2>Signup</h2>
        <form action="/signup" method="POST" onsubmit="return SignUpvalidate()" style="display: flex; flex-direction: column;">
            <label for="username">Username:</label>
            <input type="text" name="username" required autocomplete="off">
            <label for="fullname">Full name:</label>
            <input type="text" name="fullname" required autocomplete="off">
            <label for="email">Email:</label>
            <input type="email" name="email" required autocomplete="off">
            <label for="password">Password:</label>
            <input oninput="SignUpvalidate()" id="password" type="password" name="password" required>
            <label for="re-password">Re-enter Password:</label>
            <input oninput="SignUpvalidate()" id="repassword" type="password" name="re-password" required>
            <h6 id="wrongpassWarning" style="display: none; color: red;">Passwords dont match*</h6>
            <button id="signupBtn" style="background-color: #f18d1b;" disabled class="btn mt-2" type="submit">Sign up</button>
        </form>
        </div>
        <div class="m-0 pb-0 text-center" style="width: 100%; color: red; font-size: 15px;"><p class="m-0 p-0"><%= locals.errStr || '' %></p></div>
    </div>
</div>
<script>
  function SignUpvalidate(){
    let pass = document.getElementById('password').value;
    let repass = document.getElementById('repassword').value;
    let wrongPass = document.getElementById('wrongpassWarning');
    let signupBtn = document.getElementById('signupBtn');
    console.log(pass);
    if (pass===repass && pass.length>7){
      signupBtn.disabled = false;
      wrongPass.style.display = 'none';
      return true;
    }
    else {
      wrongPass.style.display = 'block';
      signupBtn.disabled = true;
    return false;
  }
  }
</script>
  </body>
</html>
