@extends('auth.layouts.guest')

@section('title', 'Set up 2FA')

@section('hero')
    <div class="mx-auto w-100" style="max-width: 34rem;">
        <a href="{{ route('website.home') }}" class="d-inline-block mb-4">
            <img src="{{ asset('kiyohr.png') }}" alt="KiyoHR logo" height="40" class="d-block">
        </a>
        <div class="login-feature-icon mb-4" style="width: 3.25rem; height: 3.25rem; font-size: 1.35rem;">
            <i class="bi bi-shield-lock"></i>
        </div>
        <h1 class="display-6 fw-bold mb-3">Security required</h1>
        <p class="text-muted mb-0">Your organization requires two-factor authentication. Choose how you want to verify sign-in.</p>
    </div>
@endsection

@section('content')
    <div class="text-center text-lg-start mb-4">
        <p class="text-uppercase text-muted small fw-semibold mb-1" style="letter-spacing: 0.14em;">Enrollment</p>
        <h1 class="h3 fw-bold mb-1">Set up verification</h1>
        <p class="text-muted small mb-0">
            Signed in as <strong>{{ $userName ?? 'you' }}</strong>.
            @if(($defaultMethod ?? 'email') === 'totp')
                Your company prefers an <strong>authenticator app</strong>.
            @else
                Your company allows <strong>email codes</strong> or an authenticator app.
            @endif
        </p>
    </div>

    <div class="d-flex flex-column gap-3">
        <form action="{{ route('two-factor.enroll.email') }}" method="POST">
            @csrf
            <button type="submit" class="btn btn-kiyo w-100 login-submit-btn d-inline-flex align-items-center justify-content-center gap-2">
                <i class="bi bi-envelope-check"></i> Use email OTP
            </button>
            <p class="mt-2 mb-0 text-center text-muted small">We&apos;ll email a code each time you sign in.</p>
        </form>

        <form action="{{ route('two-factor.enroll.totp') }}" method="POST">
            @csrf
            <button type="submit" class="btn btn-outline-secondary w-100 login-submit-btn d-inline-flex align-items-center justify-content-center gap-2">
                <i class="bi bi-phone"></i> Use authenticator app
            </button>
            <p class="mt-2 mb-0 text-center text-muted small">Google Authenticator, Microsoft Authenticator, etc.</p>
        </form>
    </div>

    <p class="text-center mt-4 mb-0">
        <a href="{{ route('login') }}" class="small text-muted text-decoration-none">Back to login</a>
    </p>
@endsection
