@extends('layouts.app')

@section('title', __('app.enable_2fa'))
@section('page_title', __('app.enable_2fa'))

@section('content')
<div class="container-fluid">
    <div class="row">
        <div class="col-md-6">
            <div class="card">
                <div class="card-header">
                    <h3 class="card-title">{{ __('app.enable_2fa') }}</h3>
                </div>
                <div class="card-body text-center">
                    <p>{{ __('app.scan_qr_code') }}</p>
                    
                    <div class="mb-4">
                        {!! $qrCodeSvg !!}
                    </div>
                    
                    <div class="alert alert-secondary">
                        <strong>Secret:</strong> {{ $secret }}
                        <br><small>{{ __('app.enter_code_from_app') }}</small>
                    </div>
                    
                    <form action="{{ route('2fa.confirm') }}" method="POST">
                        @csrf
                        <div class="form-group">
                            <input type="text" name="code" class="form-control @error('code') is-invalid @enderror" placeholder="000000" maxlength="6" required>
                            @error('code')
                                <span class="invalid-feedback">{{ $message }}</span>
                            @enderror
                        </div>
                        <button type="submit" class="btn btn-primary">{{ __('app.verify_and_enable') }}</button>
                        <a href="{{ route('2fa.settings') }}" class="btn btn-secondary">{{ __('app.cancel') }}</a>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
