@extends('layouts.app')

@section('content')
<!DOCTYPE html>
<html>

<head>
  <title>Регистрация на концференцию</title>
  <style>
    .error_class {
      border: 2px solid red !important;
    }
  </style>

</head>

<div class="container">
  <div class="row justify-content-center">
    <div class="col-md-8">
      <div class="card">
        <div class="card-body">

          <h1>Регистрация на конференцию</h1>

          <form action="/forms" method="POST">
            @csrf
            <div class="form-group">
              <label for="name">Имя</label>
              <input type="text" name="name" class="form-control @error('name') error_class @enderror" id="name" aria-describedby="nameHelp" placeholder="Иван" value="{{old('name')}}">

              @error('name')
              <small class="text-danger">{{ $errors->first('name')}}</small>
              @enderror
            </div>

            <div class="form-group">
              <label for="lastname">Фамилия</label>
              <input type="text" name="lastname" class="form-control @error('lastname') error_class @enderror" id="lastname" aria-describedby="lastnameHelp" placeholder="Иванов" value="{{old('lastname')}}">

              @error('lastname')
              <small class="text-danger">{{ $errors->first('lastname')}}</small>
              @enderror
            </div>

            <div class="form-group">
              <label for="email">Электронная почта</label>
              <input type="email" name="email" class="form-control @error('email') error_class @enderror" id="email" aria-describedby="emailHelp" placeholder="mymail@example.com" value="{{old('email')}}">

              @error('email')
              <small class="text-danger">{{ $errors->first('email')}}</small>
              @enderror
            </div>

            <div class="form-group">
              <label for="phone">Номер телефона</label>
              <input type="phone" name="phone" class="form-control @error('phone') error_class @enderror" id="phone" aria-describedby="phoneHelp" placeholder="89876547890" value="{{old('phone')}}">

              @error('phone')
              <small class="text-danger">{{ $errors->first('phone')}}</small>
              @enderror
            </div>

            <div class="form-group">
              <label for="section">Секция</label>
              <input type="text" name="section" class="form-control @error('section') error_class @enderror" id="section" aria-describedby="sectionHelp" placeholder="Литература, математика, информационные технологии и т.п." value="{{old('section')}}">

              @error('section')
              <small class="text-danger">{{ $errors->first('section')}}</small>
              @enderror


            </div>
            <button type="submit" class="btn btn-primary">Отправить</button>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>

</body>

</html>
@endsection