@extends('layout.auth')

@section('title', 'Daftar Member Baru')

@section('content')
<div class="auth-visual-side" style="background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);">
    <div class="visual-logo-box">
        <a href="/" style="text-decoration:none; display:flex; align-items:center; gap:15px;">
            <img src="{{ asset('assets/img/logo-pro.png') }}" alt="Logo" style="width:40px; height:40px; border-radius:10px;">
            <span style="color:white; font-weight:900; font-size:1.2rem; letter-spacing:-1px;">{{ $shop_settings['shop_name'] ?? 'PrintPro' }}</span>
        </a>
    </div>

    <div class="visual-content">
        <div class="visual-badge" style="background:rgba(99,102,241,0.2); border-color:rgba(99,102,241,0.3); color:#a5b4fc;">Exclusive Access</div>
        <h2>Akses Layanan<br>Prioritas.</h2>
        <p>Gabung dengan ribuan member lainnya dan nikmati kemudahan klaim garansi serta promo suku cadang original.</p>
    </div>

    <div class="visual-footer" style="position:relative; z-index:2; font-size:12px; color:rgba(255,255,255,0.4); font-weight:600;">
        &copy; {{ date('Y') }} {{ $shop_settings['shop_name'] ?? 'PrintPro' }} &bull; Data Encrypted
    </div>
</div>

<div class="auth-form-side">
    <div class="form-header">
        <h1>Buat Akun</h1>
        <p>Lengkapi data untuk bergabung sebagai member</p>
    </div>

    <form action="{{ route('register') }}" method="POST">
        @csrf
        
        <div class="row gx-3">
            <div class="col-md-12">
                <div class="input-group-pro">
                    <label class="label-pro">Nama Lengkap</label>
                    <div class="input-box">
                        <i class="lni lni-user"></i>
                        <input type="text" name="name" class="control-pro @error('name') is-invalid @enderror" 
                            placeholder="Nama Lengkap" value="{{ old('name') }}" required autofocus>
                        @error('name')
                            <div class="invalid-feedback">{{ $message }}</div>
                        @enderror
                    </div>
                </div>
            </div>
            <div class="col-md-12">
                <div class="input-group-pro">
                    <label class="label-pro">Nomor Telepon</label>
                    <div class="input-box">
                        <i class="lni lni-phone"></i>
                        <input type="number" name="phone" class="control-pro @error('phone') is-invalid @enderror" 
                            placeholder="0812XXXXXXXX" value="{{ old('phone') }}" required>
                        @error('phone')
                            <div class="invalid-feedback">{{ $message }}</div>
                        @enderror
                    </div>
                </div>
            </div>
        </div>

        <div class="input-group-pro">
            <label class="label-pro">Alamat Email</label>
            <div class="input-box">
                <i class="lni lni-envelope"></i>
                <input type="email" name="email" class="control-pro @error('email') is-invalid @enderror" 
                    placeholder="nama@email.com" value="{{ old('email') }}" required>
                @error('email')
                    <div class="invalid-feedback">{{ $message }}</div>
                @enderror
            </div>
        </div>

        <div class="row gx-3">
            <div class="col-md-6">
                <div class="input-group-pro">
                    <label class="label-pro">Kata Sandi</label>
                    <div class="input-box">
                        <i class="lni lni-lock-alt"></i>
                        <input type="password" name="password" class="control-pro @error('password') is-invalid @enderror" 
                            placeholder="••••••••" required>
                        <i class="lni lni-eye pass-toggle"></i>
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="input-group-pro">
                    <label class="label-pro">Konfirmasi</label>
                    <div class="input-box">
                        <i class="lni lni-lock-alt"></i>
                        <input type="password" name="password_confirmation" class="control-pro" 
                            placeholder="••••••••" required>
                        <i class="lni lni-eye pass-toggle"></i>
                    </div>
                </div>
            </div>
        </div>

        <button type="submit" class="btn-pro">
            Daftar Sekarang <i class="lni lni-checkmark-circle"></i>
        </button>
    </form>

    <p class="auth-footer mt-4">
        Sudah punya akun? 
        <a href="{{ route('login') }}" class="auth-link">Masuk Kembali</a>
    </p>
</div>
@endsection