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

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Gabay | Guided Setup</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;
        }

        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--bg);
            color: var(--text-main);
            margin: 0;
            padding: 40px 20px;
            min-height: 100vh;
        }

        .container {
            max-width: 800px;
            margin: 0 auto;
            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: 28px;
            font-weight: 700;
            margin-bottom: 8px;
            text-align: center;
            color: var(--text-main);
            text-transform: uppercase;
            letter-spacing: -0.025em;
        }

        .subtitle {
            color: var(--text-muted);
            text-align: center;
            font-size: 16px;
            margin-bottom: 40px;
        }

        .section-title {
            font-size: 12px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: var(--primary);
            margin: 32px 0 16px;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--border);
        }

        .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: 14px;
            box-sizing: border-box;
            transition: all 0.2s;
        }

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

        button {
            width: 100%;
            padding: 16px;
            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;
            margin-top: 24px;
        }

        button:hover {
            opacity: 0.9;
        }

        .footer-links {
            text-align: center;
            margin-top: 32px;
        }

        .footer-links a {
            color: var(--text-muted);
            text-decoration: none;
            font-size: 13px;
            font-weight: 600;
            text-transform: uppercase;
        }

        .footer-links a:hover {
            color: var(--text-main);
        }
    </style>
</head>

<body>
    <div class="container">
        <h1>🛠 Gabay Quick Setup</h1>
        <p class="subtitle">Personalize your AI assistant in minutes</p>

        <form action="/setup/config" method="POST">
            <input type="hidden" name="user_id" value="{{ user_id }}">

            <div class="section-title">Core API Keys</div>
            <div class="form-group">
                <label>Telegram Bot Token (@BotFather)</label>
                <input type="password" name="bot_token" value="{{ bot_token }}" placeholder="e.g. 123456:ABC-DEF...">
            </div>
            <div class="form-group">
                <label>Groq API Key (Llama 3 Power)</label>
                <input type="password" name="groq_key" value="{{ groq_key }}" placeholder="gsk_...">
            </div>

            <div class="section-title">Mailbox (SMTP)</div>
            <div class="grid">
                <div class="form-group">
                    <label>SMTP Host</label>
                    <input type="text" name="smtp_host" value="{{ smtp_host }}">
                </div>
                <div class="form-group">
                    <label>Port</label>
                    <input type="number" name="smtp_port" value="{{ smtp_port }}">
                </div>
            </div>
            <div class="grid">
                <div class="form-group">
                    <label>Email Address</label>
                    <input type="email" name="smtp_user" value="{{ smtp_user }}">
                </div>
                <div class="form-group">
                    <label>App Password</label>
                    <input type="password" name="smtp_pass" placeholder="Your Gmail App Password">
                </div>
            </div>

            <div class="section-title">OAuth & Localization</div>
            <div class="form-group">
                <label>Google Client ID</label>
                <input type="text" name="google_id" value="{{ google_id }}">
            </div>
            <div class="grid">
                <div class="form-group">
                    <label>Google Client Secret</label>
                    <input type="password" name="google_secret" value="{{ google_secret }}">
                </div>
                <div class="form-group">
                    <label>Timezone</label>
                    <input type="text" name="tz" value="{{ tz }}">
                </div>
            </div>

            <button type="submit">Save Configuration</button>
        </form>

        <div class="footer-links">
            <a href="/admin?user_id={{ user_id }}">← Back to Dashboard</a>
        </div>
    </div>
</body>

</html>