/**
 * Fish or Die - 登录页样式
 * 玻璃拟态 + 背景随机图 + 浮动 label
 * 仅作用于 #login-page 及其子元素，不影响其他页面
 */

/* ── CSS 变量 ── */
:root {
  --login-purple: #8b5cf6;
  --login-blue: #3b82f6;
  --login-pink: #ec4899;
  --login-white: rgba(255, 255, 255, 0.95);
  --login-white-dim: rgba(255, 255, 255, 0.45);
  --login-white-faint: rgba(255, 255, 255, 0.15);
}

/* ── 背景层 ── */
#login-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

/* 背景图片 */
#login-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  z-index: 0;
  transition: opacity 0.4s ease;
}

/* ── 登录内容容器（z-index 高于 overlay） ── */
#login-page > * {
  position: relative;
  z-index: 10;
}

/* ── Auth Tabs ── */
#authTabs {
  position: fixed;
  top: 20px; right: 20px;
  display: flex;
  width: auto;
  max-width: 320px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 4px;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 20;
}

/* Mode Slider */
#authTabs .mode-slider {
  position: absolute;
  top: 4px; bottom: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
  transition: left 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.3s;
  pointer-events: none;
  z-index: 0;
}

#authTabs .auth-tab {
  flex: 1;
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--login-white-dim);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 12px;
  transition: color 0.2s;
  position: relative;
  z-index: 1;
}
#authTabs .auth-tab.active { color: var(--login-white); }

/* ── 玻璃卡片 ── */
.auth-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 320px;
  padding: 32px 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 -1px 0 rgba(0, 0, 0, 0.2) inset;
  animation: cardIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  margin: 0 16px;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 卡片顶部高光线 */
.auth-form::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  border-radius: 24px 24px 0 0;
}

/* Logo */
#login-page .logo {
  font-size: 56px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px; height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.6) 0%, rgba(59, 130, 246, 0.6) 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
  transition: transform 0.2s;
}
#login-page .logo:hover { transform: scale(1.05) rotate(5deg); }

/* 标题 */
#login-page h1 {
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
  color: var(--login-white);
  text-shadow: 0 1px 8px rgba(139, 92, 246, 0.4);
  animation: fadeSlide 0.25s ease-out;
}
#login-page .subtitle {
  font-size: 14px;
  color: var(--login-white-dim);
  text-align: center;
  margin-bottom: 24px;
  animation: fadeSlide 0.25s ease-out;
}

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

/* ── 表单输入 ── */
.auth-form .form-row {
  width: 100%;
  margin-bottom: 16px;
}

/* 玻璃输入框 */
.auth-form .glass-input {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 16px;
  overflow: visible; /* 浮动 label 需要 overflow visible */
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: all 0.2s;
}
.auth-form .glass-input.focused {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.6), 0 0 20px rgba(139, 92, 246, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 输入框内顶线装饰 */
.auth-form .input-top-line {
  position: absolute;
  top: 0; left: 16px; right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: background 0.2s;
  pointer-events: none;
}
.auth-form .glass-input.focused .input-top-line {
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.5), transparent);
}

/* 输入框图标 */
.auth-form .input-icon {
  padding: 0 8px 0 16px;
  color: rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  transition: color 0.2s;
  flex-shrink: 0;
}
.auth-form .glass-input.focused .input-icon { color: rgba(167, 139, 250, 0.85); }
.auth-form .input-icon svg { width: 16px; height: 16px; }

/* 输入框本身 */
.auth-form .glass-input input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 14px 12px;
  color: rgba(255, 255, 255, 0.9);
  caret-color: rgba(167, 139, 250, 0.9);
  font-size: 14px;
}
.auth-form .glass-input input::placeholder { color: transparent; }

/* 浮动 placeholder */
.auth-form .placeholder-float {
  position: absolute;
  left: 44px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.35);
  font-size: 14px;
  user-select: none;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.auth-form .glass-input input:focus ~ .placeholder-float,
.auth-form .glass-input input:not(:placeholder-shown) ~ .placeholder-float,
.auth-form .glass-input input:disabled ~ .placeholder-float {
  opacity: 0;
  transform: translateY(-50%) translateX(-4px);
  font-size: 12px;
}

