<html>
<x-head />

<body class="body">
    <x-header />

    <div class="main">
        <div class="container">
            @if(Route::is('login'))
            <section id="menu">
                <li>
                    <h3>Вход</h3>
                </li>
                <li>
                    <form action="{{Route('authuser')}}" method="post">
                        @csrf
                        <input type="text" name="login" placeholder="Логин"><br>
                        <input type="password" name="password" placeholder="Пароль"><br>
                        <input type="submit" class="button" value="Войти">
                    </form>
                    @error("login")
                    <div class="alert alert-danger">{{ $message }}</div>
                    @enderror
                    @error("password")
                    <div class="alert alert-danger">{{ $message }}</div>
                    @enderror
                </li>
                <li>
                    <a href="{{Route('register')}}">Зарегистрировать аккаунт</a>
                </li>
            </section>
            @endif

            @if(Route::is('register'))
            <section id="menu">
                <li>
                    <h3>Регистрация</h3>
                </li>
                <li>
                    <form action="{{Route('createuser')}}" method="post">
                        @csrf
                        <input type="text" name="fio" placeholder="ФИО"><br>
                        <input type="text" name="login" placeholder="Логин"><br>
                        <input inputmode="tel" min="1" max="11" name="number" placeholder="Номер телефона" maxlength="11"><br>
                        <input type="email" name="email" placeholder="Почта"><br>
                        <input type="password" name="password" placeholder="Пароль"><br>
                        <input type="submit" class="button" value="Зарегистрироваться">
                    </form>
                    @error("fio")
                    <div class="alert alert-danger">{{ $message }}</div>
                    @enderror
                    @error("login")
                    <div class="alert alert-danger">{{ $message }}</div>
                    @enderror
                    @error("number")
                    <div class="alert alert-danger">{{ $message }}</div>
                    @enderror
                    @error("email")
                    <div class="alert alert-danger">{{ $message }}</div>
                    @enderror
                    @error("password")
                    <div class="alert alert-danger">{{ $message }}</div>
                    @enderror
                </li>
                <li>
                    <a href="{{Route('login')}}">Войти в аккаунт</a>
                </li>
            </section>
            @endif
        </div>
    </div>
</body>

</html>