<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Gabay | Verification</title>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
    <style>
        :root {
            --primary: #3b82f6;
            --primary-hover: #2563eb;
            --bg: #111115;
            --surface: #1A1A24;
            --border: rgba(255, 255, 255, 0.1);
            --text-main: #f1f5f9;
            --text-muted: #94a3b8;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Inter', sans-serif;
        }

        body {
            background-color: var(--bg);
            color: var(--text-main);
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            padding: 20px;
        }

        .container {
            max-width: 500px;
            width: 100%;
            background: var(--surface);
            padding: 40px;
            border-radius: 12px;
            border: 1px solid var(--border);
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
        }

        h1 {
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 24px;
            text-align: center;
            color: var(--text-main);
            text-transform: uppercase;
            letter-spacing: -0.025em;
        }

        .form-group {
            margin-bottom: 24px;
        }

        label {
            display: block;
            font-size: 14px;
            font-weight: 500;
            margin-bottom: 8px;
            color: var(--text-muted);
        }

        input {
            width: 100%;
            padding: 12px 16px;
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            color: white;
            font-family: inherit;
            font-size: 24px;
            text-align: center;
            letter-spacing: 0.5em;
            box-sizing: border-box;
            transition: all 0.2s;
        }

        input:focus {
            outline: none;
            border-color: var(--primary);
        }

        button {
            width: 100%;
            padding: 14px;
            background: var(--text-main);
            color: var(--bg);
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s;
            text-transform: uppercase;
            letter-spacing: 0.025em;
        }

        button:hover {
            opacity: 0.9;
        }

        .back-link {
            display: block;
            text-align: center;
            margin-top: 24px;
            color: var(--text-muted);
            text-decoration: none;
            font-size: 13px;
            font-weight: 600;
            text-transform: uppercase;
        }

        .back-link:hover {
            color: var(--text-main);
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="icon">📬</div>
        <h1>Enter Login Code</h1>
        <p class="subtitle">Check your Telegram app for a message with the 5-digit verification code.</p>

        <form action="/setup/verify" method="POST">
            <div class="code-input-container">
                <input type="text" name="code" placeholder="00000" maxlength="10" required autofocus>
            </div>

            <input type="hidden" name="user_id" value="{{ user_id }}">
            <input type="hidden" name="phone" value="{{ phone }}">

            <button type="submit">Verify & Authorize</button>
        </form>

        <div class="footer">
            Didn't get a code? <a href="/setup?user_id={{ user_id }}"
                style="color: var(--primary); text-decoration: none;">Restart Setup</a>
        </div>
    </div>
</body>

</html>