/* =====================================================================
 * BcFit 统一登录页样式（苹果风格）
 * 桌面：左渐变品牌区 55% + 右白色表单 45%
 * 移动/平板：上下结构（上渐变，下白色卡片）
 * ===================================================================== */
:root {
  --blue: #007aff;
  --blue2: #0a84ff;
  --text: #1c1c1e;
  --text-2: #8e8e93;
  --text-3: #c7c7cc;
  --border: #e5e5ea;
  --bg-field: #f9f9fb;
  --danger: #ff3b30;
  --green: #34c759;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue',
    'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--blue);
  text-decoration: none;
  cursor: pointer;
}

.auth-page {
  display: flex;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ================= 左侧品牌区 ================= */
.brand-panel {
  position: relative;
  flex: 0 0 55%;
  width: 55%;
  min-height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, #007aff 0%, #5856d6 50%, #af52de 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 网格叠加 */
.brand-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* 装饰圆（用径向渐变模拟柔边，避免 filter:blur 在大屏上闪烁） */
.brand-deco {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
  will-change: transform;
}
.deco-1 { width: 320px; height: 320px; top: -80px; left: -80px; animation: float1 9s ease-in-out infinite; }
.deco-2 { width: 260px; height: 260px; bottom: -60px; right: -40px; animation: float2 11s ease-in-out infinite; }
.deco-3 { width: 180px; height: 180px; top: 40%; right: 18%; animation: float1 13s ease-in-out infinite; }

@keyframes float1 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-28px); }
}
@keyframes float2 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(24px); }
}

.brand-inner {
  position: relative;
  z-index: 2;
  padding: 0 60px;
  width: 100%;
  max-width: 560px;
  animation: slideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

.brand-logo {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.brand-title {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  white-space: nowrap;
}

.brand-slogan {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 48px;
}

.brand-features {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.feature {
  width: 120px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  animation: slideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.feature:nth-child(1) { animation-delay: 0.1s; }
.feature:nth-child(2) { animation-delay: 0.2s; }
.feature:nth-child(3) { animation-delay: 0.3s; }
.feature:nth-child(4) { animation-delay: 0.4s; }

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.feature-text {
  margin-top: 8px;
  font-size: 12px;
  color: #fff;
  white-space: nowrap;
}

.brand-version {
  position: absolute;
  left: 60px;
  bottom: 30px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  z-index: 2;
}

/* ================= 右侧表单区 ================= */
.form-panel {
  flex: 1 1 45%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: #fff;
}

.form-card {
  width: 100%;
  max-width: 400px;
}

.form-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.form-subtitle {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 32px;
}

/* 错误提示条 */
.error-bar {
  display: block;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: rgba(255, 59, 48, 0.08);
  color: var(--danger);
  font-size: 13px;
  animation: shake 0.3s;
}
.error-bar[hidden] { display: none; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* 输入框 */
.field {
  position: relative;
  display: flex;
  align-items: center;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-field);
  margin-bottom: 16px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field:focus-within {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.field.error {
  border-color: var(--danger);
}

.field-icon {
  position: absolute;
  left: 16px;
  display: flex;
  align-items: center;
  color: var(--text-2);
  pointer-events: none;
}

.field input {
  flex: 1;
  height: 100%;
  border: none;
  background: none;
  outline: none;
  padding: 0 44px 0 44px;
  font-size: 15px;
  color: var(--text);
}

.field input::placeholder {
  color: var(--text-3);
  font-size: 15px;
}

.eye-btn {
  position: absolute;
  right: 12px;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 记住我 + 忘记密码 */
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.switch {
  position: relative;
  width: 51px;
  height: 31px;
  flex-shrink: 0;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 31px;
  background: #e9e9eb;
  transition: background 0.2s;
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}
.switch input:checked + .switch-track {
  background: var(--green);
}
.switch input:checked + .switch-track::after {
  transform: translateX(20px);
}

.remember-text {
  font-size: 14px;
  color: var(--text);
}

.link-btn {
  border: none;
  background: none;
  color: var(--blue);
  font-size: 14px;
  cursor: pointer;
}

/* 登录按钮 */
.submit-btn {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #007aff, #0a84ff);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s, background 0.3s;
}
.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}
.submit-btn:active {
  transform: scale(0.97);
}
.submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.submit-btn.success {
  background: var(--green);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 分隔线 */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
  color: var(--text-2);
  font-size: 12px;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* 其他方式 */
.alt-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.alt-btn {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.alt-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.form-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 14px;
  color: var(--text-2);
}

/* ================= 响应式 ================= */
/* 平板竖屏 */
@media (max-width: 1023px) {
  .auth-page { flex-direction: column; }
  .brand-panel {
    flex: none;
    width: 100%;
    min-height: 200px;
    height: 200px;
  }
  .brand-inner {
    padding: 24px 24px 0;
    max-width: 100%;
  }
  .brand-logo { width: 48px; height: 48px; border-radius: 12px; margin-bottom: 12px; }
  .brand-logo svg { width: 24px; height: 24px; }
  .brand-title { font-size: 22px; margin-bottom: 4px; }
  .brand-slogan { font-size: 13px; margin-bottom: 16px; }
  .brand-features { display: none; }
  .brand-version { left: 24px; bottom: 12px; }

  .form-panel {
    margin-top: -20px;
    border-radius: 20px 20px 0 0;
    min-height: auto;
    padding: 32px 16px 40px;
    position: relative;
    z-index: 3;
  }
  .form-card { max-width: 480px; margin: 0 auto; }
}

/* 手机 */
@media (max-width: 767px) {
  .form-panel { padding: 28px 16px 40px; }
  .form-card { max-width: 100%; }
}
