/* 登录模态框样式 */
.login-modal {
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 模态框内容区域，直接复用 .login-container 的样式 */
.login-modal-content {
    position: relative;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 450px; /* 调整最大宽度以适应模态框 */
    animation: slideIn 0.3s ease;
    padding: 30px; /* 增加内边距 */
}

@keyframes slideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.login-modal-content .login-container {
    padding: 0;
    box-shadow: none;
    border-radius: 0;
    max-width: 100%;
}

.btn-close-modal {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 10;
}

.btn-close-modal:hover,
.btn-close-modal:focus {
    color: black;
}

/* --- 从 style.css 迁移过来的登录表单样式 --- */

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h1 {
  color: #002d70;
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 10px;
}

.login-header p {
  color: #666;
  font-size: 14px;
}

.login-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid #e1e4e8;
}

.login-nav-tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  cursor: pointer;
  font-weight: 500;
  color: #333333;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
  height: 42px;
  line-height: 22px;
}

.login-nav-tab.active {
  color: #002d70;
  border-bottom-color: #002d70;
}

.login-nav-tab:hover {
  color: #002d70;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form .form-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  font-size: 14px;
}

.login-form .form-control {
  width: 100%;
  height: 44px;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  background-color: #ffffff;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.login-form .form-control:focus {
  outline: none;
  border-color: #002d70;
  box-shadow: 0 0 0 2px rgba(0, 45, 112, 0.2);
}

.login-form .submit-btn {
  width: 100%;
  padding: 12px;
  margin-top: 10px; /* 减少与上方元素的间距 */
  font-size: 16px;
  font-weight: 500;
  background-color: #002d70;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.login-form .submit-btn:hover {
  background-color: #00205d;
}

.login-form .submit-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.form-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 14px;
}

.form-check-left {
  display: flex;
  align-items: center;
}

.form-check-input {
  margin-right: 0.5rem;
}

.form-check .forgot-link {
  color: #002d70;
  text-decoration: none;
  font-size: 14px;
}

.form-check .forgot-link:hover {
  text-decoration: underline;
}

.form-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
}

.form-footer a {
  color: #002d70;
  text-decoration: none;
  font-weight: 500;
}

.form-footer a:hover {
  text-decoration: underline;
}

.other-login-options {
  margin-top: 20px;
  text-align: center;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.other-login-options p {
  margin-bottom: 15px;
  color: #666;
  font-size: 14px;
}

.other-login-options .btn-success {
    background-color: #07C160;
    border-color: #07C160;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.other-login-options .btn-success:hover {
    background-color: #06a853;
    border-color: #06a853;
}

/* 短信和图片验证码布局 */
.sms-code-group,
.d-flex.gap-2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sms-code-group .form-control,
.d-flex.gap-2 .form-control {
    flex: 1;
}

.sms-code-group .code-btn {
    flex-shrink: 0;
    width: 120px;
    height: 44px;
    background-color: transparent;
    color: #002d70;
    border: 1px solid #002d70;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.sms-code-group .code-btn:hover {
    background-color: #002d70;
    color: white;
}

.sms-code-group .code-btn:disabled {
    background-color: #f5f5f5;
    border-color: #ddd;
    color: #aaa;
    cursor: not-allowed;
}

.captcha-container {
    flex-shrink: 0;
    width: 120px;
    height: 44px;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid #e1e4e8;
    overflow: hidden;
    background: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.captcha-container img {
    width: 100%;
    height: 100%;
    display: block;
}

/* -- Alignment fix for "Remember me" checkbox -- */
.login-modal .form-check-left {
    align-items: center; /* Vertically align the checkbox and the label */
}

.login-modal .form-check-input {
    margin-top: 0; /* Reset browser-default top margin */
}

/* 密码输入框样式 */
.password-field {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  transition: color 0.2s;
  padding: 5px;
  z-index: 2;
}

.password-toggle:hover {
  color: #002d70;
}

.password-field input {
  padding-right: 40px !important; /* 确保文本不会与图标重叠 */
}
