/* Page styles for login/register */

html {
  background-color: var(--brand-canvas);
  height: 100%;
  overflow: hidden;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  background: transparent !important;
  background-color: transparent !important;
  height: 100%;
  overflow: hidden;
}

main {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
}
.aurora::before,
.aurora::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}
.aurora::before {
  width: 42vw; height: 42vw;
  top: -12vw; right: -8vw;
  background: radial-gradient(circle, rgba(220, 222, 228, 0.14), transparent 60%);
  animation: aurora-drift 22s ease-in-out infinite;
}
.aurora::after {
  width: 38vw; height: 38vw;
  bottom: -14vw; left: -10vw;
  background: radial-gradient(circle, rgba(120, 123, 132, 0.12), transparent 60%);
  animation: aurora-drift 26s ease-in-out infinite reverse;
}
@keyframes aurora-drift {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(6vw,4vh,0) scale(1.15); }
}

.bg-layer {
    position: fixed;
    inset: 0;
    background-image: url('/res/img/backup.jpeg');
    background-size: cover;
    background-position: center;
    opacity: 0.16;
    z-index: -2;
    transform: scale(1.05);
}

.acrylic-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(11,13,18,0.55) 0%, rgba(11,13,18,0.82) 60%, rgba(11,13,18,0.94) 100%);
    backdrop-filter: blur(4px) saturate(1.1);
    -webkit-backdrop-filter: blur(4px) saturate(1.1);
    z-index: -1;
}

.grid-texture {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 70%);
  pointer-events: none;
}

.auth-panel {
  --lg-radius: var(--brand-radius-lg);
  position: relative;
  display: flex;
  width: 75%;
  height: 80vh;
  max-width: 100%;
  max-height: calc(100vh - 2rem);
  min-height: 520px;
  background-color: var(--brand-card);
  color: var(--brand-card-foreground);
  border-radius: var(--lg-radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), var(--brand-floating-shadow);
  overflow: hidden;
}

/* SVG 折射滤镜容器：铺满玻璃本体，定义位移/色差滤镜 */
.lg-filter {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* 扭曲层（磨砂玻璃）：对背后背景做背景模糊 */
.glass-warp {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
}

/* 内容层保持清晰锐利 */
.auth-panel > .auth-left,
.auth-panel > .auth-right {
  position: relative;
  z-index: 1;
}

.auth-left {
  flex: 0 1 45%;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 3rem 2rem;
  background-color: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

/* 液态玻璃高光边框：两层渐变，随鼠标方向旋转 */
.lg-border {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: var(--lg-radius);
  padding: 1.5px;
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.22) inset,
    0 1px 3px rgba(255, 255, 255, 0.12) inset,
    0 1px 4px rgba(0, 0, 0, 0.35);
}

.lg-border--screen {
  mix-blend-mode: screen;
  opacity: 0.14;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.10) 33%,
    rgba(255, 255, 255, 0.30) 66%,
    rgba(255, 255, 255, 0) 100%);
}

.lg-border--overlay {
  mix-blend-mode: overlay;
  opacity: 0.5;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.18) 38%,
    rgba(255, 255, 255, 0.38) 68%,
    rgba(255, 255, 255, 0) 100%);
}

@font-face {
  font-family: 'MClogo';
  src: url('/res/Font/MClogo.ttf') format('truetype');
  font-display: swap;
  font-weight: normal;
  font-style: normal;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.auth-logo {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.auth-welcome-title {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 400;
  font-family: 'MClogo', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--brand-foreground);
}

.auth-welcome-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--brand-muted-foreground);
}

/* 最大正方形，左右各 5 间隙（合计 10），垂直居中 */
.auth-middle {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.auth-tile {
  position: relative;
  width: 80%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.auth-tile-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
}

.auth-tile-rain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
}

.auth-right {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 2rem;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.auth-right::-webkit-scrollbar {
  display: none;
}

.auth-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--brand-border);
}

.auth-tab {
  position: relative;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--brand-muted-foreground);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.auth-tab:hover {
  color: var(--brand-foreground);
}

.auth-tab:focus-visible {
  outline: none;
  color: var(--brand-primary);
}

.auth-tab.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.auth-form-switch {
  position: relative;
  transition: height 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-form {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.3s;
}

.auth-form.active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--brand-foreground);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
  border: 1px solid var(--brand-input);
  border-radius: var(--brand-radius-md);
  background-color: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrap:focus-within {
  border-color: var(--brand-ring);
  box-shadow: 0 0 0 2px var(--brand-ring-alpha);
}

