<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1">
@php
  $loginLogoSetting = \App\Models\CompanySetting::first();
  $loginLogoUrl = $loginLogoSetting?->logo_path ? asset('storage/'.$loginLogoSetting->logo_path) : asset('images/logo.svg');
@endphp
<title>Login — JPN Helpdesk</title>
<link rel="icon" type="image/svg+xml" href="{{ asset('images/favicon.svg') }}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/css/bootstrap.min.css">
<style>
body{background:linear-gradient(135deg,#1e2a3b 0%,#1a56db 100%);min-height:100vh;display:flex;align-items:center;justify-content:center}
.login-box{background:#fff;border-radius:16px;padding:40px;width:100%;max-width:400px;box-shadow:0 20px 60px rgba(0,0,0,.3)}
.brand-icon{width:60px;height:60px;background:#1a56db;border-radius:12px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:24px;font-weight:700;margin:0 auto 16px}
</style>
</head>
<body>
<div class="login-box">
  <div class="text-center mb-4">
    <img src="{{ $loginLogoUrl }}" alt="Logo" style="width:80px;height:auto;margin:0 auto 16px;display:block;">
    <h5 class="fw-bold mb-1">JPN Helpdesk</h5>
    <p class="text-muted small">Masuk ke panel admin</p>
  </div>
  @if($errors->any())
    <div class="alert alert-danger small">{{ $errors->first() }}</div>
  @endif
  <form action="{{ route('login.post') }}" method="POST">
    @csrf
    <div class="mb-3">
      <label class="form-label fw-semibold">Email</label>
      <input type="email" name="email" class="form-control" value="{{ old('email') }}" required autofocus>
    </div>
    <div class="mb-3">
      <label class="form-label fw-semibold">Password</label>
      <input type="password" name="password" class="form-control" required>
    </div>
    <div class="mb-3 form-check">
      <input type="checkbox" name="remember" class="form-check-input" id="remember">
      <label class="form-check-label" for="remember">Ingat saya</label>
    </div>
    <button type="submit" class="btn btn-primary w-100 fw-semibold">Masuk</button>
  </form>
  <hr>
  <p class="text-center small text-muted mb-0"><a href="{{ route('client.login') }}">Login sebagai Client</a></p>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/js/bootstrap.bundle.min.js"></script>
</body>
</html>
