<!doctype html>
<html lang="ar" dir="rtl">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">

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

    $businessName = trim((string)($company->business_name ?? ''));
    if ($businessName === '') $businessName = config('app.name', 'Laundry Dashboard');

    $logoPath = trim((string)($company->logo_path ?? ''));
    $logoUrl  = $logoPath !== '' ? asset('storage/' . $logoPath) : asset('logo.png');
  ?>

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

  <style>
    :root{
      --bg:#f6f7fb;
      --card:#ffffff;
      --text:#0f172a;
      --muted:#64748b;
      --border:#e5e7eb;
      --shadow:0 14px 35px rgba(0,0,0,.08);

      /* ✅ روابط + تركيز (أزرق محايد) */
      --primary:#2563eb;
      --primaryHover:#1d4ed8;

      /* ✅ أزرار (أسود) */
      --btn:#111827;
      --btnHover:#0f172a;
      --btnText:#ffffff;

      --err:#b00020;
      --alertBg:#ffecec;
      --alertBorder:#f3b7b7;

      --link:var(--primary);
      --linkMuted:var(--muted);
      --focusRing:rgba(37,99,235,.18);
    }

    *{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:240px;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:var(--primary);
      box-shadow:0 0 0 3px var(--focusRing);
    }

    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{background:var(--primaryHover)}


    .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;
    }

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

    .note{
      color:var(--linkMuted);
      font-size:12px;
      margin-top:10px;
      line-height:1.6;
    }

    /* ✅ تحسين للجوال */
    @media (max-width: 480px){
      body{ padding:14px; }
      .card{ padding:16px; border-radius:14px; }
      .logo{ height:64px; }
      button{ padding:13px; font-size:16px; }
      input{ padding:13px; }
    }
  </style>
</head>

<body>
  <div class="card">

    <div class="logo-wrap">
      <a href="/" style="text-decoration:none;color:inherit">
        <img src="<?php echo e($logoUrl); ?>" alt="Logo" class="logo">
      </a>
      <div class="title"><?php echo e($businessName); ?></div>
      <div class="sub"><?php echo $__env->yieldContent('subtitle', 'تسجيل الدخول'); ?></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(session('status')): ?>
      <div class="alert" style="background:#ecfdf3;border-color:#bbf7d0;color:#166534;">
        <?php echo e(session('status')); ?>

      </div>
    <?php endif; ?>

    <?php if($errors->any()): ?>
      <?php
        // رسالة لطيفة بدل النص الافتراضي
        $msg = $errors->first();

        // أشهر رسالة عند فشل تسجيل الدخول في Laravel
        if (str_contains($msg, 'These credentials do not match our records') || str_contains($msg, 'بيانات الاعتماد')) {
          $msg = 'البريد الإلكتروني أو كلمة المرور غير صحيحة.';
        }
      ?>

      <div class="alert"><?php echo e($msg); ?></div>
    <?php endif; ?>

    
    <?php echo $__env->yieldContent('content'); ?>

  </div>
</body>
</html>
<?php /**PATH /home/mylaundry26/public_html/apps/billion/resources/views/layouts/guest.blade.php ENDPATH**/ ?>