<?php $__template->layout('Layout.auth'); ?>
<?php $__template->section('title'); ?>تغيير كلمة المرور<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<h2 style="text-align:center;color:#1A1A2E;margin-bottom:20px;font-size:18px;">تغيير كلمة المرور</h2>
<?php
$employee = \App\Core\App::getInstance()->currentEmployee();
$forceChange = $employee && $employee->force_password_change;
?>
<?php if ($forceChange): ?>
    <p style="color:#D97706;text-align:center;margin-bottom:20px;font-size:14px;">يجب تغيير كلمة المرور قبل المتابعة</p>
<?php endif; ?>
<form method="POST" action="/change-password">
    <?= csrf_field() ?>
    <?php if (!$forceChange): ?>
    <div class="form-group" style="margin-bottom:20px;">
        <label for="current_password" class="form-label" style="display:block;margin-bottom:6px;font-weight:600;">كلمة المرور الحالية</label>
        <input type="password" id="current_password" name="current_password" class="form-input" style="width:100%;padding:10px 14px;border:1px solid #E5E7EB;border-radius:6px;" required>
    </div>
    <?php endif; ?>
    <div class="form-group" style="margin-bottom:20px;">
        <label for="new_password" class="form-label" style="display:block;margin-bottom:6px;font-weight:600;">كلمة المرور الجديدة</label>
        <input type="password" id="new_password" name="new_password" class="form-input" style="width:100%;padding:10px 14px;border:1px solid #E5E7EB;border-radius:6px;" required minlength="8">
    </div>
    <div class="form-group" style="margin-bottom:20px;">
        <label for="new_password_confirmation" class="form-label" style="display:block;margin-bottom:6px;font-weight:600;">تأكيد كلمة المرور</label>
        <input type="password" id="new_password_confirmation" name="new_password_confirmation" class="form-input" style="width:100%;padding:10px 14px;border:1px solid #E5E7EB;border-radius:6px;" required>
    </div>
    <button type="submit" class="btn btn-primary" style="width:100%;padding:12px;background:#0D7377;color:#fff;border:none;border-radius:6px;font-size:16px;font-weight:600;cursor:pointer;">
        تغيير كلمة المرور
    </button>
    <?php if (!$forceChange): ?>
    <a href="/" style="display:block;text-align:center;margin-top:15px;color:#6B7280;font-size:14px;">← العودة</a>
    <?php endif; ?>
</form>
<?php $__template->endSection(); ?>