<x-app-layout>
    <x-slot name="header">{{ __('Edit Shareholder') }} — {{ $shareholder->name }}</x-slot>

    <div class="row justify-content-center">
        <div class="col-12 col-lg-6">
            <div class="card shadow-sm border-0">
                <div class="card-body">
                    <form method="POST" action="{{ route('shareholders.update', $shareholder) }}">
                        @csrf @method('PUT')
                        <div class="mb-3">
                            <label class="form-label fw-semibold">{{ __('Name') }} <span class="text-danger">*</span></label>
                            <input type="text" name="name" class="form-control @error('name') is-invalid @enderror" value="{{ old('name', $shareholder->name) }}" required>
                            @error('name')<div class="invalid-feedback">{{ $message }}</div>@enderror
                        </div>
                        <div class="mb-3">
                            <label class="form-label fw-semibold">{{ __('Phone') }}</label>
                            <input type="text" name="phone" class="form-control" value="{{ old('phone', $shareholder->phone) }}">
                        </div>
                        <div class="mb-3">
                            <label class="form-label fw-semibold">{{ __('Email') }}</label>
                            <input type="email" name="email" class="form-control" value="{{ old('email', $shareholder->email) }}">
                        </div>
                        <div class="mb-3">
                            <label class="form-label fw-semibold">{{ __('Address') }}</label>
                            <textarea name="address" class="form-control" rows="2">{{ old('address', $shareholder->address) }}</textarea>
                        </div>
                        <div class="mb-4 form-check">
                            <input type="checkbox" name="is_active" id="is_active" class="form-check-input" value="1" {{ $shareholder->is_active ? 'checked' : '' }}>
                            <label class="form-check-label" for="is_active">{{ __('Active') }}</label>
                        </div>
                        <div class="d-flex gap-2">
                            <button type="submit" class="btn btn-primary">{{ __('Update') }}</button>
                            <a href="{{ route('shareholders.index') }}" class="btn btn-secondary">{{ __('Cancel') }}</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</x-app-layout>
