<?= $this->extend('layout/main') ?>
<?= $this->section('title') ?>Register<?= $this->endSection() ?>

<?= $this->section('content') ?>
<div class="container" style="max-width: 400px; padding: 4rem 1.5rem;">
    <div class="card" style="box-shadow: 0 4px 6px rgba(0,0,0,0.05);">
        <h2 style="text-align: center; margin-bottom: 1.5rem; font-weight: 700;">Create Account</h2>
        
        <?php if(!empty($domain)): ?>
            <div class="alert" style="background: #eff6ff; color: var(--primary); text-align: center; font-weight: 500; font-size: 0.875rem;">
                Claiming <span style="font-weight: 700;"><?= esc($domain) ?></span>
            </div>
        <?php endif; ?>

        <form action="<?= base_url('register/process') ?>" method="POST">
            <?php if(!empty($domain)): ?>
                <input type="hidden" name="domain" value="<?= esc($domain) ?>">
                <input type="hidden" name="suffix_id" value="<?= esc($suffix_id) ?>">
            <?php endif; ?>

            <div class="form-group">
                <label class="form-label">Username</label>
                <input type="text" name="username" class="form-control" required>
            </div>

            <div class="form-group">
                <label class="form-label">Email Address</label>
                <input type="email" name="email" class="form-control" required>
            </div>
            
            <div class="form-group">
                <label class="form-label">Password</label>
                <input type="password" name="password" class="form-control" required>
            </div>

            <div class="form-group">
                <label class="form-label">Confirm Password</label>
                <input type="password" name="password_confirm" class="form-control" required>
            </div>
            
            <button type="submit" class="btn btn-primary" style="width: 100%; justify-content: center; padding: 0.75rem;">Create Account</button>
        </form>
        
        <div style="text-align: center; margin-top: 1.5rem; font-size: 0.875rem; color: var(--text-muted);">
            Already have an account? <a href="<?= base_url('login') ?>">Login</a>
        </div>
    </div>
</div>
<?= $this->endSection() ?>
