@extends('layouts.app-mobile-partner')
@section('title', 'Partner Login — Befikreyy')
@section('apptitle', 'Partner Login')

@section('appheaderright')
<a href="{{ route('pa.splash') }}" class="ah-back" aria-label="Back">‹</a>
@endsection

@section('content')
<div class="auth-screen">
    <div class="auth-hero">
        <img src="/assets/brand/logo.png" alt="Befikreyy" class="auth-logo">
        <h2 class="auth-title">Partner sign in</h2>
        <p class="auth-sub">Login to manage your visits, accept jobs, and track your earnings.</p>
    </div>

    <div class="auth-card">
        @if($errors->any())
            <div class="app-alert app-alert-error">
                <span class="ic">!</span>
                <span>{{ $errors->first() }}</span>
            </div>
        @endif

        <form method="POST" action="{{ route('pa.login.attempt') }}" class="app-form">
            @csrf

            <div class="field-app">
                <label>Phone or Email</label>
                <input type="text" name="identifier" value="{{ old('identifier') }}" required autofocus
                    placeholder="9876543210 or you@example.com" inputmode="email" autocomplete="username">
                <span class="fa-hint">Use the phone or email you registered with</span>
            </div>

            <div class="field-app">
                <label>Password</label>
                <div class="pwd-wrap">
                    <input type="password" name="password" id="pwd" required minlength="4" autocomplete="current-password" placeholder="Your password">
                    <button type="button" class="pwd-toggle" onclick="var i=document.getElementById('pwd');i.type=i.type==='password'?'text':'password';this.textContent=i.type==='password'?'Show':'Hide'">Show</button>
                </div>
            </div>

            <label class="checkbox-app">
                <input type="checkbox" name="remember" checked>
                <span>Keep me logged in</span>
            </label>

            <button type="submit" class="btn-app btn-app-primary btn-app-full">Login</button>
        </form>

        <div class="auth-divider"><span>or</span></div>

        <a href="{{ route('pa.register') }}" class="btn-app btn-app-outline btn-app-full">Apply to become a partner</a>

        <div class="demo-accounts">
            <strong>Demo partner</strong>
            <span>rajesh@partner.befikreyy.com / partner123</span>
            <span>suresh@partner.befikreyy.com / partner123</span>
        </div>
    </div>

    <p class="auth-foot">By continuing you agree to our <a href="{{ route('terms') }}">Terms</a> &amp; <a href="{{ route('privacy') }}">Privacy</a>.</p>
</div>
@endsection