<?php include "connection.php";?>

<html lang="en" itemscope="" itemtype="http://schema.org/WebPage" data-theme="light" style="height: 100%;">
   <div id="in-page-channel-node-id" data-channel-name="in_page_channel_2EEEmv"></div>
   <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
      <title> <?=$sitename?> - Login</title>
      <meta name="title" content="<?=$sitename?> - Login">
      <meta name="description" content="Introducing copy trading as a product can substantially boost a newbie/pro profits turnover by copying and earning with expert traders on financial markets.">
      <meta name="keywords" content="crypto currency,fiat currency,crypto sell,crypto buy,copy,copytrading,copy trade,trading,<?=$sitename?>">
      <link rel="shortcut icon" href="assets/images/logoIcon/favicon.png" type="image/x-icon">
      <link rel="apple-touch-icon" href="assets/images/logoIcon/logo.png">
      <meta name="apple-mobile-web-app-capable" content="yes">
      <meta name="apple-mobile-web-app-status-bar-style" content="black">
      <meta name="apple-mobile-web-app-title" content="<?=$sitename?> - Login">
      <meta itemprop="name" content="<?=$sitename?> - Login">
      <meta itemprop="description" content="Introducing copy trading as a product can substantially boost a newbie/pro profits turnover by copying and earning with expert traders on financial markets.">
      <meta itemprop="image" content="assets/images/seo/66a655a7593c91722176935.png">
      <meta property="og:type" content="website">
      <meta property="og:title" content="Copy/Social Trading Platform - <?=$sitename?>">
      <meta property="og:description" content="Introducing copy trading as a product can substantially boost a newbie/pro profits turnover by copying and earning with expert traders on financial markets.">
      <meta property="og:image" content="assets/images/seo/66a655a7593c91722176935.png">
      <meta property="og:image:type" content="png">
      <meta property="og:image:width" content="1180">
      <meta property="og:image:height" content="600">
      <meta property="og:url" content="user/login">
      <meta name="twitter:card" content="summary_large_image">
      <link href="assets/global/css/bootstrap.min.css" rel="stylesheet">
      <link href="assets/global/css/all.min.css" rel="stylesheet">
      <link rel="stylesheet" href="assets/global/css/line-awesome.min.css">
      <link rel="stylesheet" href="assets/templates/basic/css/main.css">
      <link rel="stylesheet" href="assets/templates/basic/css/custom.css">
      <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/intro.js/7.2.0/introjs.min.css">
      <!-- Include iziToast CSS -->
      <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/izitoast@1.4.0/dist/css/iziToast.min.css" />
      <!-- Include iziToast JS -->
      <script src="https://cdn.jsdelivr.net/npm/izitoast@1.4.0/dist/js/iziToast.min.js"></script>
      <link rel="manifest" href="pwa/configuration">
      <link rel="stylesheet" href="assets/templates/basic/css/color.php?color=00a8e0">
      
      <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
      
      </script><script type="text/javascript">
         // Check if 'theme' exists in LocalStorage
         if (!localStorage.getItem('theme')) {
         
         localStorage.setItem('theme', 'light');
         }
         
      </script>
      
      
      
    
   


      <style>
         .trading-header__title {
         color: hsl(0deg 0% 100%);
         }
         .equity-info{
         display: flex;
         justify-content: space-between;
         align-items: center;
         flex-wrap: wrap;
         }
         .custom--tab .nav-item .nav-link {
         color: hsl(0deg 0% 100% / 50%) !important;
         }
         .demo-banner {
         position: absolute;
         top: 10px;
         right: 10px;
         background-color: blue;
         color: white;
         font-size: 12px;
         font-weight: bold;
         padding: 5px 10px;
         border-radius: 3px;
         text-transform: uppercase;
         }
         .input-group-text {
         background-color: #1e1e1e;
         }
         .green {
         color: green;
         font-weight: 600;
         }
         .blue {
         color: blue;
         font-weight: 600;
         }
         .mega-menu-list__item {
         padding: 25px 20px!important;
         }
         .small, small {
         font-size: .90em!important;
         }
         .has-mega-menu .mega-menu {
         width: 500px!important;
         }
      </style>
      <style>
         .introjs-tooltip {
         background-color: #000000!important;
         color: #fff!important;
         }
         .introjs-button {
         background-color: #3762fb!important;
         color: #fff!important;
         }
         .introjs-disabled {
         background-color: #FFF!important;
         color: #3762fb!important;
         }
      </style>
      <style>
         @keyframes slide-in-one-tap {
         from {
         transform: translateY(80px);
         }
         to {
         transform: translateY(0px);
         }
         }
         .trust-hide-gracefully {
         opacity: 0;
         }
         .trust-wallet-one-tap .hidden {
         display: none;
         }
         .trust-wallet-one-tap .semibold {
         font-weight: 500;
         }
         .trust-wallet-one-tap .binance-plex {
         font-family: 'Binance';
         }
         .trust-wallet-one-tap .rounded-full {
         border-radius: 50%;
         }
         .trust-wallet-one-tap .flex {
         display: flex;
         }
         .trust-wallet-one-tap .flex-col {
         flex-direction: column;
         }
         .trust-wallet-one-tap .items-center {
         align-items: center;
         }
         .trust-wallet-one-tap .space-between {
         justify-content: space-between;
         }
         .trust-wallet-one-tap .justify-center {
         justify-content: center;
         }
         .trust-wallet-one-tap .w-full {
         width: 100%;
         }
         .trust-wallet-one-tap .box {
         transition: all 0.5s cubic-bezier(0, 0, 0, 1.43);
         animation: slide-in-one-tap 0.5s cubic-bezier(0, 0, 0, 1.43);
         width: 384px;
         border-radius: 15px;
         background: #FFF;
         box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.25);
         position: fixed;
         right: 30px;
         bottom: 30px;
         z-index: 1020;
         }
         .trust-wallet-one-tap .header {
         gap: 15px;
         border-bottom: 1px solid #E6E6E6;
         padding: 10px 18px;
         }
         .trust-wallet-one-tap .header .left-items {
         gap: 15px
         }
         .trust-wallet-one-tap .header .title {
         color: #1E2329;
         font-size: 18px;
         font-weight: 600;
         line-height: 28px;
         }
         .trust-wallet-one-tap .header .subtitle {
         color: #474D57;
         font-size: 14px;
         line-height: 20px;
         }
         .trust-wallet-one-tap .header .close {
         color: #1E2329;
         cursor: pointer;
         }
         .trust-wallet-one-tap .body {
         padding: 9px 18px;
         gap: 10px;
         }
         .trust-wallet-one-tap .body .right-items {
         gap: 10px;
         width: 100%;
         }
         .trust-wallet-one-tap .body .right-items .wallet-title {
         color: #1E2329;
         font-size: 16px;
         font-weight: 600;
         line-height: 20px;
         }
         .trust-wallet-one-tap .body .right-items .wallet-subtitle {
         color: #474D57;
         font-size: 14px;
         line-height: 20px;
         }
         .trust-wallet-one-tap .connect-indicator {
         gap: 15px;
         padding: 8px 0;
         }
         .trust-wallet-one-tap .connect-indicator .flow-icon {
         color: #474D57;
         }
         .trust-wallet-one-tap .loading-color {
         color: #FFF;
         }
         .trust-wallet-one-tap .button {
         border-radius: 50px;
         outline: 2px solid transparent;
         outline-offset: 2px;
         background-color: rgb(5, 0, 255);
         border-color: rgb(229, 231, 235);
         cursor: pointer;
         text-align: center;
         height: 45px;
         }
         .trust-wallet-one-tap .button .button-text {
         color: #FFF;
         font-size: 16px;
         font-weight: 600;
         line-height: 20px;
         }
         .trust-wallet-one-tap .footer {
         margin: 20px 30px;
         }
         .trust-wallet-one-tap .check-icon {
         color: #FFF;
         }
         @font-face {
         font-family: 'Binance';
         src: url(chrome-extension://egjidjbpglichdcondbcbdnbeeppgdph/fonts/BinancePlex-Regular.otf) format('opentype');
         font-weight: 400;
         font-style: normal;
         }
         @font-face {
         font-family: 'Binance';
         src: url(chrome-extension://egjidjbpglichdcondbcbdnbeeppgdph/fonts/BinancePlex-Medium.otf) format('opentype');
         font-weight: 500;
         font-style: normal;
         }
         @font-face {
         font-family: 'Binance';
         src: url(chrome-extension://egjidjbpglichdcondbcbdnbeeppgdph/fonts/BinancePlex-SemiBold.otf) format('opentype');
         font-weight: 600;
         font-style: normal;
         }
      </style>
      <link type="text/css" rel="stylesheet" charset="UTF-8" href="https://www.gstatic.com/_/translate_http/_/ss/k=translate_http.tr.26tY-h6gH9w.L.W.O/am=GAw/d=0/rs=AN8SPfoV6mMC6tlFnBTPsgfPv12vhvDMnA/m=el_main_css">
      <script type="text/javascript" charset="UTF-8" src="https://translate.googleapis.com/_/translate_http/_/js/k=translate_http.tr.en_GB.BJ8txB7gs0A.O/am=AEA/d=1/exm=el_conf/ed=1/rs=AN8SPfqhx9dTAmNMaCnqWWPLTV-DTG5qAQ/m=el_main"></script>
   </head>
   <body style="position: relative; min-height: 100%; top: 0px;">
      <div class="progress-cricle">
         <h4 class="progress-cricle__number"></h4>
      </div>
      <div class="preloader-wrapper" style="display: none;">
         <div class="preloader">
            <div class="wrapper">
               <div class="loader">
                  <div class="dot"></div>
               </div>
               <div class="loader">
                  <div class="dot"></div>
               </div>
               <div class="loader">
                  <div class="dot"></div>
               </div>
               <div class="loader">
                  <div class="dot"></div>
               </div>
               <div class="loader">
                  <div class="dot"></div>
               </div>
               <div class="loader">
                  <div class="dot"></div>
               </div>
            </div>
         </div>
      </div>
      <div class="body-overlay"></div>
      <div class="sidebar-overlay"></div>
      <a class="scroll-top"><i class="fas fa-angle-double-up"></i></a>
      <section class="account">
         <div class="account-inner">
            <div class="account-left">
               <a href="" class="account-left__logo">
               <img src="assets/images/logoIcon/expcopyb.png">
               </a>
               <div class="account-left__content">
                  <h5 class="account-left__subtitle">Welcome To <?=$sitename?></h5>
                  <h3 class="account-left__title">Login to embrace the possibilities</h3>
               </div>
               <div class="account-left__thumb">
                  <img src="assets/images/frontend/login/login.png">
               </div>
            </div>
            <div class="account-right-wrapper">
               <div class="account-content__top">
                  <div class="account-content__member gap-2">
                     <!---->
                     <div id="google_translate_element">
                        <div class="skiptranslate goog-te-gadget" dir="ltr" style="">
                           <div id=":0.targetLanguage" class="goog-te-gadget-simple" style="white-space: nowrap;"><img src="https://www.google.com/images/cleardot.gif" class="goog-te-gadget-icon" alt="" style="background-image: url(&quot;https://translate.googleapis.com/translate_static/img/te_ctrl3.gif&quot;); background-position: -65px 0px;"><span style="vertical-align: middle;"><a aria-haspopup="true" class="VIpgJd-ZVi9od-xl07Ob-lTBxed" href="#"><span>Select Language</span><img src="https://www.google.com/images/cleardot.gif" alt="" width="1" height="1"><span style="border-left: 1px solid rgb(187, 187, 187);">​</span><img src="https://www.google.com/images/cleardot.gif" alt="" width="1" height="1"><span aria-hidden="true" style="color: rgb(118, 118, 118);">▼</span></a></span></div>
                        </div>
                     </div>
                     <script type="text/javascript">
                        function googleTranslateElementInit() {
                          new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: "en,es,de,fr,ar,fa,hi,it,ja,ko,ru,tr,pt,zh-CN,zh-TW", layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
                        }   
                     </script>
                     <script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
                     <style>
                        .goog-te-gadget-icon {
                        display:none;
                        }
                        .goog-te-gadget-simple {
                        background-color: #ecebf0 !important;
                        border:0 !important;
                        font-size: 10pt;
                        font-weight:800;
                        display: inline-block;
                        padding:10px 10px !important;
                        cursor: pointer;
                        color:#fff
                        zoom: 1;
                        }
                        .goog-te-gadget-simple  span {
                        color:#3e3065 !important;
                        }
                        .VIpgJd-ZVi9od-ORHb-OEVmcd {
                        display: none; // add !important if required 
                        }
                        .goog-te-banner-frame.skiptranslate {
                        display: none !important;
                        } 
                        body {
                        top: 0px !important; 
                        }
                     </style>
                     <script type="text/javascript">
                        $(document).ready(function(){
                            $('#google_translate_element').bind('DOMNodeInserted', function(event) {
                              $('.goog-te-menu-value span:first').html('LANGUAGE');
                              $('.goog-te-menu-frame.skiptranslate').load(function(){
                                setTimeout(function(){
                                  $('.goog-te-menu-frame.skiptranslate').contents().find('.goog-te-menu2-item-selected .text').html('LANGUAGE');    
                                }, 100);
                              });
                            });
                          });
                     </script>
                     <div class="theme-switch-wrapper">
                        <label class="theme-switch" for="checkbox">
                        <input type="checkbox" class="d-none" id="checkbox">
                        <span class="slider">
                       <!-- <i class="las la-sun"></i>-->
                        </span>
                        </label>
                     </div>
                  </div>
               </div>
               <div class="account-right">
                  <div class="account-content">
                     <div class="account-form">
                        <h3 class="account-form__title mb-0">Log In</h3>
                        <p class="account-form__desc">Securely connect to your account</p>
                        
                      
                        <form id="loginForm" method="POST" class="verify-gcaptcha" autocomplete="off">
                           <div class="form-group mb-3">
                              <label class="form--label" for="username">Username or Email</label>
                              <input type="text" name="username" value="" class="form--control form-control" placeholder="Enter your username or email" id="username">
                           </div>
                           <div class="form-group mb-3">
                              <div class="d-flex justify-content-between">
                                 <label class="form--label" for="password">Password</label>
                                 <a href="forget-password" class="forget-password">
                                 Forget Password?</a>
                              </div>
                              <div class="position-relative">
                                 <input name="password" type="password" class="form--control form-control" placeholder="Enter your password" id="password">
                                 <i class="fas fa-solid password-show-hide far fa-eye toggle-password fa-eye-slash" id="togglePassword"></i>
                              </div>
                           </div>
                           <div class="d-flex justify-content-between mb-3">
                              <div class="form-group form-check">
                                 <input class="form-check-input" type="checkbox" name="remember" id="remember">
                                 <label class="form-check-label" for="remember">
                                 Remember Me
                                 </label>
                              </div>
                              <div>
                                 <p class="form--label">Don't have an account?
                                    <a href="register" class="forget-password">Sign Up</a>
                                 </p>
                              </div>
                           </div>
                           <button type="submit" class="btn btn-primary w-100">
                           <span class="indicator-label">Sign In</span>
                           <span class="indicator-progress" style="display: none;">
                           Please wait... <span class="spinner-border spinner-border-sm align-middle ms-2"></span>
                           </span>
                           </button>
                        </form>
                        <!-- Include jQuery from a CDN -->
                        <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
                        <script>
                           $(document).ready(function() {
                               // Toggle password visibility
                               $('#togglePassword').click(function() {
                                   const passwordInput = $('#password');
                                   const type = passwordInput.attr('type') === 'password' ? 'text' : 'password';
                                   passwordInput.attr('type', type);
                                   $(this).toggleClass('fa-eye fa-eye-slash');
                               });
                           
                               // Handle form submission
                               $('#loginForm').on('submit', function(event) {
                                   event.preventDefault(); // Prevent default form submission
                           
                                   // Show loading indicator and disable submit button
                                   $('.indicator-label').hide();
                                   $(".indicator-progress").show();
                                   $(':submit', this).attr('disabled', 'disabled');
                           
                                   // Validate form before sending (basic check for username and password)
                                   const username = $('#username').val();
                                   const password = $('#password').val();
                                   if (!username || !password) {
                                       iziToast.error({
                                           title: 'Error',
                                           message: 'Please fill in both username and password.',
                                           position: 'topCenter',
                                           timeout: 3000
                                       });
                                       $('.indicator-label').show();
                                       $(".indicator-progress").hide();
                                       $('#loginForm :submit').removeAttr('disabled');
                                       return;
                                   }
                           
                                   // Submit the form using AJAX
                                   $.ajax({
                                       url: 'processor.php?login', // Your PHP handler URL
                                       type: 'POST',
                                       data: $(this).serialize(),
                                       dataType: 'json',
                                       success: function(response) {
                                           if (response.success) {
                                                iziToast.success({
                                                    title: 'Success',
                                                    message: 'Login successful!',
                                                    position: 'topCenter',
                                                    timeout: 3000
                                                });
                                                // Redirect to dashboard or reload page
                                                setTimeout(function() {
                                                    window.location.href = 'dashboard'; // Redirect after a slight delay
                                                }, 1500); // Delay to allow iziToast to display
                                            } else if (response.verificationerror) {
                                                iziToast.error({
                                                    title: 'Verification Error',
                                                    message: response.message,  // Display specific verification error
                                                    position: 'topCenter',
                                                    timeout: 3000
                                                });
                                                setTimeout(function() {
                                                    window.location.href = 'otp'; // Redirect after a slight delay
                                                }, 3500); // Delay to allow iziToast to display
                                            } else {
                                                iziToast.error({
                                                    title: 'Error',
                                                    message: response.message || 'Login failed. Please try again.',
                                                    position: 'topCenter',
                                                    timeout: 3000
                                                });
                                            }

                                       },
                                       error: function(jqXHR, textStatus, errorThrown) {
                                           iziToast.error({
                                               title: 'Error',
                                               message: 'An error occurred. Please try again.',
                                               position: 'topCenter',
                                               timeout: 3000
                                           });
                                           console.error("AJAX Error: " + textStatus + " - " + errorThrown); // Log error in the console
                                       },
                                       complete: function() {
                                           // Ensure loading indicator and button are reset after request
                                           $('.indicator-label').show();
                                           $(".indicator-progress").hide();
                                           $('#loginForm :submit').removeAttr('disabled');
                                       }
                                   });
                               });
                           });
                        </script>
                     </div>
                  </div>
               </div>
              
               <div class="row gy-3 mt-auto">
                  <div class="col-md-12">
                     <div class="bottom-footer__text text-center">
                        © 2025 <a href="" class="text--base"> <?=$sitename?></a>. All Rights Reserved                    
                     </div>
                  </div>
               </div>
            </div>
         </div>
      </section>