/**
 * @file
 * Register page styles
 * Modern, Apple-inspired design
 */

/* 注册页面容器 */
.register-page {
  min-height: 100vh;
  background: #F5F5F7;
}

/* 通知栏样式 */
.notice-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
  color: white;
  padding: 12px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.notice-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.notice-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.notice-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notice-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  color: white;
}

.notice-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 状态显示栏 */
.status-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 59;
  background: #FFF3CD;
  border-bottom: 1px solid #FFC107;
  padding: 10px 16px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-bar.warning {
  background: #FFF3CD;
  border-bottom-color: #FFC107;
}

.status-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.status-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.1);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.status-close:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* 当有通知栏时，调整内容位置 */
body:has(.notice-bar) .register-container {
  padding-top: 100px;
}

/* 注册容器 */
.register-container {
  min-height: calc(100vh - 56px);
  padding: 80px 16px 24px;
  padding-top: 80px;
}

/* 移动端顶部间距调整 */
@media (max-width: 768px) {
  .register-container {
    padding: 16px 16px 24px;
  }
}

/* 注册卡片 */
.register-card {
  background: white;
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* Logo */
.register-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.register-logo a {
  display: inline-block;
}

.register-logo-img {
  max-height: 80px;
  width: auto;
  display: block;
}

.register-logo .logo-icon {
  width: 64px;
  height: 64px;
}

/* 标题 */
.register-title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  color: #1D1D1F;
}

.register-subtitle {
  font-size: 15px;
  text-align: center;
  color: #6E6E73;
  margin-bottom: 32px;
}

/* 表单容器 */
.register-form-wrapper {
  margin-bottom: 24px;
}

/* Drupal 表单样式适配 */
.register-form-wrapper form {
  margin: 0;
}

.register-form-wrapper .form-item {
  margin-bottom: 20px;
}

.register-form-wrapper label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1D1D1F;
}

.register-form-wrapper input[type="text"],
.register-form-wrapper input[type="email"],
.register-form-wrapper input[type="password"],
.register-form-wrapper input[type="tel"],
.register-form-wrapper select,
.register-form-wrapper textarea {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  transition: all 0.2s ease;
  outline: none;
  background: white;
  font-family: inherit;
}

