/*
 * 登录页面现代化样式
 * 参考um_admin/src/views/Login.vue样式
 * 品牌主色: #D82E20
 */

/* 整体布局 */
.login-page {
  height: 100vh;
  background: url(https://oss.99bx.cn/um/login/bg.png) no-repeat center center;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
}

/* 登录表单容器 */
.login-form {
  position: fixed;
  right: 10%;
  top: 95px;
  background: white;
  border-radius: 8px;
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  width: 500px;
  max-width: 90%;
}

/* 登录标题 */
.login-header {
  text-align: center;
  margin-bottom: 40px;
}

.login-header h2 {
  margin: 0 0 8px 0;
  color: #303133;
  font-size: 28px;
  font-weight: bold;
}

.login-header h3 {
  margin: 0;
  color: #909399;
  font-size: 18px;
  font-weight: normal;
}

/* Tab切换样式 - 参考Element Plus */
.login-tabs {
  display: flex;
  border-bottom: 2px solid #e4e7ed;
  margin-bottom: 30px;
  position: relative;
}

.login-tab {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  cursor: pointer;
  font-size: 16px;
  color: #606266;
  position: relative;
  transition: color 0.3s ease;
  background: transparent;
  border: none;
  outline: none;
}

.login-tab:hover {
  color: #d82e20;
}

.login-tab.active {
  color: #d82e20;
  font-weight: bold;
}

.login-tab.active:after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #d82e20;
  transition: all 0.3s ease;
}

/* 表单元素 */
.login-form-group {
  margin-bottom: 24px;
  position: relative;
}

.login-form-group input {
  width: 100%;
  height: 48px;
  padding: 10px 15px 10px 45px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.login-form-group input:focus {
  border-color: #d82e20;
  box-shadow: 0 0 0 2px rgba(216, 46, 32, 0.2);
  outline: none;
}

.login-form-group i {
  position: absolute;
  left: 15px;
  top: 15px;
  color: #909399;
  font-size: 18px;
}

/* 验证码容器 */
.captcha-group {
  display: flex;
  gap: 12px;
}

.captcha-group input {
  flex: 1;
}

.captcha-group img {
  height: 48px;
  width: 120px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.3s ease;
  object-fit: cover;
}

.captcha-group img:hover {
  border-color: #d82e20;
}

/* 短信验证码容器 */
.sms-code-group {
  display: flex;
  gap: 12px;
}

.sms-code-group input {
  flex: 1;
}

.sms-code-button {
  min-width: 120px;
  height: 48px;
  background-color: #f8f9fa;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 14px;
  color: #606266;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.sms-code-button:hover:not(:disabled) {
  background-color: #e9ecef;
  border-color: #d82e20;
  color: #d82e20;
}

.sms-code-button:disabled {
  background-color: #e9ecef;
  color: #adb5bd;
  cursor: not-allowed;
  border-color: #dcdfe6;
}

/* 登录选项 */
.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  font-size: 14px;
  color: #606266;
}

