<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Register Page</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            background-color: #00b894;
            height: 100vh;
            margin: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .register-wrapper {
            width: 100%;
            max-width: 400px;
            margin: 0 auto;
            padding: 0 15px;
        }

        .register-card {
            background: white;
            padding: 2rem;
            border-radius: 15px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            width: 100%;
            text-align: center;
        }

        .register-header {
            text-align: center;
            margin-bottom: 2rem;
        }

        .form-control {
            border: 1px solid #ddd;
            padding: 0.8rem;
            margin-bottom: 1rem;
            border-radius: 8px;
        }

        .btn-register {
            background-color: #00b894;
            border: none;
            padding: 0.8rem;
            border-radius: 8px;
            width: 100%;
            color: white;
            font-weight: 500;
            margin-top: 1rem;
        }

        .btn-register:hover {
            background-color: #00a38c;
        }

        .login-link {
            margin-top: 1rem;
            font-size: 0.9rem;
        }

        .login-link a {
            color: #00b894;
            text-decoration: none;
        }

        .login-link a:hover {
            text-decoration: underline;
        }
    </style>
</head>

<body>
    <div class="register-wrapper">
        <div class="register-card">
            <div class="register-header">
                <h2 class="mb-2">Buat Akun Baru</h2>
                <p class="text-muted">Silakan isi data untuk mendaftar</p>
            </div>

            <form method="POST" action="{{ url('registersimpan') }}">
                @csrf

                <div class="mb-3">
                    <input type="email" class="form-control @error('email') is-invalid @enderror" name="email"
                        value="{{ old('email') }}" placeholder="Email" required autocomplete="email">
                    @error('email')
                        <span class="invalid-feedback" role="alert">
                            <strong>{{ $message }}</strong>
                        </span>
                    @enderror
                </div>

                <div class="mb-3">
                    <input type="text" class="form-control @error('username') is-invalid @enderror" name="username"
                        value="{{ old('username') }}" placeholder="Username" required autocomplete="username" autofocus>
                    @error('username')
                        <span class="invalid-feedback" role="alert">
                            <strong>{{ $message }}</strong>
                        </span>
                    @enderror
                </div>

                <div class="mb-3">
                    <select class="form-control @error('level') is-invalid @enderror" name="level" required>
                        <option value="" disabled selected>Pilih Level</option>
                        <option value="Ketua">Ketua</option>
                        <option value="Bendahara">Bendahara</option>
                    </select>
                    @error('level')
                        <span class="invalid-feedback" role="alert">
                            <strong>{{ $message }}</strong>
                        </span>
                    @enderror
                </div>

                <div class="mb-3">
                    <input type="password" class="form-control @error('password') is-invalid @enderror" name="password"
                        placeholder="Password" required autocomplete="new-password">
                    @error('password')
                        <span class="invalid-feedback" role="alert">
                            <strong>{{ $message }}</strong>
                        </span>
                    @enderror
                </div>

                <div class="mb-3">
                    <input type="password" class="form-control" name="password_confirmation"
                        placeholder="Konfirmasi Password" required autocomplete="new-password">
                </div>

                <button type="submit" class="btn btn-register">Daftar</button>
            </form>


            <div class="login-link">
                <p>Sudah punya akun? <a href="{{ url('login') }}">Login di sini</a></p>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>

</html>
