<?php
include("opendb.php");
?>
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>PSN Login</title>
  <style>
    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      font-family: "Segoe UI", sans-serif;
      background: linear-gradient(135deg, #153b81db, #5079c1b3);
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
      padding: 20px;
    }

    .login-container {
      background: #ffffff;
      padding: 30px 40px;
      border-radius: 12px;
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
      width: 100%;
      max-width: 475px;
    }

    .logo-title {
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 20px;
    }

    .logo-title img {
      height: 60px;
      margin-right: 15px;
    }

    .logo-title h2 {
      color: #2a5298;
      font-size: 16px;
      margin: 0;
      /* font-weight: 600; */
    }

    /* h2{
      color: #2a5298;
      text-align: center;
      margin: 0;
    } */

    h3 {
      text-align: center;
      color: #9b9b9b;
      margin-bottom: 25px;
      font-size: 20px;
    }

    form label {
      font-weight: bold;
      margin-bottom: 5px;
      display: block;
    }

    form select,
    form input[type="text"],
    form input[type="password"] {
      width: 100%;
      padding: 10px;
      margin-bottom: 15px;
      border: 1px solid #ccc;
      border-radius: 6px;
      font-size: 14px;
    }

    form input[type="submit"] {
      width: 100%;
      padding: 10px;
      background-color: #2a5298;
      color: white;
      border: none;
      border-radius: 6px;
      font-weight: bold;
      font-size: 15px;
      cursor: pointer;
      transition: background-color 0.3s ease;
    }

    form input[type="submit"]:hover {
      background-color: #1e3c72;
    }

    .warning {
      display: flex;
      align-items: flex-start;
      margin-top: 25px;
      background-color: #fffbe6;
      padding: 10px 15px;
      border-left: 4px solid #ffc107;
      border-radius: 6px;
      font-size: 13px;
      color: #444;
    }

    .warning img {
      height: 28px;
      margin-right: 12px;
      margin-top: 3px;
    }

    .footer {
      margin-top: 25px;
      font-size: 12px;
      text-align: center;
      color: #777;
    }
  </style>
</head>

<body>
  <div class="login-container">
    <div class="logo-title" style="text-align: center; margin-bottom: 20px;background: aliceblue; width: 100%;border-radius:10px;padding:10px;">
      <img src="images/logo.png" alt="PSN Logo" style="height: 60px; display: block; margin: 0 auto 10px;">
      <h2 style="color: #2a5298; font-size: 18px; margin: 0;">102 Years of Reputation and Trust</h2>
    </div>

    <h3>LOGIN (2025 - 2026) #New Server</h3>

    <form name="f1" action="loginbranch.php" method="post" autocomplete="on">
      <label for="br">Branch</label>
      <select name="br" required>
        <?php
        $result = mysqli_query($db, "SELECT brname FROM branch WHERE brstate='Y' ORDER BY brname");
        while ($row = mysqli_fetch_row($result)) {
          echo "<option>$row[0]</option>";
        }
        ?>
      </select>

      <label for="uname">User Name</label>
      <input type="text" name="uname" required>

      <label for="pswd">Password</label>
      <input type="password" name="pswd" required>

      <input type="submit" value="Login">
    </form>

    <div class="warning">
      <img src="images/att!.png" alt="Attention">
      <div>
        Keep your passwords strictly confidential.<br>
        Never share them!<br>
        All entries are recorded with IP information.
      </div>
    </div>

    <div class="footer">
      &copy; PSN Accounts Department
    </div>
  </div>
</body>

</html>
