<html>

<x-head />

<body>

    <x-header />

    <div class="bradcam_area bradcam_bg_1">
        <div class="container">
            <div class="row">
                <div class="col-xl-12">
                    <div class="bradcam_text">
                        <h3>Добро пожаловать</h3>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="container mt-5 mb-5">
  <div class="row justify-content-center">
    <div class="col-md-6">
      @if(Route::is('login'))
      <div class="card shadow-sm">
        <div class="card-header bg-primary text-white">
          <h3 class="mb-0">Вход</h3>
        </div>
        <div class="card-body">
          <form action="{{ Route('authuser') }}" method="post" class="login_form">
            @csrf
            <div class="form-group">
              <label for="email">Email</label>
              <input type="email" class="form-control" id="email" name="email" placeholder="Enter your email">
            </div>
            @error("email")
            <div class="alert alert-danger">{{ $message }}</div>
            @enderror
            <div class="form-group">
              <label for="password">Password</label>
              <input type="password" class="form-control" id="password" name="password" placeholder="Enter your password">
            </div>
            @error("password")
            <div class="alert alert-danger">{{ $message }}</div>
            @enderror
            <button type="submit" class="btn btn-primary btn-block">Войти</button>
            <div class="mt-3">
              <a href="{{ Route('register') }}" class="text-muted">У меня нет аккаунта</a>
            </div>
          </form>
        </div>
      </div>
      @else
      <div class="card shadow-sm">
        <div class="card-header bg-primary text-white">
          <h3 class="mb-0">Регистрация</h3>
        </div>
        <div class="card-body">
          <form action="{{ Route('createuser') }}" method="post" class="registration_form" enctype="multipart/form-data">
            @csrf
            <div class="form-group">
              <label for="name">Имя</label>
              <input type="text" class="form-control" id="nameReg" name="nameReg" placeholder="Enter your name">
            </div>
            @error("nameReg")
            <div class="alert alert-danger">{{ $message }}</div>
            @enderror
            <div class="form-group">
              <label for="email">Почта</label>
              <input type="email" class="form-control" id="emailReg" name="emailReg" placeholder="Enter your email">
            </div>
            @error("emailReg")
            <div class="alert alert-danger">{{ $message }}</div>
            @enderror
            <div class="form-group">
              <label for="password">Пароль</label>
              <input type="password" class="form-control" id="passReg" name="passReg" placeholder="Enter your password">
            </div>
            @error("passReg")
            <div class="alert alert-danger">{{ $message }}</div>
            @enderror
            <div class="form-group">
              <label for="avatar">Аватар</label>
              <input type="file" class="form-control-file" id="avatar" name="avatar">
            </div>
            @error("avatar")
            <div class="alert alert-danger">{{ $message }}</div>
            @enderror
            <div class="form-group">
              <label for="role">Роль</label></br>
              <select class="form-control" id="role" name="role">
                <option value="user">Соискатель</option>
                <option value="employer">Работодатель</option>
              </select></br></br>
            </div>
            <button type="submit" class="btn btn-primary btn-block">Зарегистрироваться</button>
            <div class="mt-3">
              <a href="{{ Route('login') }}" class="text-muted">У меня есть аккаунт</a>
            </div>
          </form>
        </div>
      </div>
      @endif
    </div>
  </div>
</div>
    
    <x-footer />

    <x-scripts />
</body>

</html>