@extends('clientarea.profile.layout')

@section('profile-content')
<div class="card shadow-sm border-0">
    <div class="card-header">
        <h5 class="mb-0"><i class="fas fa-shield-alt me-2"></i>{{ __('store/two-factor.confirm_title') }}</h5>
    </div>
    <div class="card-body">
        <p class="text-muted">
            {{ __('store/two-factor.channel_confirm_description', ['method' => __('store/two-factor.method_' . $method), 'target' => $maskedTarget]) }}
        </p>

        @if($errors->any())
            <div class="alert alert-danger">
                @foreach($errors->all() as $error)
                    <div>{{ $error }}</div>
                @endforeach
            </div>
        @endif

        <form method="POST" action="{{ route('store.auth.profile.two-factor.confirm') }}">
            @csrf

            <div class="mb-3">
                <label for="code" class="form-label">{{ __('store/two-factor.enter_code') }} <span class="text-danger">*</span></label>
                <input type="text" class="form-control @error('code') is-invalid @enderror"
                       id="code" name="code" maxlength="6" autocomplete="one-time-code"
                       inputmode="numeric" placeholder="000000" autofocus>
                @error('code')
                    <div class="invalid-feedback">{{ $message }}</div>
                @enderror
            </div>

            <div class="d-flex gap-2">
                <button type="submit" class="btn btn-primary">
                    <i class="fas fa-check me-1"></i>{{ __('store/two-factor.confirm_and_enable') }}
                </button>
                <a href="{{ route('store.auth.profile.security') }}" class="btn btn-outline-secondary">
                    {{ __('store/two-factor.cancel') }}
                </a>
            </div>
        </form>
    </div>
</div>
@endsection