/* 输入框右侧（密码眼睛） */
.auth-form .input-right {
  padding: 0 16px 0 4px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.auth-form .input-right svg {
  width: 16px; height: 16px;
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.15s;
}
.auth-form .input-right svg:hover { color: rgba(167, 139, 250, 0.9); }

/* ── 登录按钮 ── */
#login-page .btn-primary {
  position: relative;
  width: 100%;
  border-radius: 16px;
  padding: 14px;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.9) 0%, rgba(99, 102, 241, 0.9) 50%, rgba(59, 130, 246, 0.9) 100%);
  color: white;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(139, 92, 246, 0.45), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
  transition: box-shadow 0.2s, transform 0.15s;
}
#login-page .btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 32px rgba(139, 92, 246, 0.6), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
  transform: scale(1.02);
}
#login-page .btn-primary:active:not(:disabled) { transform: scale(0.98); }
#login-page .btn-primary:disabled { cursor: not-allowed; opacity: 0.8; }

/* 按钮内 shimmer 动画 */
#login-page .btn-primary .shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.15) 50%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}
#login-page .btn-primary:hover .shimmer { opacity: 1; }


/* ── Submit Button ── */
.auth-form .submit-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 14px 24px;
  margin-top: 24px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--login-purple) 0%, var(--login-blue) 100%);
  color: white;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}

.auth-form .submit-btn:hover:not(:disabled) {
  box-shadow: 0 6px 32px rgba(139, 92, 246, 0.6), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
  transform: scale(1.02);
}

.auth-form .submit-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.auth-form .submit-btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.auth-form .submit-btn .shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.15) 50%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

.auth-form .submit-btn:hover .shimmer {
  opacity: 1;
}

/* ── 按钮抖动 ── */
@keyframes btnShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.auth-form .submit-btn.shake {
  animation: btnShake 0.4s ease;
}

/* ── Auth Footer（忘记密码 / 游客） ── */
.auth-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  animation: fadeSlide 0.5s ease-out 0.3s both;
}
.auth-footer a,
.auth-footer #guest-link {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
  text-decoration: none;
}
.auth-footer a:hover,
.auth-footer #guest-link:hover {
  color: rgba(167, 139, 250, 0.9);
  transform: scale(1.05);
}
.auth-footer .auth-sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.2);
}

/* ── 注册提示 ── */
.auth-tip {
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 12px;
  margin-top: 12px;
}

/* ── Hidden ── */
#login-page .hidden { display: none !important; }

/* ── Spinner 动画 ── */
@keyframes loginSpin { to { transform: rotate(360deg); } }

/* ── 注册表单昵称行动画 ── */
.name-row {
  height: 0;
  overflow: hidden;
  opacity: 0;
  transition: height 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
  width: 100%;
}
.name-row.visible {
  height: auto;
  opacity: 1;
}

/* ── Tab 切换时的 shake 动画 ── */
@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.auth-form.shake { animation: loginShake 0.4s ease; }
/* ── 找回密码表单 ── */

/* 验证码 + 发送按钮同行: input 3/5, button 2/5 */
.auth-form .code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.auth-form .code-row .glass-input {
  flex: 3;
  min-width: 0;
}
.auth-form .code-row .reset-send-btn {
  flex: 2;
}

/* 发送验证码按钮（同行内嵌） */
.auth-form .reset-send-btn {
  flex-shrink: 0;
  height: 46px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.auth-form .reset-send-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(139, 92, 246, 0.5);
  color: rgba(167, 139, 250, 0.9);
}
.auth-form .reset-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 输入框禁用状态 */
.auth-form input:disabled {
  color: rgba(255, 255, 255, 0.3) !important;
  cursor: not-allowed;
}
.auth-form .glass-input.disabled {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  box-shadow: none !important;
  pointer-events: none;
}
.auth-form .glass-input.disabled .input-icon {
  color: rgba(255, 255, 255, 0.15) !important;
}
.auth-form .glass-input.disabled .input-top-line {
  opacity: 0.3;
}
