<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8"/>
  <meta name="viewport" content="width=device-width,initial-scale=1.0"/>
  <title>Your Free Trial – Collnetwork</title>
  <link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;700;800;900&family=Space+Mono:wght@700&display=swap" rel="stylesheet">
  <style>
    *,*::before,*::after{margin:0;padding:0;box-sizing:border-box;}
    body{font-family:'Nunito',sans-serif;min-height:100vh;
      background:linear-gradient(135deg,#3b1f6e 0%,#1a0a3c 100%);
      display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;}
    .card{background:white;border-radius:20px;padding:36px 32px;
      max-width:420px;width:100%;text-align:center;
      box-shadow:0 20px 60px rgba(0,0,0,0.4);position:relative;}
    .icon{font-size:52px;margin-bottom:12px;}
    h1{color:#1a0a3c;font-size:22px;font-weight:900;margin-bottom:6px;}
    .sub{color:#7c6fa0;font-size:14px;margin-bottom:24px;}
    .cred-box{background:#f3eeff;border:2px solid #e4d9f5;border-radius:14px;
      padding:15px;margin-bottom:20px;}
    .cred-row{display:flex;justify-content:space-between;align-items:center;
      padding:12px 0;border-bottom:1px solid #e4d9f5;}
    .cred-row:last-child{border-bottom:none;}
    .cred-label{font-size:11px;font-weight:700;color:#7c6fa0;text-transform:uppercase;text-align:left;}
    .cred-val-container{display:flex;align-items:center;gap:8px;}
    .cred-val{font-family:'Space Mono',monospace;font-size:15px;
      font-weight:700;color:#3b1f6e;letter-spacing:0.5px;}
    
    /* Copy Button Styling */
    .copy-btn {
      background: #3b1f6e;
      color: white;
      border: none;
      border-radius: 6px;
      padding: 4px 8px;
      font-size: 10px;
      font-weight: 800;
      cursor: pointer;
      text-transform: uppercase;
      transition: background 0.2s;
    }
    .copy-btn:active { transform: scale(0.95); }
    .copy-btn.success { background: #16a34a; }

    /* Toast Notification */
    #toast {
      visibility: hidden;
      min-width: 200px;
      background-color: #333;
      color: #fff;
      text-align: center;
      border-radius: 50px;
      padding: 12px;
      position: fixed;
      z-index: 100;
      bottom: 30px;
      font-size: 13px;
      font-weight: 700;
    }
    #toast.show { visibility: visible; animation: fadein 0.5s, fadeout 0.5s 2.5s; }
    @keyframes fadein { from {bottom: 0; opacity: 0;} to {bottom: 30px; opacity: 1;} }
    @keyframes fadeout { from {bottom: 30px; opacity: 1;} to {bottom: 0; opacity: 0;} }

    .timer{background:linear-gradient(135deg,rgba(34,197,94,0.1),rgba(22,163,74,0.08));
      border:1px solid rgba(34,197,94,0.3);border-radius:10px;
      padding:12px;margin-bottom:20px;color:#16a34a;font-weight:700;font-size:13px;}
    .steps{text-align:left;margin-bottom:20px;}
    .steps p{font-size:13px;color:#4a5568;margin-bottom:6px;padding-left:4px;}
    .register-btn{display:block;padding:13px;
      background:linear-gradient(135deg,#22c55e,#16a34a);
      color:white;border-radius:12px;font-weight:800;font-size:15px;
      text-decoration:none;margin-bottom:10px;
      box-shadow:0 6px 18px rgba(34,197,94,0.35);}
    .back-btn{display:block;padding:10px;
      background:#f3eeff;color:#6b3fa0;border-radius:12px;
      font-weight:700;font-size:14px;text-decoration:none;}
    .warning{font-size:11px;color:#f59e0b;margin-top:12px;
      background:rgba(245,158,11,0.08);border-radius:8px;padding:8px;}
  </style>
</head>
<body>
  <div id="toast">Copied to clipboard!</div>

  <div class="card">
    <div class="icon">🎉</div>
    <h1>Your Free Trial is Ready!</h1>
    <p class="sub">Copy these to the login page</p>

    <div class="cred-box">
      <div class="cred-row">
        <span class="cred-label">Username</span>
        <div class="cred-val-container">
          <span class="cred-val" id="userVal">{{ username }}</span>
          <button class="copy-btn" onclick="copyText('userVal', this)">Copy</button>
        </div>
      </div>
      
      <div class="cred-row">
        <span class="cred-label">Password</span>
        <div class="cred-val-container">
          <span class="cred-val" id="passVal">{{ password }}</span>
          <button class="copy-btn" onclick="copyText('passVal', this)">Copy</button>
        </div>
      </div>

      <div class="cred-row">
        <span class="cred-label">Duration</span>
        <span class="cred-val">{{ duration }}</span>
      </div>
    </div>

    <div class="timer">⏱ Trial starts upon first login</div>

    <div class="steps">
      <p>1️⃣ Click <strong>Copy</strong> for your Username</p>
      <p>2️⃣ Go back and paste it into the login box</p>
      <p>3️⃣ Repeat for your Password</p>
    </div>

    <a href="https://wifiregister.collnetwork.net/register" class="register-btn">
      ✨ Register Now – ₦3,000 / 30 Days
    </a>
    <a href="javascript:history.back()" class="back-btn">← Back to Login</a>

    <div class="warning">
      ⚠️ One-time trial per device.
    </div>
  </div>

  <script>
    function copyText(elementId, btn) {
      const text = document.getElementById(elementId).innerText;
      
      // Modern Clipboard API
      navigator.clipboard.writeText(text).then(() => {
        // Show Toast
        const toast = document.getElementById("toast");
        toast.className = "show";
        setTimeout(() => { toast.className = toast.className.replace("show", ""); }, 3000);

        // Visual feedback on button
        const originalText = btn.innerText;
        btn.innerText = "COPIED";
        btn.classList.add("success");
        setTimeout(() => {
          btn.innerText = originalText;
          btn.classList.remove("success");
        }, 2000);
      }).catch(err => {
        console.error('Failed to copy: ', err);
      });
    }
  </script>
</body>
</html>