/* Auth flip card — adapted from Uiverse.io (andrew-demchenk0) */

.auth-flip-page {
  --auth-input-focus: #f59e0b;
  --auth-font-color: #f4efe8;
  --auth-font-color-sub: #9ca3af;
  --auth-bg-color: rgba(18, 16, 14, 0.62);
  --auth-main-color: #d97706;
  --auth-shadow: rgba(0, 0, 0, 0.45);
  --auth-page-text: #f3f4f6;
  --auth-page-muted: #9ca3af;
  --auth-card-bg: rgba(18, 16, 14, 0.62);
}

.login-container.auth-flip-page {
  background:
    radial-gradient(ellipse at 18% 12%, rgba(217, 119, 6, 0.2), transparent 42%),
    radial-gradient(ellipse at 85% 88%, rgba(194, 65, 12, 0.14), transparent 40%),
    linear-gradient(160deg, #000000 0%, #0a0a0a 55%, #111111 100%);
}

.login-container.auth-flip-page .login-box {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding: 1rem 0.75rem 1.5rem;
  max-width: 780px !important;
  width: 100%;
}

.auth-flip-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.auth-flip-wrapper .login-header {
  margin-bottom: 1rem;
}

.auth-flip-wrapper .auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}

.auth-flip-wrapper .auth-brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.auth-flip-wrapper .login-header h1 {
  font-size: 1.75rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.15;
}

.auth-flip-wrapper .login-header p {
  color: var(--auth-page-muted);
}

.auth-flip-wrapper .message {
  width: 100%;
  box-sizing: border-box;
}

.auth-flip-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Login / Sign up switch */
.auth-flip-switch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin: 0 0 0.85rem;
  user-select: none;
  min-height: 2rem;
}

.auth-flip-side {
  min-width: 4.75rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--auth-page-muted);
  text-decoration: none;
  transition: font-size 0.25s ease, color 0.25s ease, font-weight 0.25s ease, text-decoration 0.2s ease;
  line-height: 1.1;
}

/* 默认登录态：登录更大 */
.auth-flip-side--login {
  font-size: 1.35rem;
  font-weight: 900;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.auth-flip-side--register {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--auth-page-muted);
}

.auth-flip-toggle:checked ~ .auth-flip-switch .auth-flip-side--login {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--auth-page-muted);
  text-decoration: none;
}

.auth-flip-toggle:checked ~ .auth-flip-switch .auth-flip-side--register {
  font-size: 1.35rem;
  font-weight: 900;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.auth-flip-track {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
  box-sizing: border-box;
  border-radius: 999px;
  border: 1px solid rgba(198, 198, 198, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  background: rgba(8, 8, 8, 0.55);
  cursor: pointer;
  transition: background 0.3s;
  flex-shrink: 0;
}

.auth-flip-track::before {
  content: "";
  position: absolute;
  box-sizing: border-box;
  height: 18px;
  width: 18px;
  border: 0;
  border-radius: 50%;
  left: 2px;
  top: 2px;
  background: #f4efe8;
  box-shadow: none;
  transition: transform 0.3s;
}

.auth-flip-toggle:checked ~ .auth-flip-switch .auth-flip-track {
  background: var(--auth-main-color);
}

.auth-flip-toggle:checked ~ .auth-flip-switch .auth-flip-track::before {
  transform: translateX(22px);
}

/* 3D scene */
.auth-flip-scene {
  width: 100%;
  height: 210px;
  perspective: 1200px;
  transition: height 0.35s ease;
  overflow: hidden;
}

.auth-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  text-align: center;
  transition: transform 0.75s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}

.auth-flip-inner.is-flipping {
  pointer-events: none;
}

.auth-flip-toggle:checked ~ .auth-flip-scene .auth-flip-inner {
  transform: rotateY(180deg);
}

.auth-flip-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.7rem;
  padding: 0.15rem 0 0;
  box-sizing: border-box;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  overflow: hidden;
}

.auth-flip-back {
  transform: rotateY(180deg);
}

.auth-flip-title {
  margin: 0.35rem 0 0.5rem;
  font-size: 1.45rem;
  font-weight: 900;
  text-align: center;
  color: var(--auth-main-color);
}

.auth-flip-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
}

.auth-flip-form .form-group {
  margin-bottom: 0;
  text-align: left;
}

/* 只保留输入框内占位文案，去掉上方重复 label */
.auth-flip-form .form-group > label {
  display: none !important;
}

