<x-header />

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

    @else(Route::is('register'))
    <section class="shadow" id="menu">
      <li>
        <h3 class="ap">Регистрация</h3>
      </li>
      <li>
        <form action="{{ route('createuser') }}" method="post" enctype="multipart/form-data">
          @csrf
          <input type="text" name="fio" placeholder="ФИО">
          @error("fio")
          <div class="alert alert-danger">{{ $message }}</div>
          @enderror
          <input type="text" name="login" placeholder="Логин">
          @error("login")
          <div class="alert alert-danger">{{ $message }}</div>
          @enderror
          <input type="text" name="email" placeholder="Почта">
          @error("email")
          <div class="alert alert-danger">{{ $message }}</div>
          @enderror
          <input id="number" inputmode="tel" name="number" placeholder="+7 (___) ___-__-__" value="+7" maxlength="18">
          @error("number")
          <div class="alert alert-danger">{{ $message }}</div>
          @enderror
          <input type="password" name="password" placeholder="Пароль">
          @error("password")
          <div class="alert alert-danger">{{ $message }}</div>
          @enderror
          <input type="submit" class="but" value="Войти">
        </form>
      </li>

      <li>
        <a href="{{Route('login')}}">У меня есть аккаунт</a>
      </li>
    </section>
    @endif
  </div>
</div>
<x-footer />

<x-scripts />