/* ============================================
   login.css - 登录页样式
   ============================================ */

:root {
  --primary: #002b5c;
  --primary-dark: #001736;
  --accent: #fea619;
  --text-main: #191c1d;
  --text-sub: #43474f;
  --bg-page: #f8f9fa;
  --border: #c4c6d0;
}

/* 登录页布局：头部/搜索/页脚完全使用 style.css，此处仅写登录区样式 */
body.login-page {
  background: var(--bg-page, #f8f9fa);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============== LOGIN MAIN ============== */
.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 16px 48px;
}
.login-card {
  background: #fff; border: 1px solid #f3f4f6; border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  width: 450px; max-width: 100%; padding: 40px 40px 48px;
  display: flex; flex-direction: column; gap: 0;
}

/* 登录切换 */
.login-tabs {
  display: flex;
  align-items: stretch;
  background: #f3f4f6;
  border-radius: 9999px;
  padding: 4px;
  margin-bottom: 28px;
}

.login-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.login-tab:hover { color: var(--primary); }

.login-tab.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.login-panel[hidden] { display: none !important; }

.login-title {
  font-size: 24px; font-weight: 700; color: var(--primary);
  text-align: center; margin-bottom: 28px;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

/* 手机号输入框 */
.phone-input-group {
  display: flex; align-items: center;
  background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 4px;
  padding: 11px 13px; gap: 0;
}
.phone-prefix {
  display: flex; align-items: center; gap: 4px;
  padding-right: 12px; border-right: 1px solid #d1d5db; flex-shrink: 0;
}
.phone-code { font-size: 14px; font-weight: 700; color: var(--primary); }
.phone-arrow { font-size: 10px; color: #9ca3af; }
.phone-number-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 14px; font-weight: 500; color: #6b7280; padding: 2px 0 2px 12px;
}
.phone-number-input::placeholder { color: #9ca3af; }

/* 验证码行 */
.sms-input-group {
  display: flex; align-items: center;
  background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 4px;
  padding: 11px 13px; gap: 8px;
}
.sms-code-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 14px; font-weight: 500; color: #6b7280; padding: 2px 0;
}
.sms-code-input::placeholder { color: #9ca3af; }
.btn-get-sms {
  background: none; border: none; cursor: pointer;
  font-size: 12px; font-weight: 700; color: #855300; white-space: nowrap;
  flex-shrink: 0; transition: opacity 0.2s;
}
.btn-get-sms:hover { opacity: 0.75; }
.btn-get-sms:disabled { opacity: 0.5; cursor: not-allowed; }

/* 登录按钮 */
.btn-login-submit {
  background: var(--primary); color: #fff; border: none; border-radius: 9999px;
  font-size: 16px; font-weight: 700; padding: 14px;
  cursor: pointer; width: 100%;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  transition: background 0.2s; margin-top: 0;
}
.btn-login-submit:hover { background: var(--primary-dark); }

/* 商家登录表单 */
.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field-label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.login-field-input {
  width: 100%;
  padding: 11px 13px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-field-input::placeholder { color: #9ca3af; }

.login-field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 43, 92, 0.08);
}

.login-merchant-register {
  margin: 12px 0 0;
  text-align: center;
  font-size: 14px;
  color: #6b7280;
}

.login-register-link {
  display: inline-block;
  margin-left: 4px;
  padding: 5px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fea619 0%, #f59e0b 100%);
  color: #fff !important;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(254, 166, 25, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.login-register-link:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(254, 166, 25, 0.45);
}

.login-merchant-forgot {
  margin: 16px 0 0;
  text-align: center;
}

.login-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
}

.login-link-btn:hover { text-decoration: underline; }

.login-sms-inline {
  padding: 0;
  border: none;
  background: transparent;
  gap: 10px;
}

.login-sms-inline .login-field-input {
  flex: 1;
}

.login-sms-inline .btn-get-sms {
  padding: 11px 0 11px 8px;
}

.login-merchant-tip {
  margin: 12px 0 0;
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
  line-height: 1.6;
}

/* 协议 */
.login-agreement { margin-top: 32px; }
.agreement-label {
  display: flex; align-items: flex-start; gap: 8px; cursor: pointer;
}
.agreement-check {
  width: 14px; height: 14px; border-radius: 9999px;
  border: 1px solid #d1d5db; flex-shrink: 0; margin-top: 2px;
  accent-color: var(--primary); cursor: pointer;
}
.agreement-text {
  font-size: 11px; font-weight: 500; color: #444653; line-height: 1.7;
}
.agreement-link {
  color: var(--primary); font-weight: 700;
}
.agreement-link:hover { text-decoration: underline; }

/* ============== Responsive ============== */
@media (max-width: 768px) {
  body.login-page.has-mobile-tabbar {
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  }

  body.login-page.has-mobile-tabbar .footer {
    display: none;
  }

  body.login-page .mobile-tabbar {
    display: flex;
  }

  .login-card { padding: 32px 24px; }
  .login-tab { font-size: 14px; padding: 10px 12px; }
  .login-main { padding-bottom: 24px; }
}

@media (max-width: 480px) {
  .login-card { width: 100%; padding: 24px 16px; border-radius: 12px; }
  .login-title { font-size: 22px; }
  .btn-login-submit { font-size: 15px; padding: 13px; }
  .agreement-text { font-size: 11px; }
}
