<?php
require_once __DIR__ . '/includes/bootstrap.php';

$support = get_config('support');
$supportLink = support_link_from_config($support);
$qrUrl = trim((string)($support['support_qr_url'] ?? ''));
if ($qrUrl === '') {
    $qrUrl = qr_service_url($supportLink);
}
$text = trim((string)($support['support_text'] ?? ''));
if ($text === '') {
    $text = 'Escaneie o QR Code ou chame nosso suporte pelo WhatsApp.';
}
?>
<!doctype html>
<html lang="pt-br">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Suporte OmniMax</title>
    <style>
        :root{color-scheme:dark;--bg:#08080c;--card:#151720;--line:rgba(255,255,255,.12);--red:#ff1b2d}
        *{box-sizing:border-box}body{margin:0;min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 20% 10%,rgba(255,27,45,.24),transparent 34%),var(--bg);font-family:Inter,Segoe UI,Arial,sans-serif;color:#fff}
        main{width:min(440px,94vw);padding:26px;border:1px solid var(--line);border-radius:26px;background:linear-gradient(180deg,rgba(255,255,255,.06),transparent),var(--card);text-align:center;box-shadow:0 24px 80px rgba(0,0,0,.45)}
        img{width:min(280px,78vw);height:min(280px,78vw);object-fit:contain;border-radius:18px;background:#fff;padding:12px}
        h1{margin:18px 0 8px;font-size:1.4rem}p{margin:0 auto 18px;color:#d7d9e4;line-height:1.55}
        a{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:0 18px;border-radius:14px;background:linear-gradient(135deg,var(--red),#970711);color:#fff;text-decoration:none;font-weight:800}
    </style>
</head>
<body>
<main>
    <img src="<?=e($qrUrl)?>" alt="QR Code do suporte">
    <h1>Suporte</h1>
    <p><?=e($text)?></p>
    <a href="<?=e($supportLink)?>">Abrir atendimento</a>
</main>
</body>
</html>
