<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
$base_dir = rtrim(str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME'] ?? '/')), '/');
$static_url = ($base_dir === '' || $base_dir === '.') ? '/assets/' : $base_dir . '/assets/';
?>
<!DOCTYPE html>
<html lang="pt-BR">
<head>
    <title>TV VIP • Acesso ao Painel</title>
    <meta charset="utf-8" />
    <meta name="description" content="TV VIP • Painel integrado ao aplicativo" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="shortcut icon" href="<?php echo $static_url; ?>media/logos/logo.png" />
    <link href="<?php echo $static_url; ?>plugins/global/plugins.bundle.css" rel="stylesheet" />
    <link href="<?php echo $static_url; ?>css/style.bundle.css" rel="stylesheet" />
    <link href="<?php echo $static_url; ?>css/custom_style.css" rel="stylesheet" />
    <link href="<?php echo $static_url; ?>css/tvvip-theme.css" rel="stylesheet" />
</head>
<body id="kt_body" class="app-blank tvvip-login-page">
<script>
    var defaultThemeMode = "dark";
    document.documentElement.setAttribute("data-bs-theme", "dark");
</script>
<div class="tvvip-login-shell" id="kt_app_root">
    <section class="tvvip-login-card-wrap">
        <div class="tvvip-login-card">
            <img alt="TV VIP" src="<?php echo $static_url; ?>media/logos/logo.png" class="tvvip-login-logo" />
            <div class="text-center">
                <div class="tvvip-kicker">Central de Controle</div>
                <h1 class="tvvip-login-title">Bem-vindo ao painel</h1>
                <p class="tvvip-login-copy">Gerencie DNS, dispositivos, listas e identidade visual do aplicativo em um só lugar.</p>
            </div>

            <form class="form w-100" novalidate="novalidate" id="kt_sign_in_form" data-kt-redirect-url="dns.php" action="#">
                <div class="fv-row mb-5">
                    <label class="form-label fw-bold">Usuário</label>
                    <input type="text" placeholder="Digite seu usuário" name="username" autocomplete="username" class="form-control form-control-lg" />
                </div>
                <div class="fv-row mb-5">
                    <label class="form-label fw-bold">Senha</label>
                    <input type="password" placeholder="Digite sua senha" name="password" autocomplete="current-password" class="form-control form-control-lg" />
                </div>
                <div class="d-grid mt-8">
                    <button type="submit" id="kt_sign_in_submit" class="btn btn-primary btn-lg">
                        <span class="indicator-label">ENTRAR NO PAINEL</span>
                        <span class="indicator-progress">Validando acesso...
                            <span class="spinner-border spinner-border-sm align-middle ms-2"></span>
                        </span>
                    </button>
                </div>
            </form>
        </div>
    </section>

    <aside class="tvvip-hero-copy">
        <div class="tvvip-kicker">TV VIP ECOSYSTEM</div>
        <h2>O aplicativo e o painel, agora na <strong>mesma sintonia.</strong></h2>
        <p>Uma identidade única em preto, vermelho, dourado e prata — a mesma linguagem visual usada no aplicativo e nos controles do painel.</p>
        <span class="tvvip-status mt-4">CONEXÃO CENTRALIZADA</span>
    </aside>
</div>
<script src="<?php echo $static_url; ?>plugins/global/plugins.bundle.js"></script>
<script src="<?php echo $static_url; ?>js/scripts.bundle.js"></script>
<script src="<?php echo $static_url; ?>js/users.js"></script>
</body>
</html>
