.e_x_popup_overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 101;
  opacity: 0;
}

.e_x_popup_overlay.active {
  display: block;
  opacity: 1;
}

.e_x_popup_box {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(650px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  background: #fff;
  z-index: 10000;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  padding: 0;
  transform: translate(-50%, -50%);
  border-radius: 4px;
}

.e_x_popup_box.active {
  display: block;
}

.e_x_popup_layout {
  max-height: calc(100vh - 32px);
}

.e_x_popup_content {
  position: relative;
  overflow-y: auto;
  padding: 40px 36px 32px;
  box-sizing: border-box;
}

.e_x_popup_close_btn {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  border: none;
  background: none;
  color: #333;
  padding: 0;
}

.e_x_auth_form_title {
  margin: 0 0 24px;
  font-size: 22px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.3;
}

/* 切换表单 */
.e_x_auth_form_box {
  display: none;
}

.e_x_auth_form_box.active {
  display: block;
}

.e_x_auth_form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.e_x_auth_form input[type="text"],
.e_x_auth_form input[type="email"],
.e_x_auth_form input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #d0d0d0;
  border-radius: 2px;
  font-size: 14px;
  color: #222;
  background: #fff;
}

.e_x_auth_form input:focus {
  outline: none;
  border-color: #888 !important;
}

/* 登录：无 label，占位符提示 */
.e_x_auth_form--login .e_x_form_row--stack {
  display: block;
}

/* 带 label 的表单：label 左、右对齐；input 等宽 */
.e_x_auth_form--labeled .e_x_form_row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.e_x_auth_form--labeled .e_x_form_row > label {
  flex: 0 0 88px;
  margin: 0;
  text-align: right;
  font-size: 14px;
  color: #333;
  line-height: 1.3;
}

.e_x_form_control {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}

.e_x_form_control input {
  flex: 1 1 auto;
  width: 100%;
}

/* WooCommerce 注入的 .password-input 占满表单行 */
.e_x_auth_form .password-input {
  display: block;
  width: 100%;
}

/* 验证码 input 与发送按钮 1:1 */
.e_x_form_control--otp {
  gap: 8px;
}

.e_x_form_control--otp input,
.e_x_form_control--otp .e_x_otp_btn {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
}

.e_x_otp_btn {
  height: 42px;
  padding: 0 8px;
  border: 1px solid #d0d0d0;
  border-radius: 2px;
  background: #f7f7f7;
  color: #333;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.e_x_otp_btn:hover:not(:disabled) {
  background: #eee;
}

.e_x_otp_btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.e_x_form_links {
  display: flex;
  justify-content: flex-end;
  margin-top: -6px;
}

.e_x_text_link {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  color: #666;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
}

.e_x_text_link:hover {
  color: #111;
  text-decoration: underline;
}

.e_x_auth_submit {
  width: 100%;
  height: 44px;
  margin-top: 6px;
  border: none;
  border-radius: 2px;
  background: #000000;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

.e_x_auth_submit:hover:not(:disabled) {
  background: #333;
}

.e_x_auth_submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.e_x_form_switch {
  /* margin: 4px 0 0; */
  text-align: center;
  border: 1px solid #000000;
  background: transparent;
  font-size: 15px;
  height: 44px;
  cursor: pointer;
  
}

.e_x_auth_form_message {
  margin-top: 14px;
  min-height: 1.4em;
  font-size: 13px;
  color: #c0392b;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .e_x_popup_box {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .e_x_popup_content {
    padding: 28px 20px 24px;
  }

  .e_x_auth_form_title {
    font-size: 20px;
    margin-bottom: 18px;
  }

  .e_x_auth_form--labeled .e_x_form_row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .e_x_auth_form--labeled .e_x_form_row > label {
    flex: none;
    width: auto;
    text-align: left;
  }

  .e_x_form_control--otp input,
  .e_x_form_control--otp .e_x_otp_btn {
    width: auto;
  }
}
