*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f1117; --bg2: #161b27; --bg3: #1e2638;
  --border: #2a3650; --gold: #d4a843; --text: #e8eaf0;
  --muted: #7a8499; --danger: #e05a5a;
}
body {
  font-family: 'Sarabun', sans-serif; background: var(--bg); color: var(--text);
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 30% 30%, #1a2540 0%, #0f1117 70%);
  padding: 20px;
}
.login-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 16px;
  padding: 40px 32px; width: 100%; max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.logo-icon {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), #9a6f1a);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.login-logo h1 { font-size: 20px; font-family: 'Kanit'; color: var(--gold); line-height: 1.2; }
.login-logo p  { font-size: 12px; color: var(--muted); }
.alert {
  background: rgba(224,90,90,.15); border: 1px solid rgba(224,90,90,.4);
  color: var(--danger); border-radius: 8px; padding: 10px 14px;
  font-size: 13px; margin-bottom: 16px;
}
.form-group { margin-bottom: 16px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type="text"], input[type="password"] {
  width: 100%; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 11px 14px;
  font-size: 15px; font-family: 'Sarabun'; outline: none; transition: border .15s;
  -webkit-appearance: none;
}
input[type="text"]:focus, input[type="password"]:focus { border-color: var(--gold); }

/* ── Remember Me ─────────────────────────────────────── */
.remember-label {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; margin: 10px 0;
  user-select: none; -webkit-user-select: none;
}
.remember-label input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 17px; height: 17px; flex-shrink: 0;
  border: 1.5px solid #4a5568; border-radius: 4px;
  background: transparent;
  cursor: pointer; position: relative;
  transition: background .15s, border-color .15s;
  margin: 0;
}
.remember-label input[type="checkbox"]:checked {
  background: var(--gold); border-color: var(--gold);
}
.remember-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: 2px solid #0f1117;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}
.remember-text { font-size: 13px; color: var(--muted); }

button[type="submit"] {
  width: 100%; background: linear-gradient(135deg, var(--gold), #b8891e);
  color: #0f1117; border: none; border-radius: 8px;
  padding: 13px; font-size: 15px; font-family: 'Sarabun'; font-weight: 700;
  cursor: pointer; margin-top: 12px; -webkit-tap-highlight-color: transparent;
}
.hint { text-align: center; margin-top: 16px; font-size: 12px; color: var(--muted); }
#installBtn {
  display: none; width: 100%; margin-top: 16px;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); border-radius: 8px;
  padding: 10px; font-size: 13px; font-family: 'Sarabun';
  cursor: pointer; align-items: center; justify-content: center; gap: 6px;
}
