<!doctype html>
<html lang="ar" dir="rtl">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <?php
    // ✅ جلب بيانات الشركة من السجل الوحيد id=1
    $company = \Illuminate\Support\Facades\DB::table('company_settings')->where('id', 1)->first();

    $businessName = trim((string)($company->business_name ?? ''));
    if ($businessName === '') $businessName = 'Laundry Dashboard';

    $logoPath = trim((string)($company->logo_path ?? ''));
    // إذا عندك شعار مخزن في storage/app/public/.. راح يظهر بهذا المسار
    $logoUrl = $logoPath !== '' ? asset('storage/' . $logoPath) : asset('logo.png');
  ?>

  <title><?php echo e($businessName); ?> - تسجيل الدخول</title>

  <style>
    :root{
      --bg:#f6f7fb;
      --card:#ffffff;
      --text:#111827;
      --muted:#6b7280;
      --border:#e5e7eb;
      --shadow:0 14px 35px rgba(0,0,0,.08);
      --btn:#111827;
      --btnText:#ffffff;
      --err:#b00020;
      --alertBg:#ffecec;
      --alertBorder:#f3b7b7;
      --link:#111827;
      --linkMuted:#6b7280;
    }

    *{box-sizing:border-box}

    body{
      font-family:Arial, sans-serif;
      margin:0;
      min-height:100vh;
      background:var(--bg);
      color:var(--text);
      display:flex;
      align-items:center;
      justify-content:center;
      padding:22px;
    }

    .card{
      width:100%;
      max-width:420px;
      margin:auto;
      background:var(--card);
      padding:22px;
      border-radius:16px;
      border:1px solid var(--border);
      box-shadow:var(--shadow);
    }

    .logo-wrap{text-align:center;margin-bottom:18px}
    .logo{height:72px;max-width:220px;object-fit:contain;margin-bottom:10px}
    .title{font-weight:900;font-size:18px}
    .sub{color:var(--muted);font-size:13px;margin-top:4px}

    label{
      display:block;
      font-weight:800;
      font-size:13px;
      color:var(--muted);
      margin-top:10px;
      margin-bottom:6px;
    }

    input{
      width:100%;
      padding:12px 12px;
      margin:0 0 10px 0;
      border:1px solid var(--border);
      border-radius:12px;
      font-size:14px;
      outline:none;
      background:#fff;
    }

    input:focus{
      border-color:#9ca3af;
      box-shadow:0 0 0 3px rgba(156,163,175,.25);
    }

    button{
      width:100%;
      padding:12px;
      border:0;
      border-radius:12px;
      background:var(--btn);
      color:var(--btnText);
      cursor:pointer;
      font-weight:900;
      font-size:15px;
      margin-top:6px;
    }
    button:hover{opacity:.95}

    .err{color:var(--err);margin:10px 0;font-weight:900}

    .alert{
      margin:12px 0;
      padding:10px;
      border-radius:12px;
      border:1px solid var(--alertBorder);
      background:var(--alertBg);
      color:var(--err);
      font-weight:900;
    }

    .small{
      font-size:13px;
      color:#555;
      display:flex;
      align-items:center;
      gap:8px;
      margin:8px 0 6px 0;
      user-select:none;
    }
    .small input{width:auto;margin:0}

    .formTools{
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap:10px;
      margin:8px 0 2px 0;
      flex-wrap:wrap;
    }

    .forgotLink{
      font-weight:900;
      font-size:13px;
      color:var(--link);
      text-decoration:underline;
      cursor:pointer;
      white-space:nowrap;
    }
    .forgotLink:hover{opacity:.9}

    .note{
      color:var(--linkMuted);
      font-size:12px;
      margin-top:10px;
      line-height:1.6;
    }
  </style>
</head>
<body>
  <div class="card">

    <div class="logo-wrap">
      
      <img src="<?php echo e($logoUrl); ?>" alt="Logo" class="logo">

      
      <div class="title"><?php echo e($businessName); ?></div>

      <div class="sub">تسجيل الدخول</div>
    </div>

    
    <?php if(session('error')): ?>
      <div class="alert"><?php echo e(session('error')); ?></div>
    <?php endif; ?>

    <?php if(session('ok')): ?>
      <div class="alert" style="background:#ecfdf3;border-color:#bbf7d0;color:#166534;"><?php echo e(session('ok')); ?></div>
    <?php endif; ?>

    <?php if($errors->any()): ?>
      <div class="err"><?php echo e($errors->first()); ?></div>
    <?php endif; ?>

    <form method="POST" action="/login">
      <?php echo csrf_field(); ?>

      <label>البريد الإلكتروني</label>
      <input type="email" name="email" value="<?php echo e(old('email')); ?>" required autofocus>

      <label>كلمة المرور</label>
      <input type="password" name="password" required>

      <div class="formTools">
        <label class="small" style="margin:0">
          <input type="checkbox" name="remember" value="1"> تذكرني
        </label>

        <a class="forgotLink" href="<?php echo e(route('password.request')); ?>">نسيت كلمة المرور؟</a>
      </div>

      <button type="submit">دخول</button>

      <div class="note">
        سيتم إرسال رابط إعادة التعيين إلى بريدك الإلكتروني.
      </div>
    </form>

  </div>
</body>
</html>
<?php /**PATH /home/ksaad26/laravel/laundry-dashboard/resources/views/auth/login.blade.php ENDPATH**/ ?>