<!DOCTYPE html>
<html lang="<%= lang || 'id' %>">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title><%= t('tech.login_title', 'Login Teknisi') %> - <%= company %>
  </title>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css" rel="stylesheet">
  <style>
    body {
      background-color: #0f172a;
      color: #f8fafc;
      height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    }

    .login-card {
      background: #1e293b;
      border-radius: 20px;
      padding: 30px;
      width: 90%;
      max-width: 400px;
      box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    }

    .form-control {
      background: #0f172a;
      border: 1px solid #334155;
      color: white;
      padding: 12px;
      border-radius: 12px;
    }

    .form-control:focus {
      background: #0f172a;
      color: white;
      border-color: #3b82f6;
      box-shadow: none;
    }

    .btn-login {
      background: #3b82f6;
      color: white;
      border: none;
      padding: 12px;
      border-radius: 12px;
      width: 100%;
      font-weight: 600;
      margin-top: 10px;
    }

    .brand-icon {
      font-size: 40px;
      color: #3b82f6;
      margin-bottom: 10px;
    }
  </style>
</head>

<body>
  <div class="login-card text-center">
    <div class="brand-icon"><i class="bi bi-tools"></i></div>
    <h3 class="mb-1 fw-bold"><%= t('tech.portal_title', 'Portal Teknisi') %></h3>
    <p class="text-secondary mb-4 small">
      <%= company %>
    </p>

    <% if (error) { %>
      <div class="alert alert-danger py-2 small rounded-3">
        <%= error %>
      </div>
      <% } %>

        <form method="POST" action="/tech/login">
          <div class="mb-3 text-start">
            <label class="form-label text-secondary small mb-1">Username Teknisi</label>
            <input type="text" name="username" class="form-control" required placeholder="Masukkan username">
          </div>
          <div class="mb-4 text-start">
            <label class="form-label text-secondary small mb-1">Password</label>
            <input type="password" name="password" class="form-control" required placeholder="Masukkan password">
          </div>
          <button type="submit" class="btn btn-login"><i class="bi bi-box-arrow-in-right me-2"></i> Masuk</button>
        </form>
  </div>
</body>

</html>
