<!--pages/login/login.wxml-->
<view class="login-container">
  <!-- 页面头部 -->
  <view class="login-header">
    <!-- 顶部控制栏 -->
    <view class="header-controls">
      <view class="home-icon">🏠</view>
      <view class="window-controls">
        <view class="control-btn">⋯</view>
        <view class="control-btn">−</view>
        <view class="control-btn">◎</view>
      </view>
    </view>
    
    <!-- 语言选择 -->
    <view class="language-selector">
      <text class="language-text">简体中文</text>
      <text class="language-arrow">▼</text>
    </view>
  </view>

  <!-- 主要内容区域 -->
  <view class="main-content">
    <!-- 应用标题 -->
    <view class="app-title">爱农智慧牧场</view>
    
    <!-- 登录表单 -->
    <view class="login-form">
      <!-- 账号输入框 -->
      <view class="input-group">
        <view class="input-icon">👤</view>
        <input 
          class="form-input"
          placeholder="请输入账号"
          value="{{formData.username}}"
          bindinput="onInputChange"
          data-field="username"
        />
      </view>
      
      <!-- 密码输入框 -->
      <view class="input-group">
        <view class="input-icon">🔒</view>
        <input 
          class="form-input"
          placeholder="请输入密码"
          password="{{true}}"
          value="{{formData.password}}"
          bindinput="onInputChange"
          data-field="password"
        />
      </view>
      
      <!-- 登录按钮 -->
      <button 
        class="login-btn {{loading ? 'loading' : ''}}"
        bindtap="handleLogin"
        disabled="{{loading}}"
      >
        <text wx:if="{{!loading}}">登录</text>
        <text wx:else>登录中...</text>
      </button>
      
      <!-- 用户协议 -->
      <view class="agreement-section">
        <view class="checkbox-container" bindtap="toggleAgreement">
          <view class="custom-checkbox {{agreedToTerms ? 'checked' : ''}}">
            <text wx:if="{{agreedToTerms}}" class="checkmark">✓</text>
          </view>
          <text class="agreement-text">
            《用户服务协议》及《隐私政策》
          </text>
        </view>
      </view>
      
      <!-- 其他登录方式 -->
      <view class="alternative-login">
        <view class="alt-login-item" bindtap="onOneClickLogin">一键登录</view>
        <view class="alt-login-item" bindtap="onSmsLogin">短信登录</view>
        <view class="alt-login-item" bindtap="onRegister">注册账号</view>
        <view class="alt-login-item" bindtap="onOtherLogin">其它</view>
      </view>
    </view>
  </view>

  <!-- 页面底部 -->
  <view class="login-footer">
    <view class="footer-info">
      <text class="footer-text">生资监管方案</text>
      <text class="footer-text">绑定天翼账号</text>
    </view>
    
    <view class="disclaimer">
      <text class="disclaimer-text">
        说明:该系统仅对在小程序主体公司备案的客户开放
      </text>
    </view>
  </view>
</view>
