<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login - {{ g.branding.app_name if g.branding else 'TimeTrack' }}</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/fonts.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/auth.css') }}">
</head>
<body class="auth-page">
<div class="auth-container">
    <div class="auth-brand">
        <h1>Welcome Back</h1>
        <p>Sign in to {{ g.branding.app_name if g.branding else 'TimeTrack' }}</p>
    </div>
    
    {% with messages = get_flashed_messages(with_categories=true) %}
        {% if messages %}
            {% for category, message in messages %}
                <div class="alert alert-{{ category }}">{{ message }}</div>
            {% endfor %}
        {% endif %}
    {% endwith %}
    
    <form method="POST" action="{{ url_for('login') }}" class="auth-form">
        <div class="form-group input-icon">
            <i>👤</i>
            <input type="text" id="username" name="username" class="form-control" placeholder="Enter your username" required autofocus>
            <label for="username">Username</label>
        </div>
        
        <div class="form-group input-icon">
            <i>🔒</i>
            <input type="password" id="password" name="password" class="form-control" placeholder="Enter your password" required>
            <label for="password">Password</label>
        </div>
        
        <div class="form-check">
            <input type="checkbox" class="form-check-input" id="remember" name="remember">
            <label class="form-check-label" for="remember">
                Keep me signed in
            </label>
        </div>
        
        <div class="form-group">
            <button type="submit" class="btn btn-primary">Sign In</button>
        </div>
        
        <div class="auth-links" style="margin-bottom: 1rem;">
            <p>
                <a href="{{ url_for('forgot_password') }}">Forgot your password?</a>
            </p>
        </div>
        
        <div class="social-divider">
            <span>New to {{ g.branding.app_name if g.branding else 'TimeTrack' }}?</span>
        </div>
        
        <div class="auth-links">
            <p>
                <a href="{{ url_for('register') }}" style="margin-right: 1rem;">Join a Company</a>
                <a href="{{ url_for('register_freelancer') }}">Start Freelancing</a>
            </p>
        </div>
    </form>
</div>

<script src="{{ url_for('static', filename='js/auth-animations.js') }}"></script>
</body>
</html>