@extends('layouts.auth')

@section('title', 'Accept Invitation | Infra24')

@section('content')
<div class="row justify-content-center">
    <div class="col-md-8 col-lg-6 col-xl-5">
        <div class="card mt-4">
            <div class="card-body p-4">
                <div class="text-center mt-2">
                    <h5 class="text-primary">Accept Invitation</h5>
                    <p class="text-muted">You are joining <strong>{{ $invitation->company->name }}</strong> as a Planner.</p>
                </div>
                <div class="p-2 mt-4">
                    <form method="POST" action="{{ route('invite.accept.store', $invitation->token) }}">
                        @csrf
                        <div class="mb-3">
                            <label class="form-label">Email</label>
                            <input type="email" class="form-control" name="email" value="{{ $invitation->email }}" readonly disabled>
                        </div>

                        <div class="mb-3">
                            <label for="name" class="form-label">Full Name <span class="text-danger">*</span></label>
                            <input type="text" class="form-control @error('name') is-invalid @enderror" id="name" name="name" value="{{ old('name') }}" placeholder="Enter full name" required autofocus>
                            @error('name') <div class="invalid-feedback">{{ $message }}</div> @enderror
                        </div>

                        <div class="mb-3">
                            <label class="form-label" for="password-input">Password <span class="text-danger">*</span></label>
                            <input type="password" class="form-control @error('password') is-invalid @enderror" placeholder="Enter password" id="password-input" name="password" required>
                            @error('password') <div class="invalid-feedback">{{ $message }}</div> @enderror
                        </div>

                        <div class="mb-3">
                            <label class="form-label" for="password-confirm">Confirm Password <span class="text-danger">*</span></label>
                            <input type="password" class="form-control" placeholder="Confirm password" id="password-confirm" name="password_confirmation" required>
                        </div>

                        <div class="mt-4">
                            <button class="btn btn-primary w-100" type="submit">Complete Setup</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
