/* auth.css - 登录和注册页面共用样式 */

/* 基础样式 */
html {
  height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f8f9fa;
  font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding-top: 67px; /* 为固定导航栏留出空间 */
}

/* 页面容器 */
.auth-page-wrapper {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
  position: relative;
  overflow: hidden;
}

/* 背景装饰 */
.auth-page-wrapper::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 218, 88, 0.1) 0%, rgba(255, 218, 88, 0) 70%);
  z-index: -1;
  transform: scale(2);
}

.auth-page-wrapper::after {
  content: '';
  position: absolute;
  bottom: -50%;
  left: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 218, 88, 0.1) 0%, rgba(255, 218, 88, 0) 70%);
  z-index: -1;
  transform: scale(2);
}

/* 主容器 */
.auth-container {
  display: flex;
  max-width: 1000px;
  width: calc(100% - 40px);
  margin: 20px auto;
  background-color: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  overflow: hidden;
  animation: fadeIn 0.5s ease-out;
  position: relative;
}

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

/* 表单区域 */
.auth-form-section {
  flex: 1;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

/* 信息区域 */
.auth-info-section {
  flex: 1;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #495057;
  position: relative;
  overflow: hidden;
}

.auth-info-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #ffda58;
}

/* Logo 样式 */
.auth-form-section .logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-form-section .logo img {
  max-height: 60px;
  transition: transform 0.3s ease;
}

.auth-form-section .logo img:hover {
  transform: scale(1.05);
}

/* 表单元素 */
.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-group label {
  font-weight: 500;
  color: #555;
  margin-bottom: 0.5rem;
  display: block;
}

.form-control {
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: #f9f9f9;
  width: 100%;
  height: calc(1.5em + 1.6rem + 2px); /* 确保所有输入框高度一致 */
  line-height: 1.5;
  box-sizing: border-box;
}

.form-control:focus {
  border-color: #ffda58;
  box-shadow: 0 0 0 0.2rem rgba(255, 218, 88, 0.25);
  background-color: #fff;
}

.form-control.is-invalid {
  border-color: #dc3545;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #dc3545;
}

/* 输入组样式 */
.input-group {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
}

.input-group-prepend {
  display: flex;
  margin-right: -1px;
}

.input-group-append {
  display: flex;
  margin-left: -1px;
}

.input-group-text {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1rem;
  margin-bottom: 0;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #777;
  text-align: center;
  white-space: nowrap;
  background-color: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  height: calc(1.5em + 1.6rem + 2px); /* 与输入框高度一致 */
  box-sizing: border-box;
}

.input-group-prepend .input-group-text {
  border-right: none;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group-prepend + .form-control {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.input-group .form-control:focus {
  z-index: 3;
}

.input-group-prepend .input-group-text i {
  font-size: 0.9rem;
  width: 1rem;
  text-align: center;
}

/* 密码可见性按钮 */
.input-group .form-control {
  border-right: none;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  position: relative;
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
  margin-bottom: 0;
}

.input-group-append .btn {
  border-left: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  background-color: #f9f9f9;
  border-color: #e0e0e0;
  color: #777;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  padding: 0.8rem 1rem;
  line-height: 1.5;
  height: calc(1.5em + 1.6rem + 2px); /* 与输入框高度一致 */
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-group-append .btn:hover {
  background-color: #f0f0f0;
}

.input-group .form-control:focus + .input-group-append .btn {
  border-color: #ffda58;
}

/* 按钮样式 */
.btn {
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-warning {
  background-color: #ffda58;
  border-color: #ffda58;
  color: #333;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.btn-warning:hover {
  background-color: #ffd333;
  border-color: #ffd333;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.btn-block {
  display: block;
  width: 100%;
}

/* 社交登录按钮 */
.social-login {
  margin-top: 2rem;
  text-align: center;
}

.social-login p {
  color: #777;
  margin-bottom: 1rem;
  position: relative;
}

.social-login p::before,
.social-login p::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background-color: #ddd;
}

.social-login p::before {
  left: 0;
}

.social-login p::after {
  right: 0;
}

.btn-outline-dark,
.btn-outline-danger {
  margin: 0 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.btn-outline-dark:hover,
.btn-outline-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* 信息区域内容 */
.auth-info-section h2 {
  color: #333;
  font-weight: 600;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

.auth-info-section h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 4px;
  background: #ffda58;
  border-radius: 2px;
}

.auth-info-section p {
  line-height: 1.8;
  font-size: 1rem;
  margin-bottom: 1.5rem;
  color: #555;
}

/* 提示信息 */
.alert {
  border-radius: 8px;
  border: none;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.alert-success {
  background-color: #e3fcef;
  color: #0d6832;
}

.alert-danger {
  background-color: #fee7e7;
  color: #b71c1c;
}

/* 吐司通知 */
.toast-container-wrapper {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1090;
  width: auto;
  min-width: 300px;
}

.toast {
  border-radius: 8px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  border: none;
  background-clip: padding-box;
  overflow: hidden;
}

.toast-header {
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 0.75rem 1.25rem;
  background-color: #ffda58;
  color: #333;
  font-weight: 500;
}

.toast-body {
  padding: 1rem;
  font-size: 0.95rem;
  color: #333;
  background-color: #fff;
}

/* 记住我复选框 */
.custom-checkbox {
  margin-bottom: 1rem;
}

.custom-control-input:checked ~ .custom-control-label::before {
  background-color: #ffda58;
  border-color: #ffda58;
}

.custom-checkbox .custom-control-label::before {
  border-radius: 4px;
}

/* 其他链接 */
.auth-links {
  text-align: center;
  margin-top: 1.5rem;
}

.auth-links a {
  color: #007bff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.auth-links a:hover {
  color: #0056b3;
  text-decoration: underline;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .auth-container {
    flex-direction: column;
    margin: 1rem;
  }
  
  .auth-form-section,
  .auth-info-section {
    padding: 2rem;
  }
  
  .auth-page-wrapper {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  
  .toast-container-wrapper {
    width: calc(100% - 20px);
    left: 10px;
    transform: none;
    top: 80px;
  }

  .social-login p::before,
  .social-login p::after {
    width: 25%;
  }
} 