@extends('portal.auth.layout')

@section('content')
@php $title = 'Sign in'; @endphp
<h1>Sign in</h1>
<p class="lead">Access your organisation, events, and billing in My MeXCo.</p>

@if(session('error'))
    <div class="alert-flash alert-danger">{{ session('error') }}</div>
@endif
@if(session('success'))
    <div class="alert-flash alert-success">{{ session('success') }}</div>
@endif

<form method="POST" action="{{ route('mexco.login.submit') }}">
    @csrf
    <div class="field">
        <label class="form-label" for="email">Email</label>
        <input class="form-input" type="email" name="email" id="email" value="{{ old('email') }}" required autofocus autocomplete="email" placeholder="you@organisation.com">
        @error('email')<div class="form-error">{{ $message }}</div>@enderror
    </div>
    <div class="field">
        <label class="form-label" for="password">Password</label>
        <input class="form-input" type="password" name="password" id="password" required autocomplete="current-password" placeholder="Your password">
    </div>
    <button type="submit" class="btn-purple auth-submit">Sign in</button>
</form>

<p class="foot">
    New to MeXCo? <a href="{{ route('mexco.register') }}">Create account</a>
</p>
@endsection

@section('after_card')
    <a href="{{ route('mexco.home') }}" class="auth-home">← Back to website</a>
@endsection
