<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Connexion - Espace Professeur</title>
    <!-- Bootstrap CSS -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <!-- Google Fonts - Montserrat -->
    <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <link href="../auth-style.css" rel="stylesheet">
</head>
<body>
<div class="container-custom">
    <div class="card main-card">
        <div class="logo">
            <div class="logo-icon">
                <i class="fas fa-chalkboard-teacher"></i>
            </div>
            <h1>Espace Employee</h1>
        </div>

        <form id="loginForm" method="POST" action="">

            <div class="mb-3">
                <label class="form-label">Email Professionnel</label>
                <div class="input-with-icon">
                    <i class="fas fa-envelope"></i>
                    <input type="email" class="form-control" id="email" name="email" placeholder="Entrez votre email professionnel" required>
                </div>
                <div class="error-message" id="email-error">Veuillez entrer votre email</div>
            </div>

            <div class="mb-3">
                <label class="form-label">Mot de passe</label>
                <div class="input-with-icon">
                    <i class="fas fa-lock"></i>
                    <input type="password" class="form-control" id="password" name="password" placeholder="Entrez votre mot de passe" required>
                </div>
                <div class="error-message" id="password-error">Veuillez entrer votre mot de passe</div>
            </div>

            <div class="forgot-password">
                <a href="/est-concours/app/cnx/employee/forgot-password">Mot de passe oublié ?</a>
            </div>

            <button type="submit" class="btn btn-custom-primary d-flex align-items-center justify-content-center gap-2 mb-3" id="loginBtn">
                <i class="fas fa-sign-in-alt"></i> Se Connecter
            </button>

            <div class="separator">
                <span>Accès réservé aux professeurs</span>
            </div>
             <div class="separator">
                <span>Nouveau candidat ?</span>
            </div>

            <button type="button" class="btn btn-custom-secondary d-flex align-items-center justify-content-center gap-2 mb-3" onclick="redirectToCreateAccount()">
                <i class="fas fa-user-plus"></i> Créer un compte
            </button>

            <div class="admin-link">
                <a href="admin-login.php">
                    <i class="fas fa-cog"></i> Accès Administration
                </a>


        </form>
    </div>
</div>

<script src="main.js"></script>

<!-- Bootstrap JS Bundle with Popper -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>

<script>
    function redirectToCreateAccount() {

        window.location.href = '/est-concours/app/cnx/employee/create';
    }

    // Focus on first input on page load
    document.addEventListener('DOMContentLoaded', function() {
        document.getElementById('email').focus();  // ✅ تغيير: cin → email
    });
</script>
</body>
</html>
