<x-auth-layout title="Sign in" subtitle="Enter your credentials to access your dashboard.">
    <form method="POST" action="{{ route('login') }}">
        @csrf

        <div class="mb-3">
            <label for="company_code" class="form-label fw-semibold">Company Code</label>
            <input id="company_code" type="text" name="company_code" value="{{ old('company_code') }}" required autofocus
                   class="form-control @error('company_code') is-invalid @enderror">
            <div class="form-text">Your company's login code. Super Admins use 123.</div>
            @error('company_code')
                <div class="invalid-feedback">{{ $message }}</div>
            @enderror
        </div>

        <div class="mb-3">
            <label for="username" class="form-label fw-semibold">Username</label>
            <input id="username" type="text" name="username" value="{{ old('username') }}" required autocomplete="username"
                   class="form-control @error('username') is-invalid @enderror">
            @error('username')
                <div class="invalid-feedback">{{ $message }}</div>
            @enderror
        </div>

        <div class="mb-3">
            <label for="password" class="form-label fw-semibold">Password</label>
            <input id="password" type="password" name="password" required autocomplete="current-password"
                   class="form-control @error('password') is-invalid @enderror">
            @error('password')
                <div class="invalid-feedback">{{ $message }}</div>
            @enderror
        </div>

        <div class="d-flex align-items-center justify-content-between mb-4">
            <div class="form-check">
                <input class="form-check-input" type="checkbox" name="remember" id="remember_me">
                <label class="form-check-label" for="remember_me">Remember me</label>
            </div>

            @if (Route::has('password.request'))
                <a href="{{ route('password.request') }}" class="small text-decoration-none">Forgot password?</a>
            @endif
        </div>

        <button type="submit" class="btn btn-dark w-100 py-2 fw-semibold">Sign in</button>

        @if (Route::has('register'))
            <p class="text-center text-muted small mt-4 mb-0">
                Don't have an account? <a href="{{ route('register') }}">Sign up</a>
            </p>
        @endif
    </form>
</x-auth-layout>
