<section>
    <header class="mb-3">
        <h2 class="h5 mb-1">
            {{ __('Profile Information') }}
        </h2>
        <p class="text-muted mb-0">
            {{ __("Update your account's profile information and email address.") }}
        </p>
    </header>

    <form id="send-verification" method="post" action="{{ route('verification.send') }}">
        @csrf
    </form>

    <form method="post" action="{{ route('profile.update') }}">
        @csrf
        @method('patch')


        <div class="row">
            <div class="col-md-6 mb-3">
                <label for="first_name" class="form-label">{{ __('First Name') }}</label>
                <input id="first_name" name="first_name" type="text" class="form-control" value="{{ old('first_name', $user->first_name ?? '') }}" required autocomplete="given-name">
                @if($errors->has('first_name'))
                    <div class="invalid-feedback d-block">{{ $errors->first('first_name') }}</div>
                @endif
            </div>
            <div class="col-md-6 mb-3">
                <label for="last_name" class="form-label">{{ __('Last Name') }}</label>
                <input id="last_name" name="last_name" type="text" class="form-control" value="{{ old('last_name', $user->last_name ?? '') }}" required autocomplete="family-name">
                @if($errors->has('last_name'))
                    <div class="invalid-feedback d-block">{{ $errors->first('last_name') }}</div>
                @endif
            </div>
        </div>

        <div class="mb-3">
            <label for="email" class="form-label">{{ __('Email') }}</label>
            <input id="email" name="email" type="email" class="form-control" value="{{ old('email', $user->email) }}" required autocomplete="username">
            @if($errors->has('email'))
                <div class="invalid-feedback d-block">{{ $errors->first('email') }}</div>
            @endif

            @if ($user instanceof \Illuminate\Contracts\Auth\MustVerifyEmail && ! $user->hasVerifiedEmail())
                <div class="mt-2">
                    <p class="text-muted mb-1">
                        {{ __('Your email address is unverified.') }}
                        <button form="send-verification" class="btn btn-link p-0 align-baseline">
                            {{ __('Click here to re-send the verification email.') }}
                        </button>
                    </p>
                    @if (session('status') === 'verification-link-sent')
                        <p class="text-success small mb-0">
                            {{ __('A new verification link has been sent to your email address.') }}
                        </p>
                    @endif
                </div>
            @endif
        </div>

        <div class="mt-4">
            <button type="submit" class="btn btn-success">{{ __('Save') }}</button>
            @if (session('status') === 'profile-updated')
                <span class="text-success ms-3">{{ __('Saved.') }}</span>
            @endif
        </div>
    </form>
</section>
