<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Box Connected</title>
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: linear-gradient(135deg, #0061d5 0%, #0073e6 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .container {
            background: white;
            border-radius: 16px;
            box-shadow: 0 20px 40px rgba(0,0,0,0.15);
            padding: 40px;
            max-width: 500px;
            width: 100%;
            text-align: center;
        }
        .icon { font-size: 64px; margin-bottom: 20px; }
        h1 { color: #2d3748; font-size: 24px; margin-bottom: 16px; }
        .email-box {
            background: #f0fff4;
            border: 1px solid #9ae6b4;
            border-radius: 8px;
            padding: 16px;
            margin: 20px 0;
        }
        .email { font-weight: 600; color: #2d3748; }
        .btn {
            background: #0061d5;
            color: white;
            border: none;
            padding: 12px 24px;
            border-radius: 8px;
            font-size: 16px;
            cursor: pointer;
        }
        .btn:hover { background: #0052b3; }
    </style>
</head>
<body>
    <div class="container">
        <div class="icon">✅</div>
        <h1>Box Connected Successfully!</h1>
        <div class="email-box">
            <span class="email">{{ email }}</span>
        </div>
        <button class="btn" onclick="window.close()">Close Window</button>
    </div>
    <script>
        if (window.opener) {
            window.opener.postMessage({type: 'box_oauth_success', email: '{{ email }}'}, '*');
            setTimeout(() => window.close(), 3000);
        }
    </script>
</body>
</html>
