{% extends "layouts/auth.twig" %}

{% block title %}Sign Up{% endblock %}

{% block content %}
    <div class="page page-center">
      <div class="container container-tight py-4">
        <div class="text-center mb-4">
          <a href="." class="navbar-brand navbar-brand-autodark"><img src="./static/logo-bw.svg" height="36" alt=""></a>
          {% include 'partials/flash.twig' %}
        </div>
        <form class="card card-md" action="{{ route('register') }}" name="register" method="post" autocomplete="off" novalidate>
        {{ csrf.field | raw }}
		  <div class="card-body">
            <h2 class="card-title text-center mb-4">Create new account</h2>
            <div class="mb-3">
              <label class="form-label">User Name</label>
              <input type="text" name="username" value="{{ old.username }}" class="form-control{{ errors.name ? ' is-invalid' : '' }}" placeholder="Enter name">
		{% if errors.username %}
		      <small class="form-hint">{{ errors.username | first }}</small>
		{% endif %}
            </div>
            <div class="mb-3">
              <label class="form-label">Email address</label>
              <input type="email" name="email" value="{{ old.email }}" class="form-control{{ errors.email ? ' is-invalid' : '' }}" placeholder="Enter email">
		{% if errors.email %}
		      <small class="form-hint">{{ errors.email | first }}</small>
		{% endif %}
            </div>
            <div class="mb-3">
              <label class="form-label">Password</label>
              <div class="input-group input-group-flat">
                <input type="password" name="password" class="form-control{{ errors.password ? ' is-invalid' : '' }}"  placeholder="Password"  autocomplete="off">
                <span class="input-group-text">
                  <a href="#" class="link-secondary" title="Show password" data-bs-toggle="tooltip"><!-- Download SVG icon from http://tabler-icons.io/i/eye -->
                    <svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><circle cx="12" cy="12" r="2" /><path d="M22 12c-2.667 4.667 -6 7 -10 7s-7.333 -2.333 -10 -7c2.667 -4.667 6 -7 10 -7s7.333 2.333 10 7" /></svg>
                  </a>
                </span>
		{% if errors.password %}
		    <small class="form-hint">{{ errors.password | first }}</small>
		{% endif %}
              </div>
            </div>
            <div class="mb-3">
              <label class="form-check">
                <input type="checkbox" value="" id="flexCheckChecked" class="form-check-input"/>
                <span class="form-check-label">Agree the <a href="./terms-of-service.html" tabindex="-1">terms and policy</a>.</span>
              </label>
            </div>
            <div class="form-footer">
              <button type="submit" class="btn btn-primary w-100">Create new account</button>
            </div>
          </div>
        </form>
        <div class="text-center text-muted mt-3">
          Already have account? <a href="{{ route('login') }}" tabindex="-1">Sign in</a>
        </div>
      </div>
    </div>
{% endblock %}
