<!--pages/login/login.wxml-->
<view class="login-container">
  <view class="login-header">
    <view class="logo">
      <image src="/images/logo.png" class="logo-img" />
    </view>
    <view class="title">银行管理系统</view>
    <view class="subtitle">Bank Management System</view>
  </view>

  <view class="login-form">
    <view class="form-item">
      <input
        value="{{username}}"
        type="text"
        placeholder="请输入用户名"
        class="input"
        bindinput="onUsernameInput"
      />
    </view>
    
    <view class="form-item">
      <input
        value="{{password}}"
        type="{{showPassword ? 'text' : 'password'}}"
        placeholder="请输入密码"
        class="input"
        bindinput="onPasswordInput"
      />
      <view class="password-toggle" bindtap="togglePassword">
        <text class="toggle-icon">{{showPassword ? '👁️' : '👁️‍🗨️'}}</text>
      </view>
    </view>

    <view class="form-item remember-item">
      <label class="remember-label">
        <checkbox 
          checked="{{rememberMe}}" 
          bindchange="onRememberMeChange"
          class="remember-checkbox"
        />
        <text class="remember-text">记住我</text>
      </label>
    </view>

    <view class="form-item">
      <button
        class="login-btn {{(!username || !password || loading) ? 'disabled' : ''}}"
        disabled="{{!username || !password || loading}}"
        bindtap="handleLogin"
      >
        {{loading ? '登录中...' : '登录'}}
      </button>
    </view>

    <view class="login-tips">
      <text class="tips-text">默认账号：admin / 123456</text>
      <view class="quick-login" bindtap="quickLogin">
        <text class="quick-login-text">快速登录</text>
      </view>
    </view>
  </view>

  <view class="login-footer">
    <text class="footer-text">© 2024 银行管理系统</text>
  </view>
</view>
