<?php
// URL parameter থেকে inviteCode নিই
$inviteCode = isset($_GET['inviteCode']) ? htmlspecialchars($_GET['inviteCode']) : '';
?>
<!DOCTYPE html>
<html lang="en">
<head> 
  <meta charset="UTF-8"> 
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>Register - Golden Yields</title> 
  
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"/>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/layui@2.8.17/dist/css/layui.css">
  <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap" rel="stylesheet">
  
  <style>
    * {
      box-sizing: border-box;
      font-family: 'Poppins', sans-serif;
      margin: 0;
      padding: 0;
      -webkit-tap-highlight-color: transparent;
    }

    html, body {
      width: 100%;
      min-height: 100vh;
      /* ব্যাকগ্রাউন্ড কালার আপনার অ্যাপের সাথে মিল রেখে ডার্ক রাখা হয়েছে */
      background: #1a2f38; 
    }

    body {
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 20px;
    }

    .register-container {
      width: 100%;
      max-width: 380px;
      text-align: center;
      color: #fff;
    }

    /* লোগো সেকশন - সুন্দর করার জন্য */
    .logo-wrapper {
      background: rgba(255, 255, 255, 0.03); /* হালকা একটি আভা */
      padding: 30px 20px;
      border-radius: 25px;
      margin-bottom: 30px;
      display: inline-block;
      width: 100%;
    }

    .header-img {
      width: 85%; /* লোগো সাইজ কন্ট্রোল */
      max-width: 250px;
      height: auto;
      filter: drop-shadow(0px 5px 15px rgba(0,0,0,0.5)); /* লোগোতে রিয়েলিস্টিক শ্যাডো */
      border: none !important; /* বর্ডার থাকলে সরিয়ে দিবে */
      outline: none !important;
    }

    h2 {
      font-size: 26px;
      font-weight: 600;
      margin-bottom: 5px;
      color: #ffffff;
    }

    p.sub-text {
      font-size: 14px;
      margin-bottom: 30px;
      color: rgba(255,255,255,0.6);
    }

    .input-group {
      text-align: left;
      margin-bottom: 18px;
    }

    .input-group label {
      display: block;
      font-size: 13px;
      margin-bottom: 8px;
      margin-left: 5px;
      color: rgba(255,255,255,0.8);
    }

    .input-box {
      position: relative;
      display: flex;
      align-items: center;
    }

    .input-box i.left-icon {
      position: absolute;
      left: 15px;
      color: #ff9d00; /* গোল্ডেন থিম */
      font-size: 16px;
    }

    .input-box input {
      width: 100%;
      padding: 13px 15px 13px 48px;
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 12px;
      color: #fff;
      font-size: 15px;
      outline: none;
      transition: 0.3s;
    }

    .input-box input:focus {
      border-color: #ff9d00;
      background: rgba(255, 255, 255, 0.12);
    }

    .right-btn {
      position: absolute;
      right: 15px;
      cursor: pointer;
      color: rgba(255,255,255,0.5);
      background: none;
      border: none;
    }

    .register-btn {
      width: 100%;
      padding: 15px;
      background: linear-gradient(90deg, #ff8c00, #ff5e00);
      border: none;
      border-radius: 12px;
      color: #fff;
      font-size: 16px;
      font-weight: 600;
      cursor: pointer;
      box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);
      text-transform: uppercase;
      margin-top: 15px;
      margin-bottom: 25px;
      transition: 0.3s;
    }

    .register-btn:active {
      transform: scale(0.98);
    }

    .login-section {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 10px;
      font-size: 14px;
    }

    .login-btn {
      color: #ff9d00;
      text-decoration: none;
      font-weight: 600;
      background: rgba(255, 255, 255, 0.05);
      padding: 6px 15px;
      border-radius: 8px;
      border: 1px solid rgba(255, 157, 0, 0.3);
    }
  </style>
</head>

<body>

<div class="register-container">
  <!-- লোগো সেকশন -->
  <div class="logo-wrapper">
    <img src="/20260511_164931 (1).png" alt="Golden Yields Logo" class="header-img">
  </div>

  <h2>Welcome Back</h2>
  <p class="sub-text">Please enter your details to join</p>

  <form class="layui-form" id="registerForm" action="<?php echo e(url('register')); ?>" method="post">
    <?php echo csrf_field(); ?>
    
    <!-- Mobile Number -->
    <div class="input-group">
      <label>Mobile Number</label>
      <div class="input-box">
        <i class="fa-solid fa-phone left-icon"></i>
        <input type="tel" name="phone" id="phone" placeholder="01XXX XXXXXX" required>
      </div>
    </div>

    <!-- Password -->
    <div class="input-group">
      <label>Password</label>
      <div class="input-box">
        <i class="fa-solid fa-lock left-icon"></i>
        <input type="password" name="password" id="password" placeholder="••••••••" required>
        <button type="button" class="right-btn" id="pwToggle">
          <i class="fa-solid fa-eye" id="pwIcon"></i>
        </button>
      </div>
    </div>

    <!-- Confirm Password -->
    <div class="input-group">
      <label>Confirm Password</label>
      <div class="input-box">
        <i class="fa-solid fa-lock left-icon"></i>
        <input type="password" name="confirm_password" id="confirm_password" placeholder="••••••••" required>
      </div>
    </div>

    <!-- Invitation Code -->
    <div class="input-group">
      <label>Invitation Code</label>
      <div class="input-box">
        <i class="fa-solid fa-user-plus left-icon"></i>
        <input type="text" name="ref_by" value="<?php echo $inviteCode; ?>" readonly>
      </div>
    </div>
    
    <button type="submit" class="register-btn" lay-submit lay-filter="register">LOG IN</button>

    <div class="login-section">
      <span>Don't have an account?</span>
      <a href="/login" class="login-btn">Sign Up</a>
    </div>
  </form>
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/layui/2.8.17/layui.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

<script>
  layui.use(['form', 'layer'], function(){
    var form = layui.form;
    var layer = layui.layer;

    form.on('submit(register)', function(data){
      var pass = $('#password').val();
      var cpass = $('#confirm_password').val();
      if(pass !== cpass){
        layer.msg('Passwords do not match!', {icon: 2});
        return false;
      }
      return true;
    });
  });

  document.getElementById('pwToggle').addEventListener('click', function(){
    const pwInput = document.getElementById('password');
    const pwIcon = document.getElementById('pwIcon');
    if (pwInput.type === 'password') {
      pwInput.type = 'text';
      pwIcon.classList.replace('fa-eye', 'fa-eye-slash');
    } else {
      pwInput.type = 'password';
      pwIcon.classList.replace('fa-eye-slash', 'fa-eye');
    }
  });
</script>

</body>
</html><?php /**PATH /home/goldenyi/public_html/resources/views/app/auth/registration.blade.php ENDPATH**/ ?>