<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Travel World - Staff Login</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body, html {
      height: 100%;
      font-family: 'Arial', sans-serif;
      background: linear-gradient(120deg, #1e3c72, #2a5298, #00c6ff);
      background-size: 200% 200%;
      animation: gradientBG 8s ease infinite;
      display: flex;
      justify-content: center;
      align-items: center;
      color: #333;
    }

    @keyframes gradientBG {
      0% { background-position: 0% 50%; }
      50% { background-position: 100% 50%; }
      100% { background-position: 0% 50%; }
    }

    .login-container {
      width: 400px;
      padding: 40px;
      background: rgba(255, 255, 255, 0.9);
      border-radius: 15px;
      box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
      text-align: center;
      animation: fadeIn 1.5s ease;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: scale(0.95);
      }
      to {
        opacity: 1;
        transform: scale(1);
      }
    }

    .login-container h1 {
      font-size: 28px;
      margin-bottom: 20px;
      color: #1e3c72;
    }

    .login-container p {
      font-size: 14px;
      margin-bottom: 30px;
      color: #555;
    }

    .login-container input {
      width: 100%;
      padding: 12px 15px;
      margin: 10px 0;
      border: 2px solid #ddd;
      border-radius: 8px;
      font-size: 14px;
      background-color: #f8f8f8;
      transition: border-color 0.3s ease, box-shadow 0.3s ease;
    }

    .login-container input:focus {
      outline: none;
      border-color: #1e3c72;
      box-shadow: 0 0 8px rgba(30, 60, 114, 0.3);
    }

    .login-container button {
      width: 100%;
      padding: 15px;
      font-size: 16px;
      font-weight: bold;
      border: none;
      border-radius: 8px;
      background: linear-gradient(135deg, #1e3c72, #2a5298);
      color: #fff;
      cursor: pointer;
      transition: background 0.3s ease, transform 0.2s ease;
    }

    .login-container button:hover {
      background: linear-gradient(135deg, #2a5298, #00c6ff);
      transform: scale(1.03);
    }

    .notification {
      margin-top: 20px;
      padding: 15px;
      display: none;
      text-align: center;
      border-radius: 8px;
      font-weight: bold;
      font-size: 14px;
    }

    .notification.success {
      background-color: #4caf50;
      color: #fff;
    }

    .notification.error {
      background-color: #ff4c4c;
      color: #fff;
    }

    .login-container .footer {
      margin-top: 20px;
      font-size: 12px;
      color: #888;
    }

    .login-container .footer a {
      color: #1e3c72;
      text-decoration: none;
      font-weight: bold;
      transition: color 0.2s ease;
    }

    .login-container .footer a:hover {
      color: #00c6ff;
    }
  </style>
</head>
<body>

  <div class="login-container">
    <h1>Welcome to Travel World</h1>
    <p>Enter your credentials to access the dashboard</p>
    <input type="text" id="username" placeholder="Username" autocomplete="username">
    <input type="password" id="password" placeholder="PIN" maxlength="4" autocomplete="current-password">
    <button onclick="login()">Login</button>

    <div class="notification" id="notification"></div>

    <div class="footer">
      <p>Need help? <a href="#">Contact Support</a></p>
    </div>
  </div>

  <script>
    // User database with predefined random PINs
    const users = {
      beernaatttt: {
        pin: '2345', // Predefined 4-digit PIN
        redirect: 'https://travelworld.auroratech.es/log-in/eX9FKiYvB43yTTrVc9LryOviM-html'
      },
      deivid6162: {
        pin: '9876', // Predefined 4-digit PIN
        redirect: 'https://travelworld.auroratech.es/log-in/Cs1KkLbx517fdIaYtxp0kEUbi-html'
      },
      servaneso: {
        pin: '3456', // Predefined 4-digit PIN
        redirect: 'https://travelworld.auroratech.es/log-in/4h41Vi111DiOXvj4B308xy8SA-html'
      },
      mikelin_2002: {
        pin: '7890', // Predefined 4-digit PIN
        redirect: 'https://travelworld.auroratech.es/log-in/aZlZvy90ST1CBaKy8PgLCrDhT-html'
      }
    };

    function login() {
      const username = document.getElementById('username').value.trim();
      const password = document.getElementById('password').value.trim();
      const notification = document.getElementById('notification');

      // Reset notification
      notification.style.display = 'none';

      // Check user and pin
      if (users[username] && users[username].pin === password) {
        notification.textContent = 'Login Successful! Redirecting...';
        notification.className = 'notification success';
        notification.style.display = 'block';

        setTimeout(() => {
          const screenWidth = window.screen.availWidth;
          const screenHeight = window.screen.availHeight;

          window.open(
            users[username].redirect,
            '_blank',
            `width=${screenWidth},height=${screenHeight},top=0,left=0`
          );
        }, 1500);
      } else {
        notification.textContent = 'Invalid Username or PIN!';
        notification.className = 'notification error';
        notification.style.display = 'block';
      }
    }
  </script>

</body>
</html>