.remember-me {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.remember-me input {
  margin-right: 5px;
  cursor: pointer;
}

.forgot-password {
  color: #606266;
  text-decoration: none;
  transition: color 0.3s ease;
  cursor: pointer;
}

.forgot-password:hover {
  color: #d82e20;
  text-decoration: none;
}

/* 密码选项区域 */
.password-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.password-options .forget-password-link {
  font-size: 14px;
  color: #d82e20;
  cursor: pointer;
  text-decoration: none;
}

.password-options .forget-password-link:hover {
  text-decoration: underline;
}

/* 登录按钮 */
.login-button {
  width: 100%;
  height: 48px;
  background-color: #d82e20;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-weight: 500;
}

.login-button:hover {
  background-color: #c22717;
}

.login-button:active {
  background-color: #b01f12;
}

.login-button:disabled {
  background-color: #fabfb8;
  cursor: not-allowed;
}

/* 加载状态 */
.login-button.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.login-button.loading:after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Tab内容切换 */
.form-tab {
  display: none;
  animation: fadeIn 0.3s ease;
}

.form-tab.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 错误提示 */
.error-message {
  color: #f56c6c;
  font-size: 12px;
  margin-top: 5px;
  display: none;
  line-height: 1.5;
}

.error-message.show {
  display: block;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* 版权信息 */
.copyright {
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 14px;
  color: white;
  line-height: 20px;
  z-index: 10;
}

.copyright a {
  color: white;
  text-decoration: underline;
}

.copyright a:hover {
  color: #f0f0f0;
}

/* 响应式设计 - 平板 */
@media (min-width: 481px) and (max-width: 768px) {
  .login-form {
    position: relative;
    right: auto;
    top: auto;
    width: 80%;
    margin: 0 auto;
  }
}

/* 响应式设计 - 手机 */
@media (max-width: 480px) {
  .login-page {
    padding: 20px;
  }

  .login-form {
    position: relative;
    right: auto;
    top: auto;
    width: 90%;
    margin: 0 auto;
    padding: 30px 20px;
  }

  .login-header h2 {
    font-size: 24px;
  }

  .login-header h3 {
    font-size: 16px;
  }

  .sms-code-group {
    flex-direction: column;
    gap: 10px;
  }

  .sms-code-button {
    width: 100%;
    min-width: auto;
  }

  .captcha-group {
    flex-direction: column;
    gap: 10px;
  }

  .captcha-group img {
    width: 100%;
    height: 60px;
  }
}

/* 覆盖Bootstrap默认样式 */
.btn-danger {
  background-color: #d82e20 !important;
  border-color: #d82e20 !important;
}

.btn-danger:hover {
  background-color: #c22717 !important;
  border-color: #c22717 !important;
}

.btn-danger:focus,
.btn-danger:active {
  background-color: #b01f12 !important;
  border-color: #b01f12 !important;
  box-shadow: 0 0 0 0.2rem rgba(216, 46, 32, 0.5) !important;
}

.form-control:focus {
  border-color: #d82e20 !important;
  box-shadow: 0 0 0 0.2rem rgba(216, 46, 32, 0.2) !important;
}

/* 步骤指示器样式（用于忘记密码流程） */
.steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 50px;
  padding: 0 20px;
}

.step {
  flex: 1;
  text-align: center;
  position: relative;
}

.step:not(:last-child):after {
  content: '';
  position: absolute;
  top: 15px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #e4e7ed;
  z-index: 0;
}

.step.active .step-number {
  background: #d82e20;
  color: white;
  border-color: #d82e20;
}

.step.active .step-title {
  color: #d82e20;
}

.step.finished .step-number {
  background: #d82e20;
  color: white;
  border-color: #d82e20;
}

.step.finished .step-title {
  color: #d82e20;
}

.step.finished:after {
  background: #d82e20;
}

.step-number {
  display: inline-block;
  width: 32px;
  height: 32px;
  line-height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #e4e7ed;
  color: #909399;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
  font-weight: 500;
}

.step-title {
  display: block;
  font-size: 14px;
  color: #909399;
  transition: color 0.3s ease;
}

/* 步骤内容显示控制 */
.step-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.step-content.active {
  display: block;
}

/* 输入框占位符颜色 */
.login-form-group input::placeholder {
  color: #c0c4cc;
}

/* 禁用状态 */
.login-form-group input:disabled {
  background-color: #f5f7fa;
  border-color: #e4e7ed;
  color: #c0c4cc;
  cursor: not-allowed;
}

/* 成功提示样式 */
.success-message {
  color: #67c23a;
  font-size: 14px;
  margin-top: 5px;
}

/* 成功图标样式 */
.success-icon {
  font-size: 72px;
  color: #67c23a;
  margin-bottom: 20px;
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Tooltip提示样式 */
.tips {
  font-size: 14px;
  color: #606266;
  line-height: 1.6;
  margin-bottom: 20px;
  padding: 12px 16px;
  background-color: #f4f4f5;
  border-left: 4px solid #d82e20;
  border-radius: 4px;
}

/* 密码强度指示器 */
.password-strength {
  margin-top: 8px;
}

.strength-bar {
  width: 100%;
  height: 4px;
  background: #dcdfe6;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.strength-fill {
  height: 100%;
  transition: width 0.3s ease, background 0.3s ease;
}

.strength-fill.weak {
  background: #f56c6c;
}

.strength-fill.medium {
  background: #e6a23c;
}

.strength-fill.strong {
  background: #67c23a;
}

.strength-text {
  font-size: 12px;
  font-weight: 500;
}

/* 平滑过渡效果 */
* {
  box-sizing: border-box;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* ==================== 滑块验证码组件样式 ==================== */

.slider-subtitle {
  font-size: 14px;
  color: #666;
  margin: 0 0 16px 0;
}

.slider-backdrop-container {
  width: 500px;
  height: 300px;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 16px;
  background-color: #f5f5f5;
}

.slider-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #f5f5f5;
  z-index: 10;
}

.slider-loading p {
  margin-top: 10px;
  font-size: 14px;
  color: #666;
}

.slider-backdrop-wrapper {
  position: relative;
  width: 500px;
  height: 300px;
}

.slider-backdrop {
  width: 500px;
  height: 300px;
  object-fit: cover;
  display: block;
}

.slider-fragment {
  width: 48px;
  height: 48px;
  position: absolute;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  transition: left 0.05s linear;
}

.slider-tips {
  position: absolute;
  bottom: -30px;
  left: 0;
  right: 0;
  height: 30px;
  background-color: rgba(77, 77, 77, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease;
}

.slider-tips.show {
  transform: translateY(-30px);
}

.slider-tips.success {
  background-color: rgba(103, 194, 58, 0.8);
}

.slider-tips.fail {
  background-color: rgba(245, 108, 108, 0.8);
}

.slider-tips p {
  color: white;
  font-size: 14px;
  margin: 0;
}

.slider-track-container {
  width: 100%;
  height: 40px;
  background-color: #e8e8e8;
  border-radius: 20px;
  position: relative;
  margin-bottom: 16px;
  overflow: hidden;
}

.slider-thumb {
  width: 40px;
  height: 40px;
  background-color: #d82e20;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  position: absolute;
  left: 0;
  top: 0;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s, left 0.05s linear;
  user-select: none;
}

.slider-thumb:hover {
  background-color: #c22717;
}

.slider-thumb.dragging {
  background-color: #b01f12;
  cursor: grabbing;
}

.slider-thumb.success {
  background-color: #67c23a;
}

.slider-thumb.fail {
  background-color: #f56c6c;
  animation: shake 0.3s ease;
}

.slider-thumb i {
  font-size: 18px;
}

/* 滑块震动动画 */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* 响应式适配 - 移动端滑块验证码 */
@media (max-width: 480px) {
  .modal-dialog {
    width: 90% !important;
    margin: 30px auto;
  }

  .slider-backdrop-container,
  .slider-backdrop-wrapper,
  .slider-backdrop {
    width: 100%;
    max-width: 100%;
  }

  .slider-fragment {
    width: 40px;
    height: 40px;
  }
}
