<?php
$lic = license_check();
$msg = $lic['message'] ?? 'Sua licença está bloqueada.';
?>
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MonitorPing — Licença Bloqueada</title>
<style>
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
  }
  .card {
    background: #1e293b;
    border: 1px solid #ef444433;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
  }
  .icon { font-size: 3rem; margin-bottom: 1rem; }
  h1 { color: #ef4444; font-size: 1.5rem; margin-bottom: .75rem; }
  p { color: #94a3b8; line-height: 1.6; margin-bottom: 1.5rem; }
  .key { font-family: monospace; background: #0f172a; padding: .3rem .6rem; border-radius: 4px; font-size: .85rem; color: #fbbf24; }
  .btn {
    display: inline-block;
    background: #0ea5e9;
    color: #fff;
    padding: .7rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: .95rem;
    margin-top: .5rem;
  }
  .logout { display: block; margin-top: 1rem; color: #64748b; font-size: .85rem; text-decoration: none; }
</style>
</head>
<body>
<div class="card">
  <div class="icon">🔒</div>
  <h1>Acesso Bloqueado</h1>
  <p><?= htmlspecialchars($msg) ?></p>
  <?php if (!empty(LICENSE_KEY)): ?>
  <p>Chave: <span class="key"><?= htmlspecialchars(LICENSE_KEY) ?></span></p>
  <?php endif; ?>
  <?php if (!empty($_GET['recheck_fail'])): ?>
    <p style="color:#fca5a5;font-size:.85rem;margin-bottom:1rem">Licença ainda bloqueada ou inválida.</p>
  <?php endif; ?>
  <a class="btn" href="<?= BASE_URL ?>index.php?page=license_recheck" style="background:#22c55e;display:block;margin-bottom:.6rem">
    Verificar Licença
  </a>
  <a class="btn" href="https://monitorping.com.br" target="_blank">Renovar Licença</a>
  <a href="<?= BASE_URL ?>index.php?page=license_activate" style="display:block;margin-top:.75rem;background:#334155;color:#94a3b8;border-radius:6px;padding:.55rem 1.2rem;font-size:.85rem;text-decoration:none">
    Já tenho uma nova chave
  </a>
  <a class="logout" href="<?= BASE_URL ?>index.php?page=logout">Sair</a>
</div>
</body>
</html>
