<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Касса</title>
<style>
  * { box-sizing: border-box; }
  html, body {
    height: 100%;
  }
  body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
      radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.14), transparent 45%),
      radial-gradient(circle at 85% 90%, rgba(16, 185, 129, 0.12), transparent 45%),
      #f5f6fb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    padding: 16px;
  }
  .card {
    position: relative;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 20px 40px -12px rgba(16, 24, 40, 0.14);
    border: 1px solid rgba(16, 24, 40, 0.06);
    padding: clamp(28px, 6vw, 36px) clamp(20px, 5vw, 28px);
    max-width: 360px;
    width: 100%;
    text-align: center;
    overflow: hidden;
    animation: card-in 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #22d3ee, #10b981);
  }
  @keyframes card-in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
  .login-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #98a2b3;
    margin: 0 0 10px;
  }
  .login-value {
    font-family: "SF Mono", "Cascadia Code", Consolas, ui-monospace, monospace;
    font-size: clamp(26px, 8vw, 34px);
    font-weight: 700;
    color: #101828;
    letter-spacing: 0.5px;
    margin: 0 0 24px;
    word-break: break-all;
    background: linear-gradient(180deg, #f9fafb, #f2f4f7);
    border: 1px solid #eaecf0;
    border-radius: 12px;
    padding: 12px 14px;
  }
  .qr-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
  }
  .qr-wrap .qr-frame {
    background: #ffffff;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid #eaecf0;
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.06);
  }
  .qr-wrap img {
    display: block;
    width: 220px;
    height: 220px;
    max-width: 100%;
    border-radius: 8px;
  }
  .hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
    font-size: 13px;
    font-style: italic;
    color: #93710a;
    background: #fffaeb;
    border: 1px solid #fef0c7;
    border-radius: 12px;
    padding: 12px 14px;
    line-height: 1.5;
    margin: 0;
  }
  .hint-icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
  }
  .error {
    font-size: 15px;
    color: #b42318;
  }
  @media (max-width: 380px) {
    .qr-wrap img {
      width: 170px;
      height: 170px;
    }
  }
  @media (prefers-color-scheme: dark) {
    body {
      background:
        radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.18), transparent 45%),
        radial-gradient(circle at 85% 90%, rgba(16, 185, 129, 0.14), transparent 45%),
        #0b0d12;
    }
    .card {
      background: #14161c;
      border-color: rgba(255, 255, 255, 0.08);
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 20px 40px -12px rgba(0, 0, 0, 0.5);
    }
    .login-label { color: #8b93a3; }
    .login-value {
      color: #f2f4f7;
      background: linear-gradient(180deg, #1b1e26, #16181f);
      border-color: rgba(255, 255, 255, 0.08);
    }
    .qr-wrap .qr-frame {
      background: #ffffff;
    }
    .hint {
      color: #f0c14b;
      background: rgba(220, 156, 4, 0.12);
      border-color: rgba(220, 156, 4, 0.3);
    }
  }
</style>
</head>
<body>
  <div class="card" id="card">
    <!-- content injected by script -->
  </div>

  <script>
    (function () {
      const params = new URLSearchParams(window.location.search);
      const login = params.get('login');
      const card = document.getElementById('card');

      if (!login) {
        card.innerHTML = '<p class="error">Логин не найден в адресе страницы</p>';
        return;
      }

      const qrUrl = 'https://scontent.vgate.app/apps/qr2png?data=' + encodeURIComponent(login);

      const label = document.createElement('p');
      label.className = 'login-label';
      label.textContent = 'ПИН код:';

      const value = document.createElement('p');
      value.className = 'login-value';
      value.textContent = login;

      const qrWrap = document.createElement('div');
      qrWrap.className = 'qr-wrap';
      const qrFrame = document.createElement('div');
      qrFrame.className = 'qr-frame';
      const img = document.createElement('img');
      img.src = qrUrl;
      img.alt = 'QR code';
      qrFrame.appendChild(img);
      qrWrap.appendChild(qrFrame);

      const hint = document.createElement('div');
      hint.className = 'hint';
      hint.innerHTML =
        '<svg class="hint-icon" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">' +
        '<circle cx="10" cy="10" r="9" stroke="#dc9c04" stroke-width="1.5"/>' +
        '<path d="M10 9v5" stroke="#dc9c04" stroke-width="1.5" stroke-linecap="round"/>' +
        '<circle cx="10" cy="6.5" r="1" fill="#dc9c04"/>' +
        '</svg>' +
        '<span>Обратитесь к оператору для выплаты или пополнения баланса</span>';

      card.append(label, value, qrWrap, hint);
    })();
  </script>
</body>
</html>
