<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8"/>
  <meta name="viewport" content="width=device-width,initial-scale=1.0"/>
  <title>Admin Login — Collnetwork</title>
  <link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;700;800;900&family=Space+Mono:wght@700&display=swap" rel="stylesheet">
  <style>
    *,*::before,*::after{margin:0;padding:0;box-sizing:border-box;}
    body{font-family:'Nunito',sans-serif;min-height:100vh;
      background:radial-gradient(ellipse 80% 70% at 20% 20%,rgba(59,31,110,0.9) 0%,#0a0515 60%),
                 radial-gradient(ellipse 60% 60% at 80% 80%,rgba(34,197,94,0.12) 0%,transparent 55%);
      display:flex;align-items:center;justify-content:center;padding:24px;}
    .card{background:rgba(35,21,69,0.95);border:1px solid rgba(155,109,206,0.25);
      border-radius:22px;padding:40px 38px;width:100%;max-width:400px;
      box-shadow:0 30px 80px rgba(0,0,0,0.6);}
    .logo-wrap{text-align:center;margin-bottom:28px;}
    .logo-circle{width:64px;height:64px;border-radius:16px;
      background:linear-gradient(135deg,#22c55e,#6b3fa0);
      display:inline-flex;align-items:center;justify-content:center;
      margin-bottom:12px;overflow:hidden;}
    .logo-circle img{width:100%;height:100%;object-fit:contain;padding:8px;}
    h1{color:white;font-size:22px;font-weight:900;margin-bottom:4px;}
    .sub{color:rgba(155,109,206,0.8);font-size:13px;}
    .flash{padding:11px 15px;border-radius:9px;margin-bottom:18px;font-size:13px;font-weight:700;
      background:rgba(239,68,68,0.1);border:1px solid rgba(239,68,68,0.3);color:#fca5a5;}
    .form-group{margin-bottom:16px;}
    label{display:block;font-size:11px;font-weight:700;color:#9b8ab8;
      text-transform:uppercase;letter-spacing:0.8px;margin-bottom:6px;}
    .input-wrap{position:relative;}
    .input-wrap .icon{position:absolute;left:13px;top:50%;transform:translateY(-50%);font-size:16px;}
    input{width:100%;padding:12px 14px 12px 40px;
      background:rgba(59,31,110,0.4);border:2px solid rgba(155,109,206,0.25);
      border-radius:10px;color:#e2d9f3;font-family:'Nunito',sans-serif;
      font-size:14px;font-weight:600;outline:none;transition:border-color 0.2s;}
    input:focus{border-color:#9b6dce;}
    input::placeholder{color:rgba(155,109,206,0.5);font-weight:400;}
    .submit-btn{width:100%;padding:13px;margin-top:8px;
      background:linear-gradient(135deg,#16a34a,#22c55e);
      color:white;border:none;border-radius:12px;
      font-family:'Nunito',sans-serif;font-size:15px;font-weight:800;
      cursor:pointer;box-shadow:0 6px 20px rgba(34,197,94,0.3);
      transition:transform 0.2s,box-shadow 0.2s;}
    .submit-btn:hover{transform:translateY(-2px);box-shadow:0 10px 28px rgba(34,197,94,0.4);}
    .footer-note{text-align:center;margin-top:20px;font-size:12px;color:rgba(155,109,206,0.5);}
  </style>
</head>
<body>
  <div class="card">
    <div class="logo-wrap">
      <div class="logo-circle">
        <img src="/static/images/logo.png" alt="Logo" onerror="this.style.display='none'">
      </div>
      <h1>Admin Login</h1>
      <div class="sub">Collnetwork WiFi Management</div>
    </div>

    {% with messages = get_flashed_messages(with_categories=true) %}
      {% for cat, msg in messages %}
        <div class="flash">⚠️ {{ msg }}</div>
      {% endfor %}
    {% endwith %}

    <form method="POST" action="/admin/login">
      <div class="form-group">
        <label>Username</label>
        <div class="input-wrap">
          <span class="icon">👤</span>
          <input type="text" name="username" placeholder="Admin username" required autocomplete="off"/>
        </div>
      </div>
      <div class="form-group">
        <label>Password</label>
        <div class="input-wrap">
          <span class="icon">🔒</span>
          <input type="password" name="password" placeholder="Admin password" required/>
        </div>
      </div>
      <button type="submit" class="submit-btn">🔐 &nbsp;Sign In</button>
    </form>
    <div class="footer-note">Collnetwork Technology LTD &nbsp;·&nbsp; Restricted Access</div>
  </div>
</body>
</html>