.input-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-left: 0.75rem;
  color: var(--brand-muted-foreground);
}

.input-wrap input {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  padding: 0 0.75rem;
  font-size: 0.9375rem;
  color: var(--brand-foreground);
  background: transparent;
  border: none;
  outline: none;
}

.input-wrap input::placeholder {
  color: var(--brand-muted-foreground);
}

/* 禁用浏览器自动填充带来的不透明白色背景，保持玻璃半透明样式 */
.input-wrap input:-webkit-autofill,
.input-wrap input:-webkit-autofill:hover,
.input-wrap input:-webkit-autofill:focus,
.input-wrap input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--brand-foreground) !important;
  -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.04) inset !important;
  box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.04) inset !important;
  caret-color: var(--brand-foreground);
  transition: background-color 50000s ease-in-out 0s;
}

.toggle-password,
.code-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.25rem;
  padding: 0 0.75rem;
  height: 36px;
  font-size: 0.875rem;
  border-radius: var(--brand-radius-sm);
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}

.toggle-password {
  background: transparent;
  border: none;
  color: var(--brand-muted-foreground);
}

.toggle-password:hover {
  color: var(--brand-foreground);
  background-color: var(--brand-muted);
}

.toggle-password .input-icon {
  margin: 0;
}

.toggle-password .icon-eye-off { display: none; }
.toggle-password.viewing .icon-eye { display: none; }
.toggle-password.viewing .icon-eye-off { display: block; }

.code-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.code-row .input-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.code-btn {
  flex: 0 0 auto;
  height: 44px;
  margin: 0;
  padding: 0 1rem;
  background: linear-gradient(180deg, #3d4149 0%, #262a32 100%);
  color: #f5f5f7;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.code-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.code-btn:disabled {
  background-color: var(--brand-muted);
  color: var(--brand-muted-foreground);
  cursor: not-allowed;
}

/* 协议复选框 */
.agreement-field {
  display: flex;
  align-items: center;
}

.agree-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--brand-muted-foreground);
  cursor: pointer;
  user-select: none;
}

.agree-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.agree-label .check {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.agree-label .check::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 5px;
  border-left: 2px solid #0d1b17;
  border-bottom: 2px solid #0d1b17;
  transform: translate(-50%, -60%) rotate(-45deg) scale(0);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.agree-label input[type="checkbox"]:checked + .check {
  background: #49d4c0;
  border-color: #49d4c0;
  box-shadow: 0 0 10px rgba(73, 212, 192, 0.45);
  transform: scale(1.06);
}

.agree-label input[type="checkbox"]:checked + .check::after {
  transform: translate(-50%, -60%) rotate(-45deg) scale(1);
  opacity: 1;
}

.agree-label input[type="checkbox"]:focus-visible + .check {
  outline: 2px solid #4da3ff;
  outline-offset: 2px;
}

.agree-label:hover .check {
  border-color: rgba(255, 255, 255, 0.45);
}

.agree-label a {
  color: #4da3ff;
  text-decoration: none;
}

.agree-label a:hover {
  color: #6db7ff;
  text-decoration: underline;
}

.submit-btn {
  width: 100%;
  height: 44px;
  margin-top: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #f5f5f7;
  background: linear-gradient(180deg, #3d4149 0%, #262a32 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--brand-radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 8px -3px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: filter 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.submit-btn:hover {
  filter: brightness(1.08);
}

.submit-btn:active {
  transform: translateY(1px);
}

.submit-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

@media (max-width: 860px) {
  .auth-panel {
    width: 100%;
    height: auto;
    min-height: 520px;
    max-height: calc(100vh - 2rem);
    flex-direction: column;
  }

  .auth-left {
    flex: 0 0 auto;
    padding: 1.5rem;
    text-align: center;
  }

  .auth-welcome-title {
    font-size: 1.5rem;
  }

  .auth-right {
    padding: 1.5rem;
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  main {
    padding: 0.5rem;
  }

  .auth-panel {
    border-radius: var(--brand-radius-md);
    max-height: calc(100vh - 1rem);
  }

  .auth-left {
    padding: 1rem;
  }

  .auth-right {
    padding: 1rem;
  }

  .code-btn {
    padding: 0 0.5rem;
    font-size: 0.8125rem;
  }
}

