<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Halaman registrasi - Daftarkan akun baru untuk mengakses sistem">
    <title>Register - Sistem</title>
    <link rel="stylesheet" href="{{ asset('css/style.css') }}">
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
</head>
<body>
    
    @if($errors->any())
    <div class="toast error show">
        {{ $errors->first() }}
    </div>
    @endif
<!-- Animated background particles -->
    <div class="particles" id="particles"></div>

    <div class="container">
        <div class="card" id="registerCard">
            <h1 class="card-title">SILAKAN REGISTER TERLEBIH DAHULU</h1>
            <p class="card-subtitle">Pendaftaran pengguna sistem</p>

            <div class="avatar">
                <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
                    <circle cx="50" cy="50" r="48" fill="rgba(255,255,255,0.05)" stroke="rgba(255,255,255,0.1)" stroke-width="2"/>
                    <circle cx="50" cy="38" r="16" fill="rgba(255,255,255,0.15)"/>
                    <path d="M20 85 Q20 60 50 60 Q80 60 80 85" fill="rgba(255,255,255,0.15)"/>
                </svg>
            </div>

            <form method="POST" action="{{ route('register') }}">
                @csrf
                <div class="input-group">
                    <span class="input-icon">
                        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                            <path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"/>
                            <circle cx="12" cy="7" r="4"/>
                        </svg>
                    </span>
                    <input type="text" name="name" placeholder="Username" required autocomplete="username">
                    <div class="input-glow"></div>
                </div>

                <div class="input-group">
                    <span class="input-icon">
                        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                            <rect x="2" y="4" width="20" height="16" rx="2"/>
                            <path d="M22 4L12 13L2 4"/>
                        </svg>
                    </span>
                    <input type="email" name="email" placeholder="Email" required autocomplete="email">
                    <div class="input-glow"></div>
                </div>

                <div class="input-group">
                    <span class="input-icon">
                        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                            <rect x="3" y="11" width="18" height="11" rx="2"/>
                            <path d="M7 11V7a5 5 0 0110 0v4"/>
                            <circle cx="12" cy="16" r="1"/>
                        </svg>
                    </span>
                    <input type="password" id="regPassword" name="password" placeholder="Password" required autocomplete="new-password">
                    <span class="toggle-password" onclick="togglePassword('regPassword', this)">
                        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="eye-icon">
                            <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>
                            <circle cx="12" cy="12" r="3"/>
                        </svg>
                    </span>
                    <div class="input-glow"></div>

                </div>

                <small class="password-hint">
                    Password minimal 8 karakter
                </small>

                <div class="input-group">
                    <span class="input-icon">
                        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                            <rect x="3" y="11" width="18" height="11" rx="2"/>
                            <path d="M7 11V7a5 5 0 0110 0v4"/>
                            <circle cx="12" cy="16" r="1"/>
                        </svg>
                    </span>
                    <input type="password" id="regConfirmPassword" name="password_confirmation" placeholder="Confirm Password" required autocomplete="new-password">
                    <span class="toggle-password" onclick="togglePassword('regConfirmPassword', this)">
                        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="eye-icon">
                            <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>
                            <circle cx="12" cy="12" r="3"/>
                        </svg>
                    </span>
                    <div class="input-glow"></div>
                </div>

                <div class="password-match-indicator" id="passwordMatch" style="display:none;">
                    <span class="match-icon"></span>
                    <span class="match-text"></span>
                </div>

                <button type="submit" class="btn" id="registerBtn">
                    <span class="btn-text">REGISTER</span>
                    <span class="btn-loader" style="display:none;">
                        <span class="spinner"></span>
                    </span>
                </button>
            </form>

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

    <script src="{{ asset('js/script.js') }}"></script>
</body>
</html>
