<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Register - {{ 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 to {{ g.branding.app_name if g.branding else 'TimeTrack' }}</h1>
        <p>Join your company team</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 %}
    
    <div class="registration-options mb-4">
        <div class="alert alert-info">
            <h5>Registration Options:</h5>
            <p><strong>Company Employee:</strong> You're on the right page! Enter your company code below.</p>
            <p><strong>Freelancer/Independent:</strong> <a href="{{ url_for('register_freelancer') }}" class="btn btn-outline-primary btn-sm">Register as Freelancer</a></p>
        </div>
    </div>
    
    <form method="POST" action="{{ url_for('register') }}" class="auth-form">
        <div class="form-group company-code-group">
            <label for="company_code">Company Code</label>
            <input type="text" id="company_code" name="company_code" class="form-control" required autofocus 
                   placeholder="ENTER-CODE">
            <small class="form-text text-muted">Get this code from your company administrator</small>
        </div>
        
        <div class="form-group input-icon">
            <i>👤</i>
            <input type="text" id="username" name="username" class="form-control" placeholder="Choose a username" required>
            <label for="username">Username</label>
        </div>
        
        <div class="form-group input-icon">
            <i>📧</i>
            <input type="email" id="email" name="email" class="form-control" placeholder="your@email.com (optional)">
            <label for="email">Email Address (Optional)</label>
            <small class="form-text text-muted">Recommended for account recovery and notifications</small>
        </div>
        
        <div class="form-group input-icon">
            <i>🔒</i>
            <input type="password" id="password" name="password" class="form-control" placeholder="Create a strong password" required>
            <label for="password">Password</label>
        </div>
        
        <div class="form-group input-icon">
            <i>🔒</i>
            <input type="password" id="confirm_password" name="confirm_password" class="form-control" placeholder="Confirm your password" required>
            <label for="confirm_password">Confirm Password</label>
        </div>
        
        <div class="form-check">
            <input type="checkbox" class="form-check-input" id="terms" required>
            <label class="form-check-label" for="terms">
                I agree to the Terms of Service and Privacy Policy
            </label>
        </div>
        
        <div class="form-group">
            <button type="submit" class="btn btn-primary">Create Account</button>
        </div>
        
        <div class="auth-links">
            <p>Already have an account? <a href="{{ url_for('login') }}">Login here</a></p>
        </div>
        
        <div class="verification-notice">
            <p>💡 You can register without an email, but we recommend adding one later for account recovery.</p>
        </div>
    </form>
</div>

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