.register-form-wrapper input:focus,
.register-form-wrapper select:focus,
.register-form-wrapper textarea:focus {
  border-color: #0066CC;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.register-form-wrapper input::placeholder,
.register-form-wrapper textarea::placeholder {
  color: #D2D2D7;
}

.register-form-wrapper input.error,
.register-form-wrapper select.error {
  border-color: #D32F2F;
}

.register-form-wrapper input.error:focus,
.register-form-wrapper select.error:focus {
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

/* 描述文字 */
.register-form-wrapper .description {
  font-size: 12px;
  color: #6E6E73;
  margin-top: 6px;
  margin-bottom: 0;
}

/* 验证码输入容器 */
.register-form-wrapper .field--name-field-verification-code,
.register-form-wrapper .verification-code-container {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.register-form-wrapper .verification-code-container input {
  flex: 1;
}

.register-form-wrapper .verification-code-container button {
  padding: 14px 20px;
  background: #0066CC;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.register-form-wrapper .verification-code-container button:hover:not(:disabled) {
  background: #0052A3;
}

.register-form-wrapper .verification-code-container button:disabled {
  background: #D2D2D7;
  cursor: not-allowed;
  opacity: 0.6;
}

/* 复选框 */
.register-form-wrapper .form-type-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 24px;
}

.register-form-wrapper .form-type-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.register-form-wrapper .form-type-checkbox label {
  margin-bottom: 0;
  font-size: 13px;
  font-weight: 400;
  color: #6E6E73;
  line-height: 1.5;
}

.register-form-wrapper .form-type-checkbox a {
  color: #0066CC;
  text-decoration: none;
}

.register-form-wrapper .form-type-checkbox a:hover {
  text-decoration: underline;
}

/* 条款同意复选框 - 特殊样式 */
.terms-agreement-wrapper {
  display: flex !important;
  align-items: center !important;
  flex-direction: row !important;
  margin-bottom: 20px;
  margin-top: 8px;
}

.terms-agreement-wrapper .form-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  width: 100%;
}

.terms-agreement-wrapper input[type="checkbox"] {
  flex-shrink: 0;
  margin: 0;
}

.terms-agreement-wrapper label {
  display: inline;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #6E6E73;
}

.terms-agreement-wrapper label a {
  color: #0066CC;
  text-decoration: none;
}

.terms-agreement-wrapper label a:hover {
  text-decoration: underline;
}

.terms-agreement-wrapper .description {
  display: none;
}

/* 提交按钮 */
.register-form-wrapper .form-actions {
  margin-top: 24px;
}

.register-form-wrapper button[type="submit"],
.register-form-wrapper input[type="submit"] {
  width: 100%;
  padding: 16px;
  background: #0066CC;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.register-form-wrapper button[type="submit"]:hover,
.register-form-wrapper input[type="submit"]:hover {
  background: #0052A3;
}

.register-form-wrapper button[type="submit"]:active,
.register-form-wrapper input[type="submit"]:active {
  transform: scale(0.98);
}

.register-form-wrapper button[type="submit"]:disabled,
.register-form-wrapper input[type="submit"]:disabled {
  background: #D2D2D7;
  cursor: not-allowed;
  opacity: 0.6;
}

/* 按钮提交中状态 - 注册表单 */
.register-form-wrapper button[type="submit"].is-submitting,
.register-form-wrapper input[type="submit"].is-submitting {
  position: relative;
  color: transparent !important;
  pointer-events: auto !important; /* 确保不阻止点击 */
  cursor: wait !important;
}

.register-form-wrapper button[type="submit"].is-submitting::before,
.register-form-wrapper input[type="submit"].is-submitting::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: button-spinner 0.8s linear infinite;
}

/* 错误提示 */
.error-message {
  display: none;
  padding: 12px 16px;
  background: #FFE5E5;
  border: 1px solid #FFCDD2;
  border-radius: 8px;
  color: #D32F2F;
  font-size: 14px;
  margin-bottom: 20px;
}

.error-message.show {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 成功提示 */
.success-message {
  display: none;
  padding: 12px 16px;
  background: #E8F5E9;
  border: 1px solid #C8E6C9;
  border-radius: 8px;
  color: #2E7D32;
  font-size: 14px;
  margin-bottom: 20px;
}

.success-message.show {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 登录提示 */
.login-hint {
  text-align: center;
  font-size: 14px;
  color: #6E6E73;
  margin: 0;
  margin-top: 24px;
}

.login-link {
  color: #0066CC;
  text-decoration: none;
  font-weight: 600;
}

.login-link:hover {
  text-decoration: underline;
}

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

.password-strength.show {
  display: block;
}

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

.custom-strength-bar {
  height: 4px;
  background: #E8E8ED;
  border-radius: 2px;
  overflow: hidden;
}

.custom-strength-fill {
  height: 100%;
  width: 0;
  transition: all 0.3s ease;
}

.custom-strength-fill.weak {
  width: 33% !important;
  background: #D32F2F !important;
}

.custom-strength-fill.medium {
  width: 66% !important;
  background: #F57C00 !important;
}

.custom-strength-fill.strong {
  width: 100% !important;
  background: #388E3C !important;
}

.custom-strength-text {
  font-size: 12px;
  margin-top: 4px;
  color: #6E6E73;
}

.custom-strength-text.weak {
  color: #D32F2F !important;
}

.custom-strength-text.medium {
  color: #F57C00 !important;
}

.custom-strength-text.strong {
  color: #388E3C !important;
}

/* Drupal 消息样式适配 */
.register-form-wrapper .messages {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.register-form-wrapper .messages--error {
  background: #FFE5E5;
  border: 1px solid #FFCDD2;
  color: #D32F2F;
}

.register-form-wrapper .messages--status {
  background: #E8F5E9;
  border: 1px solid #C8E6C9;
  color: #2E7D32;
}

.register-form-wrapper .messages--warning {
  background: #FFF3CD;
  border: 1px solid #FFC107;
  color: #856404;
}

/* 移动端底部导航 */
.register-page .bottom-nav {
  display: none;
}

/* 响应式设计 */
@media (max-width: 767px) {
  .register-page .bottom-nav {
    display: flex;
  }
}

@media (min-width: 768px) {
  .register-container {
    padding: 100px 16px 24px;
  }

  .register-card {
    padding: 48px 40px;
  }

  .register-title {
    font-size: 32px;
  }
}

/* 毛玻璃导航栏（如果页面包含导航） */
.register-page .nav-blur {
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background-color: rgba(255, 255, 255, 0.8);
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
  .register-form-wrapper input,
  .register-form-wrapper select,
  .register-form-wrapper textarea,
  .register-form-wrapper button,
  .register-form-wrapper input[type="submit"] {
    transition: none;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  .register-card {
    border: 1px solid #000;
  }

  .register-form-wrapper input,
  .register-form-wrapper select,
  .register-form-wrapper textarea {
    border-width: 2px;
  }
}
