@extends('layouts.app')

@section('content')
    <div style="max-width:700px">
        <form method="POST" action="{{ route('company.details.store', ['company' => $company]) }}">
            @csrf
            <div class="row">
                <div class="col">
                    <div class="form-floating mb-3">
                        <input id="details.inn" name="details[inn]" value="{{ $details['details']['inn'] }}"
                            class="form-control rounded-4 bg-white @error('details.inn') is-invalid @enderror" required
                            placeholder="ИНН агентства">
                        <label for="details.inn">ИНН агентства</label>
                        @error('details.inn')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $message }}</strong>
                            </span>
                        @enderror
                    </div>
                </div>
                <div class="col">
                    <div class="form-floating mb-3">
                        <input id="email" name="email" value="{{ $details['email'] }}"
                            class="form-control rounded-4 bg-white @error('email') is-invalid @enderror" required
                            placeholder="Электронная почта">
                        <label for="email">Электронная почта</label>
                        @error('email')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $message }}</strong>
                            </span>
                        @enderror
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col">
                    <div class="form-floating mb-3">
                        <input id="details.kpp" name="details[kpp]" value="{{ $details['details']['kpp'] }}"
                            class="form-control rounded-4 bg-white @error('details.kpp') is-invalid @enderror" required
                            placeholder="КПП агентства">
                        <label for="details.kpp">КПП агентства</label>
                        @error('details.kpp')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $message }}</strong>
                            </span>
                        @enderror
                    </div>
                </div>
                <div class="col">
                    <div class="form-floating mb-3">
                        <input id="details.ogrn" name="details[ogrn]" value="{{ $details['details']['ogrn'] }}"
                            class="form-control rounded-4 bg-white @error('details.ogrn') is-invalid @enderror" required
                            placeholder="ОГРН">
                        <label for="details.ogrn">ОГРН</label>
                        @error('details.ogrn')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $message }}</strong>
                            </span>
                        @enderror
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col">
                    <div class="form-floating mb-3">
                        <input id="name" name="name" value="{{ $details['name'] }}"
                            class="form-control rounded-4 bg-white @error('name') is-invalid @enderror" required
                            placeholder="Наименование агентства">
                        <label for="name">Наименование агентства</label>
                        @error('name')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $message }}</strong>
                            </span>
                        @enderror
                    </div>
                </div>
                <div class="col">
                    <div class="form-floating mb-3">
                        <input id="fullName" name="fullName" value="{{ $details['fullName'] }}"
                            class="form-control rounded-4 bg-white @error('fullName') is-invalid @enderror" required
                            placeholder="Полное наименование агентства">
                        <label for="fullName">Полное наименование агентства</label>
                        @error('fullName')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $message }}</strong>
                            </span>
                        @enderror
                    </div>
                </div>
            </div>
            <div class="form-floating mb-3">
                <input id="details.post_address" name="details[post_address]"
                    value="{{ $details['details']['post_address'] }}"
                    class="form-control rounded-4 bg-white @error('details.post_address') is-invalid @enderror" required
                    placeholder="Почтовый адрес">
                <label for="details.post_address">Почтовый адрес</label>
                @error('details.post_address')
                    <span class="invalid-feedback" role="alert">
                        <strong>{{ $message }}</strong>
                    </span>
                @enderror
            </div>
            <div class="form-floating mb-3">
                <input id="details.address" name="details[address]" value="{{ $details['details']['address'] }}"
                    class="form-control rounded-4 bg-white @error('details.address') is-invalid @enderror" required
                    placeholder="Фактический адрес">
                <label for="details.address">Фактический адрес</label>
                @error('details.address')
                    <span class="invalid-feedback" role="alert">
                        <strong>{{ $message }}</strong>
                    </span>
                @enderror
            </div>
            <div class="form-floating mb-3">
                <input id="details.legal_address" name="details[legal_address]"
                    value="{{ $details['details']['legal_address'] }}"
                    class="form-control rounded-4 bg-white @error('details.legal_address') is-invalid @enderror" required
                    placeholder="Юридический адрес">
                <label for="details.legal_address">Юридический адрес</label>
                @error('details.legal_address')
                    <span class="invalid-feedback" role="alert">
                        <strong>{{ $message }}</strong>
                    </span>
                @enderror
            </div>

            <div class="row">
                <div class="col">
                    <div class="form-floating mb-3">
                        <input id="details.bank.name" name="details[bank][name]"
                            value="{{ $details['details']['bank']['name'] }}"
                            class="form-control rounded-4 bg-white @error('details.bank.name') is-invalid @enderror"
                            name="details.bank.name" required placeholder="Наименование банка">
                        <label for="details.bank.name">Наименование банка</label>
                        @error('details.bank.name')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $message }}</strong>
                            </span>
                        @enderror
                    </div>
                </div>
                <div class="col">
                    <div class="form-floating mb-3">
                        <input id="details.bank.bik" name="details[bank][bik]"
                            value="{{ $details['details']['bank']['bik'] }}"
                            class="form-control rounded-4 bg-white @error('details.bank.bik') is-invalid @enderror"
                            name="details.bank.bik" required placeholder="БИК банка">
                        <label for="details.bank.bik">БИК банка</label>
                        @error('details.bank.bik')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $message }}</strong>
                            </span>
                        @enderror
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col">
                    <div class="form-floating mb-3">
                        <input id="details.bank.cur" name="details[bank][cur]"
                            value="{{ $details['details']['bank']['cur'] }}"
                            class="form-control rounded-4 bg-white @error('details.bank.cur') is-invalid @enderror"
                            name="details.bank.cur" required placeholder="Расчетный счет">
                        <label for="details.bank.cur">Расчетный счет</label>
                        @error('details.bank.cur')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $message }}</strong>
                            </span>
                        @enderror
                    </div>
                </div>
                <div class="col">
                    <div class="form-floating mb-3">
                        <input id="details.bank.pers" name="details[bank][pers]"
                            value="{{ $details['details']['bank']['pers'] }}"
                            class="form-control rounded-4 bg-white @error('details.bank.pers') is-invalid @enderror"
                            name="details.bank.pers" required placeholder="Лицевой счет">
                        <label for="details.bank.pers">Лицевой счет</label>
                        @error('details.bank.pers')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $message }}</strong>
                            </span>
                        @enderror
                    </div>
                </div>
            </div>
            <button class="btn rounded-4 text-light fw-bold fs-5 w-100 py-3" style="background-color: #20184d;">
                Сохранить изменения
            </button>
        </form>
    </div>
@endsection
