<?php
/**
 * 🚀 SISTEMA IBO XC - SECURE LOGOUT & GOODBYE SCREEN V4.0
 */

if (session_status() === PHP_SESSION_NONE) {
    session_start();
}

$_SESSION = array();

if (ini_get("session.use_cookies")) {
    $params = session_get_cookie_params();
    setcookie(session_name(), '', time() - 42000,
        $params["path"], $params["domain"],
        $params["secure"], $params["httponly"]
    );
}

setcookie("auth", "", time() - 3600, "/");

session_destroy();
?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>IBO XC - Saindo...</title>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        body {
            margin: 0; padding: 0;
            font-family: 'Inter', sans-serif;
            background: #f3f4f6;
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
        }
        .logout-box {
            background: #ffffff;
            padding: 40px;
            border-radius: 20px;
            box-shadow: 0 10px 25px rgba(0,0,0,0.05);
            max-width: 350px;
            width: 90%;
        }
        .icon-circle {
            width: 80px;
            height: 80px;
            background: #eef2ff;
            color: #4f46e5;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 35px;
            margin: 0 auto 20px;
        }
        h2 { color: #111827; margin-bottom: 10px; font-weight: 700; }
        p { color: #6b7280; font-size: 1rem; margin-bottom: 25px; }
        
        .loader-bar {
            height: 4px;
            width: 100%;
            background: #e5e7eb;
            border-radius: 10px;
            overflow: hidden;
        }
        .loader-progress {
            height: 100%;
            background: #4f46e5;
            width: 0%;
            animation: progress 3s linear forwards;
        }
        @keyframes progress {
            0% { width: 0%; }
            100% { width: 100%; }
        }
    </style>
    <meta http-equiv="refresh" content="3;url=index.php">
</head>
<body>

    <div class="logout-box">
        <div class="icon-circle">
            <i class="fas fa-sign-out-alt"></i>
        </div>
        <h2>IBO XC</h2>
        <p>Você saiu do <strong>IBO XC Painel</strong> com segurança.</p>
        
        <div class="loader-bar">
            <div class="loader-progress"></div>
        </div>
        <small style="display:block; margin-top:15px; color:#9ca3af;">Redirecionando...</small>
    </div>

</body>
</html>