<?php
include('assets/header.php');
?>
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0" name="viewport">

  <title><?php echo $row[0]; ?> ||LOGIN</title>
  <meta content="" name="description">
  <meta content="" name="keywords">

  <link href="img/logo/logo22222.png" rel="icon">

    <!-- Google Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">

    <!-- Font Awesome & Bootstrap Icons -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css" rel="stylesheet">

    <!-- Bootstrap 5 -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- AOS Animation Library -->
    <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">

    <!-- SweetAlert2 -->
    <link href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>

    <!-- jQuery -->
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

    <style>
        
        
        .registration-container {
            max-width: 1000px;
            margin: 98px auto;
        }
        
        .glass-card {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            border-radius: 30px;
            padding: 40px;
        }
        .rounded-circle {
    border-radius: 20% !important;
}
        .form-header {
            text-align: center;
            margin-bottom: 30px;
        }
        
        .form-header h2 {
            font-size: 2.5rem;
            font-weight: 700;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            margin-bottom: 10px;
        }
        
        .form-group {
            margin-bottom: 20px;
        }
        
        .form-label {
            font-weight: 600;
            color: #333;
            margin-bottom: 8px;
            display: block;
        }
        
        .form-label i {
            color: var(--primary);
            margin-right: 8px;
        }
        
        .form-control, .input-group-text {
            border: 2px solid #e2e8f0;
            border-radius: 15px;
            padding: 12px 20px;
            font-size: 1rem;
            transition: all 0.3s ease;
        }
        
        .form-control:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 4px rgb(75 23 193 / 35%);
            outline: none;
        }
        
        .input-group-text {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
        }
        
        /* Sponsor Info Card */
        .sponsor-info-card {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border-radius: 15px;
            padding: 20px;
            margin-top: 10px;
            margin-bottom: 20px;
            display: none;
            animation: slideDown 0.3s ease;
        }
        
        .sponsor-info-card.show {
            display: block;
        }
        
        .sponsor-info-card .sponsor-detail {
            display: flex;
            align-items: center;
            gap: 15px;
        }
        
        .sponsor-avatar {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: rgba(255,255,255,0.2);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            font-weight: bold;
            border: 2px solid white;
        }
        
        .sponsor-details h4 {
            margin: 0;
            font-size: 1.2rem;
            font-weight: 600;
        }
        
        .sponsor-details p {
            margin: 5px 0 0;
            opacity: 0.9;
            font-size: 0.9rem;
        }
        
        .sponsor-stats {
            display: flex;
            gap: 15px;
            margin-top: 15px;
            padding-top: 15px;
            border-top: 1px solid rgba(255,255,255,0.2);
        }
        
        .sponsor-stat {
            flex: 1;
            text-align: center;
        }
        
        .sponsor-stat-label {
            font-size: 0.8rem;
            opacity: 0.9;
            margin-bottom: 5px;
        }
        
        .sponsor-stat-value {
            font-size: 1.2rem;
            font-weight: 700;
        }
        
        .sponsor-badge {
            display: inline-block;
            padding: 5px 10px;
            border-radius: 20px;
            background: rgba(255,255,255,0.2);
            font-size: 0.8rem;
            margin-left: 10px;
        }
        
        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .pin-input-wrapper {
            position: relative;
        }
        
        .pin-status-icon {
            position: absolute;
            right: 15px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 1.2rem;
        }
        
        .pin-valid {
            color: #10b981;
        }
        
        .pin-invalid {
            color: #ef4444;
        }
        
        .pin-info-text {
            font-size: 0.85rem;
            margin-top: 5px;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .btn-submit {
            width: 100%;
            padding: 15px;
            border: none;
            border-radius: 15px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            font-weight: 700;
            font-size: 1.1rem;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            margin-top: 20px;
        }
        
        .btn-submit:hover:not(:disabled) {
            transform: translateY(-3px);
            box-shadow: 0 15px 30px rgba(102, 126, 234, 0.5);
        }
        
        .btn-submit:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }
        
        .password-requirements {
            background: #f8fafc;
            border-radius: 12px;
            padding: 12px 15px;
            margin-top: 10px;
            font-size: 0.85rem;
        }
        
        .requirement-item {
            display: flex;
            align-items: center;
            gap: 8px;
            color: #64748b;
            margin-bottom: 5px;
        }
        
        .requirement-item.valid {
            color: #10b981;
        }
        
        .success-message {
            background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
            color: #1e293b;
            border-radius: 15px;
            padding: 30px;
            margin-bottom: 20px;
            text-align: center;
        }
        
        .error-message {
            background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%);
            color: #1e293b;
            border-radius: 15px;
            padding: 20px;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 15px;
        }
        
        @keyframes slideIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        @media screen and (max-width: 600px) {
         .registration-container {
    margin: 25px auto;
}   
        }
        
        .animate-slide {
            animation: slideIn 0.5s ease forwards;
        }
        
        .package-selector {
            display: flex;
            gap: 15px;
            margin-bottom: 20px;
        }
        
        .package-card {
            flex: 1;
            border: 2px solid #e2e8f0;
            border-radius: 15px;
            padding: 20px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
        }
        
        .package-card.selected {
            border-color: var(--primary);
            background: rgb(75 23 193 / 35%);
            box-shadow: 0 10px 20px rgba(102, 126, 234, 0.2);
        }
        
        .package-card h4 {
            font-weight: 700;
            color: #333;
        }
        
        .package-card .price {
            font-size: 1.8rem;
            font-weight: 800;
            color: var(--primary);
            margin: 10px 0;
        }
        
        .package-badge {
            position: absolute;
            top: 10px;
            right: 10px;
            background: black;
            color: white;
            padding: 5px 10px;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 600;
        }
        
        .package-card .package-badge.popular {
            background: #EC4899;
        }
        
        .aadhaar-preview {
            font-family: monospace;
            font-size: 1.2rem;
            letter-spacing: 2px;
        }
        
        /* Loading spinner */
        .spinner-border-sm {
            width: 1rem;
            height: 1rem;
            border-width: 0.15em;
        }
        
        /* Sponsor search loading */
        .sponsor-search-loading {
            position: absolute;
            right: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: #94a3b8;
        }
    </style>
