@extends('layouts.auth')

@section('title', 'Sign in | ' . config('app.name'))

@section('content')
<div class="auth-card">
    <h1 class="auth-title">Welcome back</h1>
    <p class="auth-subtitle">Sign in to your account</p>

    @if(session('info'))
        <div class="auth-error" style="background:rgba(59,130,246,.1);border-color:rgba(59,130,246,.35);color:#93c5fd;">
            <i class="bi bi-info-circle-fill"></i>
            <span>{{ session('info') }}</span>
        </div>
    @endif

    @if($errors->any())
        <div class="auth-error">
            <i class="bi bi-exclamation-circle-fill"></i>
            <span>{{ $errors->first() }}</span>
        </div>
    @endif

    <form method="POST" action="{{ route('login.store') }}">
        @csrf

        <div class="form-group">
            <label class="form-label">Email</label>
            <input type="email" name="email" class="form-input" value="{{ old('email') }}" placeholder="you@example.com" required autofocus>
        </div>

        <div class="form-group">
            <label class="form-label">Password</label>
            <input type="password" name="password" class="form-input" placeholder="••••••••" required>
        </div>

        <div class="form-group">
            <label class="form-checkbox">
                <input type="checkbox" name="remember" value="true" checked>
                Remember me
            </label>
        </div>

        <button type="submit" class="btn-primary">Sign in</button>
    </form>
</div>
@endsection

@section('footer_link')
    Don't have an account? <a href="{{ route('register') }}">Create one</a>
@endsection
