<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login - SA STEM Tutor</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <style>
        .btn-google {
            background-color: #db4437;
            color: white;
            padding: 12px 24px;
            border-radius: 5px;
            text-decoration: none;
            display: inline-block;
            border: none;
            width: 100%;
            text-align: center;
            font-size: 16px;
        }
        .btn-google:hover {
            background-color: #c23321;
            color: white;
        }
        .login-container {
            max-width: 400px;
            margin: 100px auto;
            padding: 20px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="login-container">
            <h2 class="text-center mb-4">Login to SA STEM Tutor</h2>
            
            <!-- Flash messages -->
            {% with messages = get_flashed_messages(with_categories=true) %}
                {% if messages %}
                    {% for category, message in messages %}
                        <div class="alert alert-{{ category }} alert-dismissible fade show">
                            {{ message }}
                            <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
                        </div>
                    {% endfor %}
                {% endif %}
            {% endwith %}
            
            <div class="login-options">
                <a href="{{ url_for('google_login') }}" class="btn btn-google mb-3">
                    <i class="fab fa-google"></i> Continue with Google
                </a>
            </div>
            
            <div class="text-center mt-3">
                <a href="{{ url_for('index') }}" class="text-muted">Back to Home</a>
            </div>
            
            <!-- Debug link -->
            {% if config.DEBUG %}
            <div class="mt-3 text-center">
                <a href="{{ url_for('debug_oauth') }}" class="text-muted small">Debug OAuth</a>
            </div>
            {% endif %}
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>