@extends('layouts.app')

@section('title', 'Register - Movex Nigeria Map Accounts')

@section('auth')
<div class="auth-wrap">
    <div class="auth-card">
        @include('layouts.flash')
        <h1>Create User Account</h1>
        <p class="muted">Every user registers here. The system generates the user number automatically, because manually typing identity codes is how chaos gets a promotion.</p>

        <form method="POST" action="{{ route('register.store') }}" class="grid" style="margin-top:22px;">
            @csrf
            <div class="form-grid two">
                <div>
                    <label for="first_name">First Name</label>
                    <input id="first_name" name="first_name" value="{{ old('first_name') }}" required autofocus>
                </div>
                <div>
                    <label for="surname">Surname</label>
                    <input id="surname" name="surname" value="{{ old('surname') }}" required>
                </div>
            </div>
            <div class="form-grid two">
                <div>
                    <label for="username">Username</label>
                    <input id="username" name="username" value="{{ old('username') }}" required>
                </div>
                <div>
                    <label for="role">Role</label>
                    <select id="role" name="role" required>
                        <option value="monitoring" @selected(old('role') === 'monitoring')>Monitoring</option>
                        <option value="account" @selected(old('role') === 'account')>Account</option>
                    </select>
                </div>
            </div>
            <div class="form-grid two">
                <div>
                    <label for="email">Email</label>
                    <input id="email" type="email" name="email" value="{{ old('email') }}" required>
                </div>
                <div>
                    <label for="phone">Phone Number</label>
                    <input id="phone" name="phone" value="{{ old('phone') }}" placeholder="+234...">
                </div>
            </div>
            <div class="form-grid two">
                <div>
                    <label for="password">Password</label>
                    <input id="password" type="password" name="password" required>
                </div>
                <div>
                    <label for="password_confirmation">Confirm Password</label>
                    <input id="password_confirmation" type="password" name="password_confirmation" required>
                </div>
            </div>
            <button class="btn" type="submit">Create Account</button>
        </form>

        <p class="muted" style="margin-top:18px;">Already registered? <a href="{{ route('login') }}" style="color:var(--brand); font-weight:800;">Login here</a></p>
    </div>
</div>
@endsection
