<?php
include 'includes/header.php'
?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<title>Sucesso - Ultra IBO</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
<style>
    :root {
        --primary: #00D4FF;
        --accent: #00FF88;
        --revenda-color: #00D4FF;
        --subrevenda-color: #00FF88;
        --surface-light: rgba(20, 30, 50, 0.9);
        --text-primary: #fff;
        --border: rgba(255,255,255,0.1);
    }
    body {
        background: radial-gradient(circle at center, #0a0a0f, #000);
        font-family: 'Inter', sans-serif;
        color: var(--text-primary);
        margin: 0;
        height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }
    .success-container {
        background: var(--surface-light);
        border: 1px solid var(--border);
        border-radius: 20px;
        box-shadow: 0 0 25px rgba(0, 212, 255, 0.6);
        padding: 50px 80px;
        text-align: center;
        position: relative;
        overflow: hidden;
        animation: fadeIn 0.8s ease;
    }
    .icon {
        font-size: 4rem;
        text-shadow: 0 0 20px currentColor;
        animation: pulse 2s infinite;
    }
    h2 {
        margin-top: 25px;
        font-size: 1.8rem;
        letter-spacing: 1px;
        font-weight: 700;
    }
    .nepster-email {
        color: #00FF88;
        font-weight: 700;
        font-size: 1rem;
        text-shadow: 0 0 8px #00FF88;
        margin: 15px 0;
    }
    .btn {
        border: none;
        border-radius: 12px;
        padding: 14px 26px;
        color: white;
        font-size: 1rem;
        font-weight: bold;
        text-transform: uppercase;
        cursor: pointer;
        background: linear-gradient(135deg, var(--primary), #0099cc);
        transition: all 0.3s ease;
        margin: 10px;
    }
    .btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0, 212, 255, 0.6);
    }
    @keyframes fadeIn {
        from { opacity: 0; transform: scale(0.9); }
        to { opacity: 1; transform: scale(1); }
    }
    @keyframes pulse {
        0%,100% { transform: scale(1); }
        50% { transform: scale(1.15); }
    }
</style>
</head>
<body>
<?php
$mensagem = $_GET['msg'] ?? 'Conta criada com sucesso!';
$email = $_GET['email'] ?? '';
$tipo = $_GET['tipo'] ?? 'revenda';
$icon = $tipo == 'subrevenda' ? 'fa-user-plus' : 'fa-store';
$color = $tipo == 'subrevenda' ? 'var(--subrevenda-color)' : 'var(--revenda-color)';
?>
<div class="success-container">
    <i class="fas <?php echo $icon; ?>" style="color: <?php echo $color; ?>"></i>
    <h2><?php echo htmlspecialchars($mensagem); ?></h2>
    <?php if ($email): ?>
        <p class="nepster-email">E-mail Nepster: <?php echo htmlspecialchars($email); ?></p>
    <?php endif; ?>
    <p>Você será redirecionado automaticamente para o painel principal.</p>
    <button class="btn" onclick="window.location.href='revenda.php'">Voltar Agora</button>
</div>
<script>
// SOLUÇÃO DEFINITIVA: Redirecionar e limpar cache (Adicionando um timestamp para forçar o recarregamento)
setTimeout(() => { 
    // Forçar reload sem cache
    window.location.href = 'revenda.php?t=' + new Date().getTime();
}, 3000);

// Prevenir que o usuário volte para a página de POST
if (window.history.replaceState) {
    window.history.replaceState(null, null, window.location.href);
}
</script>
</body>
</html>