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

.auth-flip-page {
  --auth-input-focus: #c2410c;
  --auth-font-color: #1a1a1a;
  --auth-font-color-sub: #6b7280;
  --auth-bg-color: #e8eaed;
  --auth-main-color: #d97706;
  --auth-shadow: #92400e;
  --auth-page-text: #f3f4f6;
  --auth-page-muted: #9ca3af;
  --auth-card-bg: #d1d5db;
}

.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.5rem 1.5rem;
  max-width: 420px;
  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: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--auth-main-color);
  box-shadow: 3px 3px var(--auth-shadow);
  background: var(--auth-bg-color);
}

.auth-flip-wrapper .login-header h1 {
  font-size: 1.75rem;
  color: var(--auth-main-color);
  font-weight: 900;
  margin: 0;
  line-height: 1.15;
}

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

.auth-flip-wrapper .message {
  width: min(340px, 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.25rem 0 1.25rem;
  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: 50px;
  height: 24px;
  box-sizing: border-box;
  border-radius: 5px;
  border: 2px solid var(--auth-main-color);
  box-shadow: 4px 4px var(--auth-shadow);
  background: var(--auth-bg-color);
  cursor: pointer;
  transition: background 0.3s;
  flex-shrink: 0;
}

.auth-flip-track::before {
  content: "";
  position: absolute;
  box-sizing: border-box;
  height: 20px;
  width: 20px;
  border: 2px solid var(--auth-main-color);
  border-radius: 5px;
  left: 0;
  top: 0;
  background: var(--auth-bg-color);
  box-shadow: 0 3px 0 var(--auth-shadow);
  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(26px);
}

/* 3D scene */
.auth-flip-scene {
  width: min(340px, 100%);
  min-height: 380px;
  perspective: 1200px;
}

.auth-flip-inner {
  position: relative;
  width: 100%;
  min-height: 420px;
  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;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.85rem;
  padding: 1.35rem 1.15rem 1.25rem;
  box-sizing: border-box;
  border-radius: 5px;
  border: 2px solid var(--auth-main-color);
  box-shadow: 4px 4px var(--auth-shadow);
  background: var(--auth-card-bg);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.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: 40px;
  border-radius: 5px;
  border: 2px solid var(--auth-main-color);
  background: #ffffff;
  box-shadow: 4px 4px var(--auth-shadow);
  font-size: 0.92rem;
  font-weight: 600;
  color: #111111;
  padding: 5px 10px;
  outline: none;
  box-sizing: border-box;
  -webkit-text-fill-color: #111111;
}

.auth-flip-form input::placeholder {
  color: #111111 !important;
  opacity: 0.72;
  font-weight: 600;
  -webkit-text-fill-color: #111111;
}

.auth-flip-form input:focus {
  border-color: var(--auth-input-focus);
}

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

.auth-flip-forgot a {
  font-size: 0.82rem;
  color: var(--auth-input-focus);
  text-decoration: none;
  font-weight: 600;
}

.auth-flip-forgot a:hover {
  text-decoration: underline;
}

.auth-flip-btn,
.auth-flip-form .btn-primary {
  margin: 0.55rem auto 0.15rem;
  width: 140px;
  height: 42px;
  border-radius: 5px;
  border: 2px solid var(--auth-main-color);
  background: var(--auth-main-color);
  box-shadow: 4px 4px var(--auth-shadow);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-flip-btn:hover,
.auth-flip-form .btn-primary:hover {
  transform: none;
  box-shadow: 4px 4px var(--auth-shadow);
  background: var(--auth-input-focus);
  color: #fff;
}

.auth-flip-btn:active,
.auth-flip-form .btn-primary:active {
  box-shadow: 0 0 var(--auth-shadow);
  transform: translate(3px, 3px);
}

.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-inner {
    min-height: 440px;
  }

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

@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;
}

html.app-client .auth-flip-page .auth-flip-face,
html.in-huytech-app .auth-flip-page .auth-flip-face {
  background: #d1d5db !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: #111111 !important;
  background: #ffffff !important;
  border-color: #d97706 !important;
  -webkit-text-fill-color: #111111 !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: #111111 !important;
  opacity: 0.72 !important;
  -webkit-text-fill-color: #111111 !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: block !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: none !important;
}
