<?php
session_start();
// Database connection goes here
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Student Login | Ahmad Academy</title>
    
    <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">

    <style>
        :root {
            --primary: #064e3b;
            --primary-dark: #022c22;
            --accent: #d4af37; /* Golden */
            --bg-light: #f8fafc;
        }

        body {
            /* Premium Dark Green Gradient Background */
            background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
            font-family: 'Outfit', sans-serif;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0;
            padding: 20px;
        }

        .login-card {
            background: #ffffff;
            border-radius: 20px;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
            width: 100%;
            max-width: 450px;
            padding: 45px 40px;
            position: relative;
            overflow: hidden;
            border-top: 6px solid var(--accent); /* Golden Top Border */
        }

        .brand-icon {
            width: 75px; height: 75px;
            background: rgba(212, 175, 55, 0.1); /* Light Golden Background */
            border-radius: 20px;
            display: flex; align-items: center; justify-content: center;
            margin: 0 auto 20px;
            font-size: 35px; 
            color: var(--accent);
            box-shadow: 0 10px 20px rgba(212, 175, 55, 0.15);
        }

        .login-title { font-weight: 800; color: var(--primary-dark); text-align: center; margin-bottom: 5px; font-size: 26px; }
        .login-subtitle { color: #64748b; text-align: center; font-size: 15px; margin-bottom: 35px; font-weight: 500; }

        .form-label { font-weight: 700; color: var(--primary); font-size: 14px; margin-bottom: 8px; }

        .input-group-custom {
            position: relative;
            margin-bottom: 25px;
        }

        /* Left Icon Design */
        .input-group-custom .icon-left {
            position: absolute;
            left: 18px;
            top: 50%;
            transform: translateY(-50%);
            color: #94a3b8;
            z-index: 10;
            transition: 0.3s;
            font-size: 18px;
        }

        /* Right Icon (Eye) Design */
        .input-group-custom .toggle-password {
            position: absolute;
            right: 18px;
            top: 50%;
            transform: translateY(-50%);
            color: #94a3b8;
            z-index: 10;
            cursor: pointer;
            transition: 0.3s;
            font-size: 18px;
        }
        
        .input-group-custom .toggle-password:hover { color: var(--primary); }

        .form-control {
            height: 55px;
            padding-left: 50px !important; /* Space for left icon */
            padding-right: 50px !important; /* Space for right icon */
            border-radius: 12px;
            background-color: #f8fafc;
            border: 2px solid #e2e8f0;
            font-weight: 500;
            font-size: 15px;
            color: #334155;
            transition: all 0.3s ease;
        }

        .form-control:focus {
            background-color: #fff;
            border-color: var(--accent);
            box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15);
            outline: none;
        }

        /* Change left icon color on focus */
        .form-control:focus + .icon-left { color: var(--accent); }

        /* Checkbox Style */
        .form-check-input:checked {
            background-color: var(--primary);
            border-color: var(--primary);
        }

        /* Login Button - Golden Color */
        .btn-login {
            background-color: var(--accent);
            color: var(--primary-dark);
            width: 100%;
            height: 55px;
            border-radius: 12px;
            font-weight: 800;
            font-size: 16px;
            border: none;
            margin-top: 10px;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
        }

        .btn-login:hover {
            background-color: #cda832;
            transform: translateY(-3px);
            box-shadow: 0 12px 25px rgba(212, 175, 55, 0.4);
            color: var(--primary-dark);
        }

        .forgot-pass {
            color: var(--primary);
            font-weight: 700;
            font-size: 14px;
            transition: 0.3s;
        }
        .forgot-pass:hover { color: var(--accent); }

        .login-footer {
            text-align: center;
            margin-top: 30px;
            font-size: 15px;
            color: #64748b;
        }

        .login-footer a.register-link { 
            color: var(--primary); 
            font-weight: 800; 
            text-decoration: none; 
            border-bottom: 2px solid transparent;
            transition: 0.3s;
        }
        .login-footer a.register-link:hover { color: var(--accent); border-color: var(--accent); }

        .back-link {
            display: inline-block;
            text-align: center;
            margin-top: 25px;
            font-size: 14px;
            color: #94a3b8;
            text-decoration: none;
            font-weight: 600;
            transition: 0.3s;
        }
        .back-link:hover { color: var(--primary); }
    </style>
</head>
<body>

    <div class="login-card">
        <div class="brand-icon">
            <i class="fas fa-user-graduate"></i>
        </div>
        <h3 class="login-title">Student Login</h3>
        <p class="login-subtitle">Enter your details to access your account</p>

        <form action="login_process.php" method="POST">
            <div class="mb-3">
                <label class="form-label">Email Address</label>
                <div class="input-group-custom">
                    <input type="email" name="email" class="form-control" placeholder="student@ahmadacademy.com" required>
                    <i class="fas fa-envelope icon-left"></i>
                </div>
            </div>

            <div class="mb-3">
                <label class="form-label">Password</label>
                <div class="input-group-custom">
                    <input type="password" id="password" name="password" class="form-control" placeholder="••••••••" required>
                    <i class="fas fa-lock icon-left"></i>
                    <i class="fas fa-eye toggle-password" id="togglePassword" onclick="togglePassVisibility()"></i>
                </div>
            </div>

            <div class="d-flex justify-content-between align-items-center mb-4">
                <div class="form-check">
                    <input class="form-check-input" type="checkbox" id="remember" name="remember">
                    <label class="form-check-label fw-semibold text-muted" for="remember" style="font-size: 14px;">Remember me</label>
                </div>
                <a href="forgot_password" class="text-decoration-none forgot-pass">Forgot Password?</a>
            </div>

            <button type="submit" class="btn btn-login">
                Login <i class="fas fa-sign-in-alt"></i>
            </button>
        </form>

        <div class="login-footer">
            Don't have an account yet? <a href="admission" class="register-link">Register Now</a>
            <br>
            <a href="https://ahmadonlineacademy.com/" class="back-link"><i class="fas fa-arrow-left me-1"></i> Back to Homepage</a>
        </div>
    </div>

    <script>
        function togglePassVisibility() {
            const passwordInput = document.getElementById('password');
            const toggleIcon = document.getElementById('togglePassword');

            if (passwordInput.type === 'password') {
                passwordInput.type = 'text';
                toggleIcon.classList.remove('fa-eye');
                toggleIcon.classList.add('fa-eye-slash');
            } else {
                passwordInput.type = 'password';
                toggleIcon.classList.remove('fa-eye-slash');
                toggleIcon.classList.add('fa-eye');
            }
        }
    </script>
</body> 
</html>