@extends('student.layouts.app') @section('title', app()->getLocale() === 'ar' ? 'أمان الحساب' : 'Account Security') @section('content') @php $isArabic = app()->getLocale() === 'ar'; $twoFactorLabel = match($student->two_factor_method) { 'email' => $isArabic ? 'رمز عبر البريد الإلكتروني' : 'Email Code', 'authenticator' => $isArabic ? 'تطبيق المصادقة' : 'Authenticator App', default => $isArabic ? 'غير مفعل' : 'Disabled', }; @endphp

{{ $isArabic ? 'أمان الحساب' : 'Account Security' }}

{{ $isArabic ? 'غيّر كلمة المرور، راجع حالة البريد، واختر طريقة التحقق الثنائي المناسبة. الصفحة مبسطة وتعرض كل ما تحتاجه بوضوح.' : 'Change your password, review your email status, and choose the right two-factor method. This page is simplified and keeps everything clear.' }}

{{ $isArabic ? 'حالة البريد' : 'Email Status' }}
{{ $student->hasVerifiedEmail() ? ($isArabic ? 'موثق' : 'Verified') : ($isArabic ? 'بانتظار التحقق' : 'Pending') }}
{{ $isArabic ? 'التحقق الثنائي' : 'Two-Factor' }}
{{ $twoFactorLabel }}
{{ $isArabic ? 'البريد الحالي' : 'Current Email' }}
{{ $student->email }}

{{ $isArabic ? 'تغيير كلمة المرور' : 'Change Password' }}

{{ $isArabic ? 'استخدم كلمة مرور قوية تحتوي على أحرف كبيرة وصغيرة وأرقام ورموز.' : 'Use a strong password with uppercase, lowercase, numbers, and symbols.' }}

@csrf
@error('current_password')
{{ $message }}
@enderror
@error('new_password')
{{ $message }}
@enderror
{{ $isArabic ? 'بعد تحديث كلمة المرور استخدمها مباشرة في المرات القادمة لتسجيل الدخول.' : 'Use the new password for your future sign-ins immediately after updating it.' }}

{{ $isArabic ? 'التحقق الثنائي' : 'Two-Factor Authentication' }}

{{ $isArabic ? 'اختر طريقة الحماية الإضافية المناسبة لك عند تسجيل الدخول.' : 'Choose the additional protection method you want during sign in.' }}

@csrf
{{ $isArabic ? 'بدون تحقق ثنائي' : 'No Two-Factor' }}

{{ $isArabic ? 'الدخول بكلمة المرور فقط.' : 'Sign in using password only.' }}

@csrf
{{ $isArabic ? 'رمز عبر البريد الإلكتروني' : 'Email Code' }}

{{ $isArabic ? 'إرسال رمز 6 أرقام إلى بريدك عند تسجيل الدخول.' : 'Send a 6-digit code to your email on sign in.' }}

@csrf
{{ $isArabic ? 'تطبيق المصادقة' : 'Authenticator App' }}

{{ $isArabic ? 'استخدم تطبيق يولد رمزاً متغيراً كل 30 ثانية.' : 'Use an app that generates a rotating code every 30 seconds.' }}

@if ($student->two_factor_method === 'authenticator' && $student->two_factor_secret)
{{ $isArabic ? 'المفتاح السري' : 'Secret Key' }}
{{ $student->two_factor_secret }}
@if ($otpAuthUrl)
{{ $isArabic ? 'رابط الإعداد للتطبيق' : 'App Setup URI' }}
{{ $otpAuthUrl }}
@endif
@csrf
{{ $isArabic ? 'تأكيد التطبيق' : 'Confirm Authenticator' }}

{{ $isArabic ? 'أدخل أول رمز من التطبيق لتفعيل التحقق الثنائي.' : 'Enter the first code from the app to enable two-factor authentication.' }}

@error('authenticator_code')
{{ $message }}
@enderror
@endif
@endsection