</head>

<body>
 
  <main>
    <div class="container">

      <section class="section register min-vh-100 d-flex flex-column align-items-center justify-content-center py-4">
        <div class="container">
          <div class="row justify-content-center">
            <div class="col-lg-4 col-md-6 d-flex flex-column align-items-center justify-content-center">

              <div class="d-flex justify-content-center py-4">
               
              </div><!-- End Logo -->

              <div class="card mb-3">
    <div class="card-body">
        <div class="pt-4 pb-2">
            <h5 class="card-title text-center pb-0 fs-4">Login to Your Account</h5>
            <p class="text-center small">Enter your User ID & Password to Login</p>
        </div>

        <!-- Add this error message block -->
        <?php if(isset($_GET['error']) && $_GET['error'] == 'invalid'): ?>
            <div class="alert alert-danger alert-dismissible fade show" role="alert">
                <i class="bi bi-exclamation-octagon me-1"></i>
                Invalid User ID or Password!
                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
            </div>
        <?php endif; ?>
<form class="row g-3 needs-validation" novalidate method="POST" action="panel/element/login_handler.php">
    <!-- rest of your form remains the same -->
    <div class="col-12">
        <label for="yourUsername" class="form-label">User ID</label>
        <div class="input-group has-validation">
            <span class="input-group-text" id="inputGroupPrepend">#</span>
            <input class="form-control form-control-lg" name="user_id" type="text" value="<?=isset($_GET['user_id'])?$_GET['user_id']:'' ?>" autocomplete="off" required>
            <div class="invalid-feedback">Please enter your User ID.</div>
        </div>
    </div>

    <div class="col-12">
        <label for="yourPassword" class="form-label">Password</label>
        <input class="form-control form-control-lg" name="password" type="password" required>
        <div class="invalid-feedback">Please enter your password!</div>
    </div>

    <div class="col-12">
        <button type="submit" name="login" class="btn btn-primary btn-lg btn-block">Login</button>
    </div>
</form>

                </div>
              </div>

              <div class="credits">
                
                Dont have an account ? <a href="register.php">Register now</a>
              </div>

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

      </section>

    </div>
  </main><!-- End #main -->
<?php
include('assets/footer.php');
?>
  <a href="panel/#" class="back-to-top d-flex align-items-center justify-content-center"><i class="bi bi-arrow-up-short"></i></a>

  <!-- Vendor JS Files -->
  <script src="assets/vendor/apexcharts/apexcharts.min.js"></script>
  <script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
  <script src="assets/vendor/chart.js/chart.min.js"></script>
  <script src="assets/vendor/echarts/echarts.min.js"></script>
  <script src="assets/vendor/quill/quill.min.js"></script>
  <script src="assets/vendor/simple-datatables/simple-datatables.js"></script>
  <script src="assets/vendor/tinymce/tinymce.min.js"></script>
  <script src="assets/vendor/php-email-form/validate.js"></script>

  <!-- Template Main JS File -->
  <script src="assets/js/main.js"></script>

</body>

</html>