.auth-flip-input,
.auth-flip-form input[type="text"],
.auth-flip-form input[type="email"],
.auth-flip-form input[type="tel"],
.auth-flip-form input[type="password"] {
  width: 100%;
  height: 42px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: #f4efe8;
  padding: 0 12px;
  outline: none;
  box-sizing: border-box;
  -webkit-text-fill-color: #f4efe8;
}

.auth-flip-form input::placeholder {
  color: rgba(244, 239, 232, 0.45) !important;
  opacity: 1;
  font-weight: 500;
  -webkit-text-fill-color: rgba(244, 239, 232, 0.45);
}

.auth-flip-form input:focus {
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18);
}

.auth-flip-forgot {
  text-align: right;
  margin-top: 0.35rem;
}

.auth-flip-forgot a {
  font-size: 0.82rem;
  color: #fbbf24;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 700;
}

.auth-flip-forgot a:hover {
  color: #fde68a;
}

.auth-flip-btn,
.auth-flip-form .btn-primary {
  margin: 0.45rem 0 0;
  width: 100%;
  height: 42px;
  border-radius: 8px;
  border: 1px solid #d97706;
  background: #d97706;
  box-shadow: none;
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.auth-flip-btn:hover,
.auth-flip-form .btn-primary:hover {
  transform: none;
  box-shadow: none;
  background: #c2410c;
  border-color: #c2410c;
  color: #fff;
}

.auth-flip-btn:active,
.auth-flip-form .btn-primary:active {
  box-shadow: none;
  transform: none;
}

.auth-flip-btn:disabled,
.auth-flip-form .btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.auth-flip-form .loading-spinner {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

.auth-flip-wrapper .form-footer {
  margin-top: 1.35rem;
  color: var(--auth-page-muted);
}

.auth-flip-wrapper .form-footer a {
  color: var(--auth-main-color);
}

.auth-flip-wrapper .form-footer a:hover {
  color: #f59e0b;
}

@media (max-width: 420px) {
  .auth-flip-scene {
    width: 100%;
  }

  .auth-flip-face {
    padding: 1rem 0.95rem 0.95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-flip-inner {
    transition: none;
  }

  .auth-flip-side {
    transition: none;
  }
}

/* Power Lab / App 跳转进来时，强制与官网翻转登录一致，不被 app-client 旧壳盖掉 */
html.app-client .login-container.auth-flip-page,
html.in-huytech-app .login-container.auth-flip-page {
  background:
    radial-gradient(ellipse at 18% 12%, rgba(217, 119, 6, 0.2), transparent 42%),
    radial-gradient(ellipse at 85% 88%, rgba(194, 65, 12, 0.14), transparent 40%),
    linear-gradient(160deg, #000000 0%, #0a0a0a 55%, #111111 100%) !important;
  background-image:
    radial-gradient(ellipse at 18% 12%, rgba(217, 119, 6, 0.2), transparent 42%),
    radial-gradient(ellipse at 85% 88%, rgba(194, 65, 12, 0.14), transparent 40%),
    linear-gradient(160deg, #000000 0%, #0a0a0a 55%, #111111 100%) !important;
}

html.app-client .auth-flip-page .login-box,
html.in-huytech-app .auth-flip-page .login-box {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: inherit !important;
  max-width: 780px !important;
}

html.app-client .auth-flip-page .auth-flip-face,
html.in-huytech-app .auth-flip-page .auth-flip-face {
  background: transparent !important;
  border-color: transparent !important;
}

html.app-client .auth-flip-page .auth-flip-input,
html.app-client .auth-flip-page .auth-flip-form input,
html.in-huytech-app .auth-flip-page .auth-flip-input,
html.in-huytech-app .auth-flip-page .auth-flip-form input {
  color: #f4efe8 !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  box-shadow: none !important;
  -webkit-text-fill-color: #f4efe8 !important;
}

html.app-client .auth-flip-page .auth-flip-form input::placeholder,
html.in-huytech-app .auth-flip-page .auth-flip-form input::placeholder {
  color: rgba(244, 239, 232, 0.45) !important;
  opacity: 1 !important;
  -webkit-text-fill-color: rgba(244, 239, 232, 0.45) !important;
}

html.app-client .auth-flip-page .auth-flip-forgot a,
html.in-huytech-app .auth-flip-page .auth-flip-forgot a {
  color: #fbbf24 !important;
}

html.app-client .auth-flip-page .form-group > label,
html.in-huytech-app .auth-flip-page .form-group > label {
  display: none !important;
}

html.app-client .auth-flip-page .form-footer.web-only-nav,
html.in-huytech-app .auth-flip-page .form-footer.web-only-nav {
  display: none !important;
}

html.app-client .auth-flip-page .form-footer.app-only-nav,
html.in-huytech-app .auth-flip-page .form-footer.app-only-nav {
  display: block !important;
  position: relative;
  z-index: 20;
}

.auth-dual {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.05fr);
  align-items: stretch;
  width: 100%;
  margin-top: 0.35rem;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 16, 14, 0.55);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.auth-dual-qr,
.auth-dual-account {
  padding: 1.35rem 1.45rem 1.45rem;
  min-width: 0;
}

.auth-dual-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.6rem 1.2rem 1.5rem;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(22, 119, 255, 0.2), transparent 62%),
    transparent;
}

.auth-dual-account {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-dual-rule {
  position: relative;
  width: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.auth-dual-rule span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #141210;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--auth-page-muted);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alipay-scan {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
}

.alipay-lockup {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.alipay-lockup-mark {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: #1677FF;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  line-height: 42px;
  text-align: center;
  flex-shrink: 0;
}

.alipay-lockup-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.alipay-lockup-cn {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fff;
}

.alipay-lockup-en {
  margin-top: 0.12rem;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.34em;
  color: rgba(255, 255, 255, 0.62);
}

.alipay-qr-logo {
  display: none;
}

.alipay-scan-well {
  position: relative;
  display: grid;
  place-items: center;
  width: 212px;
  height: 212px;
  border-radius: 28px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(180deg, rgba(22, 119, 255, 0.55), rgba(255, 255, 255, 0.08)) border-box;
  border: 1px solid transparent;
  box-shadow:
    0 0 0 8px rgba(22, 119, 255, 0.08),
    0 22px 48px rgba(22, 119, 255, 0.16);
}

.alipay-qrcode {
  width: 184px;
  height: 184px;
  padding: 0;
  background: transparent;
  border-radius: 12px;
  overflow: hidden;
}

.alipay-qrcode img,
.alipay-qrcode canvas {
  display: block;
  width: 184px;
  height: 184px;
  border-radius: 12px;
}

.alipay-scan-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38px;
  height: 38px;
  transform: translate(-50%, -50%);
  border-radius: 11px;
  background: #1677FF;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  line-height: 38px;
  text-align: center;
  letter-spacing: 0;
  box-shadow: 0 0 0 5px #fff;
  pointer-events: none;
}

.alipay-qr-hint {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(244, 239, 232, 0.62);
}

.alipay-qr-refresh {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 2;
  border: 0;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  background: rgba(17, 17, 17, 0.78);
  color: #fbbf24;
  font-size: 12px;
  cursor: pointer;
}

@media (max-width: 720px) {
  .login-container.auth-flip-page .login-box {
    max-width: 420px;
  }

  .auth-dual {
    grid-template-columns: 1fr;
  }

  .auth-dual-rule {
    width: auto;
    height: 1px;
    margin: 0 1.4rem;
  }

  .auth-dual-qr {
    padding-bottom: 0.35rem;
  }

  .auth-dual-account {
    padding-top: 1rem;
  }
}

.auth-enter[hidden] {
  display: none !important;
}

.auth-enter {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 clamp(1.5rem, 8vw, 4.5rem);
  background: #121212;
  color: #f6f3ee;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.auth-enter::before,
.auth-enter::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(90px);
}

.auth-enter::before {
  width: min(70vw, 560px);
  height: min(70vw, 560px);
  left: 12%;
  top: 6%;
  background: radial-gradient(circle, rgba(212, 165, 116, 0.28) 0%, transparent 68%);
}

.auth-enter::after {
  width: min(48vw, 420px);
  height: min(48vw, 420px);
  right: 8%;
  bottom: 10%;
  background: radial-gradient(circle, rgba(22, 119, 255, 0.12) 0%, transparent 70%);
}

.auth-enter.is-on {
  opacity: 1;
  pointer-events: auto;
}

.auth-enter-kicker {
  position: relative;
  z-index: 1;
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #d4a574;
  animation: auth-enter-kicker 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-enter-title {
  position: relative;
  z-index: 1;
  margin: 0;
  padding-bottom: 0.42em;
  font-size: clamp(2.1rem, 6vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: #f6f3ee;
  animation: auth-enter-title 0.95s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-enter-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.08em;
  width: min(12rem, 100%);
  height: 1.5px;
  border-radius: 1px;
  background: linear-gradient(90deg, #d4a574, rgba(212, 165, 116, 0));
  transform: scaleX(0);
  transform-origin: left center;
  animation: auth-enter-rule 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.28s both;
}

body.auth-entering {
  overflow: hidden;
}

@keyframes auth-enter-kicker {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes auth-enter-title {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes auth-enter-rule {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
