<!DOCTYPE html>
<html lang="pt-br">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Registro - MonitorPing</title>
    <!-- Fonte moderna como Inter -->
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
    <style>
        :root {
            --bg-color: #0f172a;
            --card-bg: rgba(30, 41, 59, 0.7);
            --primary: #3b82f6;
            --primary-hover: #2563eb;
            --text-main: #f8fafc;
            --text-muted: #94a3b8;
            --border: rgba(255, 255, 255, 0.1);
        }
        
        * { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }
        
        body {
            background-color: var(--bg-color);
            color: var(--text-main);
            min-height: 100vh;
            display: flex;
        }

        /* Lado esquerdo (Hero/Aesthetic) */
        .auth-hero {
            flex: 1;
            display: none;
            background: radial-gradient(circle at top left, #1e3a8a 0%, #0f172a 100%);
            position: relative;
            overflow: hidden;
        }
        
        @media (min-width: 900px) {
            .auth-hero { display: flex; flex-direction: column; justify-content: center; padding: 60px; }
        }

        .auth-hero::before {
            content: '';
            position: absolute;
            width: 800px; height: 800px;
            background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, transparent 60%);
            top: -200px; left: -200px;
            border-radius: 50%;
        }

        .hero-content {
            position: relative;
            z-index: 10;
            max-width: 480px;
        }

        .hero-title {
            font-size: 3rem; font-weight: 700; line-height: 1.1; margin-bottom: 24px;
            background: linear-gradient(to right, #60a5fa, #a78bfa);
            -webkit-background-clip: text; -webkit-text-fill-color: transparent;
        }
        .hero-subtitle { font-size: 1.125rem; color: var(--text-muted); line-height: 1.6; }

        /* Lado direito (Formulário) */
        .auth-wrapper {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            position: relative;
        }

        .auth-card {
            width: 100%;
            max-width: 420px;
            background: var(--card-bg);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid var(--border);
            border-radius: 24px;
            padding: 48px;
            box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
            animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
        }

        @keyframes slideUp {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .auth-card h2 { font-size: 1.75rem; font-weight: 600; margin-bottom: 8px; }
        .auth-card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 32px; }

        .auth-error {
            background: rgba(239, 68, 68, 0.1);
            color: #f87171;
            border: 1px solid rgba(239, 68, 68, 0.2);
            padding: 12px 16px;
            border-radius: 8px;
            font-size: 0.9rem;
            margin-bottom: 24px;
        }

        .form-group { margin-bottom: 20px; text-align: left; }
        .form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 8px; color: #cbd5e1; }
        
        .form-group input {
            width: 100%; padding: 14px 16px;
            background: rgba(15, 23, 42, 0.5);
            border: 1px solid var(--border);
            border-radius: 12px;
            color: #fff; font-size: 1rem;
            transition: all 0.2s;
        }
        
        .form-group input:focus {
            outline: none; border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
            background: rgba(15, 23, 42, 0.8);
        }

        .btn-submit {
            width: 100%; padding: 14px;
            background: var(--primary);
            color: #fff; border: none; border-radius: 12px;
            font-size: 1rem; font-weight: 600;
            cursor: pointer; transition: background 0.2s, transform 0.1s;
            margin-top: 12px;
        }
        
        .btn-submit:hover { background: var(--primary-hover); }
        .btn-submit:active { transform: scale(0.98); }

        .auth-separator {
            margin: 32px 0; text-align: center; position: relative; color: var(--text-muted); font-size: 0.85rem;
        }
        .auth-separator::before, .auth-separator::after {
            content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border);
        }
        .auth-separator::before { left: 0; }
        .auth-separator::after { right: 0; }

        .auth-meta { text-align: center; font-size: 0.9rem; color: var(--text-muted); }
        .auth-meta a { color: var(--primary); text-decoration: none; font-weight: 600; margin-left: 4px; }
        .auth-meta a:hover { text-decoration: underline; }
        
        .logo-small {
            display: inline-flex; align-items: center; justify-content: center;
            width: 40px; height: 40px; border-radius: 10px;
            background: linear-gradient(135deg, #3b82f6, #6366f1);
            margin-bottom: 24px; font-size: 1.2rem;
        }

    </style>
</head>
<body>

    <div class="auth-hero">
        <div class="hero-content">
            <h1 class="hero-title">Aumente sua escalabilidade.</h1>
            <p class="hero-subtitle">Junte-se à nossa plataforma e garanta a disponibilidade da sua operação 24 horas por dia. Monitoramento ativo inteligente para aplicações globais.</p>
        </div>
    </div>

    <div class="auth-wrapper">
        <div class="auth-card">
            <div class="logo-small">📡</div>
            <h2>Criar conta</h2>
            <p>Preencha os dados abaixo e inicie imediatamente.</p>

            <?php if (!empty($error)): ?>
                <div class="auth-error"><?php echo h($error); ?></div>
            <?php endif; ?>

            <form method="post" action="index.php?page=register">
                <div class="form-group">
                    <label>Nome completo</label>
                    <input type="text" name="name" placeholder="John Doe" required autofocus>
                </div>

                <div class="form-group">
                    <label>E-mail corporativo</label>
                    <input type="email" name="email" placeholder="admin@exemplo.com" required>
                </div>

                <div class="form-group">
                    <label>Sua senha segura</label>
                    <input type="password" name="password" placeholder="••••••••" required>
                </div>

                <button type="submit" class="btn-submit">Registrar Conta</button>
            </form>

            <div class="auth-separator">ou</div>

            <div class="auth-meta">
                Já possui acesso? <a href="index.php?page=login">Fazer login</a>
            </div>
        </div>
    </div>

</body>
</html>
