@extends('layouts.app')

@section('content')
    <div class="log-reg-container">
        <div class="log-reg-content">
            <div class="d-flex justify-content-between">
                <div class="item-nav-lang">
                    <div class="dropdown">
                                <span class="dropdown-trigger" data-bs-toggle="dropdown">
                                    <i class="bi bi-translate"></i>
                                    {{__(app()->getLocale())}}
                                </span>
                        <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
                            @if(app()->getLocale() != \A7kz\Platform\Enums\Languages::Ru)
                                <li><a class="dropdown-item"
                                       href="{{ \A7kz\Platform\Modules\Platform\Translate\Helpers\TranslateHelper::changeUrlLanguage(\A7kz\Platform\Enums\Languages::Ru) }}"><span>@lang('ru')</span></a>
                                </li>
                            @endif
                            @if(app()->getLocale() != \A7kz\Platform\Enums\Languages::Kz)
                                <li><a class="dropdown-item"
                                       href="{{ \A7kz\Platform\Modules\Platform\Translate\Helpers\TranslateHelper::changeUrlLanguage(\A7kz\Platform\Enums\Languages::Kz) }}"><span>@lang('kz')</span></a>
                                </li>
                            @endif
                            @if(app()->getLocale() != \A7kz\Platform\Enums\Languages::En)
                                <li><a class="dropdown-item"
                                       href="{{ \A7kz\Platform\Modules\Platform\Translate\Helpers\TranslateHelper::changeUrlLanguage(\A7kz\Platform\Enums\Languages::En) }}"><span>@lang('en')</span></a>
                                </li>
                            @endif
                        </ul>
                    </div>
                </div>
                <img src="{{asset('img/logo.svg')}}" alt="logo" class="logo-log">
            </div>
                        <span>{{ __('Register') }}</span>
            <form method="POST" action="{{ lurl('/register') }}">
                @csrf

                <div class="form-group">
                    <label for="name" class="col-form-label">{{ __('Name') }}</label>
                    <input id="name" type="text" class="form-control @error('name') is-invalid @enderror"
                           name="name" value="{{ old('name') }}" required autocomplete="name" autofocus>
                    @error('name')
                    <div class="invalid-feedback form-text text-danger" role="alert">{{ $message }}</div>
                    @enderror
                </div>

                <div class="form-group">
                    <label for="email" class="col-form-label">{{ __('Email Address') }}</label>
                    <input id="email" type="email" class="form-control @error('email') is-invalid @enderror"
                           name="email" value="{{ old('email') }}" required autocomplete="email">
                    @error('email')
                    <div class="invalid-feedback form-text text-danger" role="alert">{{ $message }}</div>
                    @enderror
                </div>

                <div class="form-group">
                    <label for="username" class="col-form-label">{{ __('Username') }}</label>
                    <input id="username" type="text" class="form-control @error('username') is-invalid @enderror"
                           name="username" value="{{ old('username') }}" required autocomplete="username" autofocus>
                    @error('username')
                    <div class="invalid-feedback form-text text-danger" role="alert">{{ $message }}</div>
                    @enderror
                </div>

                <div class="form-group">
                    <label for="biniin" class="col-form-label">{{ __('BinIin') }}</label>
                    <input id="biniin" type="text" class="form-control @error('biniin') is-invalid @enderror"
                           name="biniin" value="{{ old('biniin') }}" required autocomplete="biniin" autofocus>
                    @error('biniin')
                    <div class="invalid-feedback form-text text-danger" role="alert">{{ $message }}</div>
                    @enderror
                </div>

                <div class="form-group">
                    <label for="password" class="col-form-label">{{ __('Password') }}</label>
                    <input id="password" type="password"
                           class="form-control @error('password') is-invalid @enderror" name="password" required
                           autocomplete="new-password">
                    @error('password')
                    <div class="invalid-feedback form-text text-danger" role="alert">{{ $message }}</div>
                    @enderror
                </div>

                <div class="form-group">
                    <label for="password-confirm" class="col-form-label">{{ __('Confirm Password') }}</label>
                    <input id="password-confirm" type="password" class="form-control" name="password_confirmation"
                           required autocomplete="new-password">
                </div>

                <div class="form-group">
                    <label for="isorg" class="col-form-label">{{ __('isOrg') }}</label>
                    <input type="checkbox" id="isorg" name="isorg" value="1">
                </div>

                <button type="submit" class="btn btn-success mt-4">
                    {{ __('Register') }}
                </button>
            </form>
            @if (Route::has('login'))
                <div class="log-reg-bottom">
                    <span>Уже есть аккаунт?</span>
                    <a href="{{ lurl('/login') }}">{{ __('Login') }}</a>
                </div>
            @endif
        </div>
    </div>
@endsection
