/* WPForms 登录注册弹框样式 */

.wpforms-auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wpforms-auth-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.wpforms-auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.wpforms-auth-modal-container {
    position: relative;
    width: 90%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.wpforms-auth-modal.show .wpforms-auth-modal-container {
    transform: scale(1);
}

.wpforms-auth-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    color: #000;
}

.wpforms-auth-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #000;
}

.wpforms-auth-modal-close {
    background: none;
    border: none;
    color: #000;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.wpforms-auth-modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.wpforms-auth-modal-body {
    padding: 32px;
}

.wpforms-auth-form {
    display: none;
}

.wpforms-auth-form.active {
    display: block;
}

/* WPForms 表单样式优化 */
.wpforms-auth-form .wpforms-form {
    margin: 0;
}

.wpforms-auth-form .wpforms-field {
    margin-bottom: 20px;
}

.wpforms-auth-form .wpforms-field-label {
    font-weight: 500 !important;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.wpforms-auth-form .wpforms-required-label {
    color: #e74c3c;
}

.wpforms-auth-form .wpforms-field input[type="text"],
.wpforms-auth-form .wpforms-field input[type="email"],
.wpforms-auth-form .wpforms-field input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.wpforms-auth-form .wpforms-field input:focus {
    outline: none;
    border-color: #205BCD;
    box-shadow: 0 0 0 3px rgba(32, 91, 205, 0.1);
}

.wpforms-auth-form .wpforms-submit-container {
    margin-top: 24px;
}

.wpforms-auth-form .wpforms-submit {
    width: 100%;
    padding: 14px 24px;
    background: #205BCD;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
}

.wpforms-auth-form .wpforms-submit:hover {
    background: #1b4ca6;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(32, 91, 205, 0.3);
}

.wpforms-auth-form .wpforms-submit:active {
    transform: translateY(0);
}

.wpforms-auth-form .wpforms-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 表单切换链接 */
.wpforms-auth-form-footer {
    margin-top: 24px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.2);
}

.wpforms-auth-form-footer p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.wpforms-auth-form-footer a {
    color: #205BCD;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.wpforms-auth-form-footer a:hover {
    color: #1a3368;
    text-decoration: underline;
}

/* 错误信息样式 */
.wpforms-auth-form .wpforms-error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 8px;
    display: block;
}

.wpforms-auth-form .wpforms-field-container .wpforms-error {
    border-color: #e74c3c;
}

/* 成功信息样式 */
.wpforms-auth-form .wpforms-confirmation-container {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    color: #155724;
}

/* 导航栏登录注册按钮样式 */
.auth-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.login-btn,
.register-btn {
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 16px;
}

.login-btn {
    color: #fff;
    border: none;
    background: #205BCD;
    height: 35px;
    line-height: 35px;
    padding: 0 30px;
}

.login-btn:hover {
    background: #fff;
    color: #205BCD;
}

.register-btn {
  color: #fff;
    border: none;
    background: #205BCD;
    height: 35px;
    line-height: 35px;
    padding: 0 30px;
}

.register-btn:hover {
  background: #fff;
  color: #205BCD;
}

/* 用户菜单样式 */
.user-menu {
    position: relative;
}

.user-profile-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s ease;
}

.user-profile-link:hover {
    background: rgba(35, 68, 140, 0.1);
}

.user-avatar img {
    border-radius: 50%;
    width: 24px;
    height: 24px;
}

.user-name {
    font-weight: 600;
    font-size:16px;
}

.user-menu .sub-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    display: none;
    z-index: 1000;
}

.user-menu:hover .sub-menu {
    display: block;
}

.user-menu .sub-menu li {
    list-style: none;
}

.user-menu .sub-menu a {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s ease;
    font-size: 14px;
}

.user-menu .sub-menu a:hover {
    background: #f8f9fa;
    color: #205BCD;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .wpforms-auth-modal-container {
        width: 95%;
        margin: 20px;
    }
    
    .wpforms-auth-modal-header {
        padding: 20px 24px;
    }
    
    .wpforms-auth-modal-body {
        padding: 24px;
    }
    
    .wpforms-auth-modal-title {
        font-size: 18px;
    }
    
    .auth-buttons {
        gap: 8px;
    }
    
    .login-btn,
    .register-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .wpforms-auth-modal-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
        margin: 0;
    }
    
    .wpforms-auth-modal-header {
        padding: 16px 20px;
    }
    
    .wpforms-auth-modal-body {
        padding: 20px;
    }
    
    .wpforms-auth-form .wpforms-field input[type="text"],
    .wpforms-auth-form .wpforms-field input[type="email"],
    .wpforms-auth-form .wpforms-field input[type="password"] {
        font-size: 16px; /* 防止 iOS 缩放 */
    }
}

/* 加载动画 */
.wpforms-auth-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.wpforms-auth-form.loading .wpforms-submit {
    position: relative;
}

.wpforms-auth-form.loading .wpforms-submit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 淡入淡出动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wpforms-auth-form.active {
    animation: fadeIn 0.3s ease;
}

.auth-error-message {
  margin-bottom: 15px;
  padding: 12px 15px;
  background:rgba(248, 215, 218, 0.6);
  color: #721c24;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.4;
}

.auth-error-message .error-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-error-message .error-icon {
  margin-right: 8px;
  font-size: 16px;
}

.auth-error-message .error-text {
  flex: 1;
}

.auth-error-message .error-close {
  background: none;
  border: none;
  color: #721c24;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  margin-left: 10px;
  line-height: 1;
}

.auth-error-message .error-close:hover {
  color: #491217;
}

.auth-success-message {
  margin-bottom: 15px;
  padding: 12px 15px;
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.4;
}

.auth-success-message .success-content {
  display: flex;
  align-items: center;
}

.auth-success-message .success-icon {
  margin-right: 8px;
  font-size: 16px;
}

.auth-success-message .success-text {
  flex: 1;
}

/* 动画效果 */
.auth-error-message,
.auth-success-message {
  animation: slideDown 0.3s ease-out;
}

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