/* 从 Vue views/auth/index.vue 移植；类名前缀 auth- 避免污染全局 .container */
.auth-page-container {
  --auth-input-row-height: 55px;
  --auth-forms-shift-down: 110px;
  --auth-register-form-shift-y: -158px;
  --auth-brand: var(--color-vue-teal);
  --auth-brand-dark: var(--color-vue-teal-dark);
  position: relative;
  width: 100%;
  background-color: #fff;
  min-height: 100vh;
  overflow: hidden;
}

.auth-page-container::before {
  content: '';
  position: absolute;
  height: 2000px;
  width: 2000px;
  top: -10%;
  right: 48%;
  transform: translateY(-50%);
  background-image: linear-gradient(
    -45deg,
    var(--color-vue-teal) 0%,
    var(--color-vue-teal-dark) 100%
  );
  transition: 1.8s ease-in-out;
  border-radius: 50%;
  z-index: 6;
  pointer-events: none;
}

.auth-forms-container {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 10;
  pointer-events: none;
}

.auth-signin-signup {
  position: absolute;
  top: 50%;
  transform: translate(-50%, calc(-50% + var(--auth-forms-shift-down) + var(--auth-forms-shift-down)));
  left: 75%;
  width: 50%;
  transition: 1s 0.7s ease-in-out;
  display: grid;
  grid-template-columns: 1fr;
  z-index: 7;
  pointer-events: auto;
}

.auth-signin-signup form {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 0 5rem;
  transition: all 0.2s 0.7s;
  overflow: visible;
  grid-column: 1 / 2;
  grid-row: 1 / 2;
}

.auth-signin-signup form .auth-form-title {
  font-size: 2.2rem;
  color: #444;
  margin-bottom: 10px;
  font-weight: 600;
}

.auth-sign-up-form {
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

.auth-sign-in-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  z-index: 2;
  transform: translateY(var(--auth-register-form-shift-y));
}

.auth-sign-in-form {
  z-index: 2;
}

.auth-form-item {
  width: 430px;
  max-width: 100%;
  margin-bottom: 24px;
  position: relative;
}

.auth-form-item-error {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  padding-top: 6px;
  text-align: center;
  font-size: 12px;
  line-height: 1;
  color: #ed4014;
}

.auth-input-wrap {
  position: relative;
  width: 100%;
  color: #1a1a1a;
}

.auth-input-prefix {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  width: 55px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #acacac;
  pointer-events: none;
}

.auth-input-prefix svg {
  width: 24px;
  height: 24px;
}

.auth-input {
  width: 100%;
  height: 55px;
  border-radius: 55px;
  border: none;
  background-color: #f0f0f0;
  color: #1a1a1a;
  font-size: 18px;
  padding-left: 55px;
  padding-right: 16px;
  outline: none;
  box-sizing: border-box;
}

.auth-input::placeholder {
  color: #94a3b8;
}

.auth-input--suffix {
  padding-right: 72px;
}

.auth-input--password {
  padding-right: 48px;
}

.auth-password-toggle {
  position: absolute;
  right: 0;
  top: 0;
  z-index: 9;
  width: 48px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #808695;
  cursor: pointer;
  padding: 0;
}

.auth-password-toggle:hover {
  color: var(--auth-brand);
}

.auth-password-toggle:focus-visible {
  outline: 2px solid var(--auth-brand);
  outline-offset: -2px;
  border-radius: 55px;
}

.auth-input-suffix {
  position: absolute;
  right: 14px;
  top: 0;
  height: 55px;
  line-height: 55px;
  font-size: 14px;
  color: #808695;
  user-select: none;
}

.auth-form-item-error .auth-input-suffix {
  color: #ed4014;
}

.auth-code-field {
  position: relative;
  width: 100%;
}

.auth-code-field .auth-input-prefix {
  z-index: 5;
}

.auth-code-field .auth-input {
  /* 与 .auth-input 默认 padding-left: 55px 一致，保证图标区与占位符间距对齐 */
  position: relative;
  z-index: 1;
  padding-left: 55px;
  padding-right: 128px;
}

.auth-code-btn {
  position: absolute;
  right: 0;
  top: 0;
  z-index: 10;
  pointer-events: auto;
  width: 120px;
  height: 55px;
  line-height: 55px;
  border: none;
  border-radius: 55px;
  background: transparent;
  color: var(--auth-brand);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.auth-code-btn:disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.auth-btn {
  width: 150px;
  background-color: var(--color-vue-teal);
  border: none;
  outline: none;
  height: 49px;
  border-radius: 49px;
  color: #fff;
  text-transform: uppercase;
  font-weight: 600;
  margin: 10px 0;
  cursor: pointer;
  transition: 0.5s;
  font-size: 14px;
}

.auth-btn:hover:not(:disabled) {
  background-color: #2a8577;
}

.auth-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-social-text {
  font-size: 1rem;
  margin-bottom: 10px;
  cursor: pointer;
  color: #333;
  text-align: center;
  line-height: 1.5;
}

.auth-forgot-password-btn {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  position: relative;
  z-index: 3;
}

.auth-forgot-password-wrap {
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

.auth-social-text button.auth-link {
  padding: 0;
  margin: 0 2px;
  border: none;
  background: none;
  color: var(--auth-brand);
  font-size: 16px;
  cursor: pointer;
  text-decoration: underline;
}

.auth-social-text button.auth-link:hover {
  color: #237a6f;
}

.auth-panels-container {
  position: absolute;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  z-index: 11;
  pointer-events: none;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-around;
  text-align: center;
  z-index: 6;
  pointer-events: none;
}

.auth-panel .auth-panel-content {
  color: #fff;
  transition: transform 0.9s ease-in-out;
  transition-delay: 0.6s;
  pointer-events: auto;
}

.auth-panel h3 {
  font-weight: 600;
  line-height: 1;
  font-size: 1.5rem;
  margin: 0;
}

.auth-panel p {
  font-size: 0.95rem;
  padding: 0.7rem 0;
  margin: 0;
}

.auth-btn-transparent {
  margin: 0;
  background: none;
  border: 2px solid #fff;
  color: #fff;
  border-radius: 20px;
  width: 130px;
  height: 40px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  text-transform: none;
}

.auth-btn-transparent:hover {
  background: rgba(255, 255, 255, 0.12);
}

.auth-left-panel {
  pointer-events: none;
  padding: 3rem 17% 2rem 12%;
}

.auth-right-panel {
  pointer-events: none;
  padding: 3rem 12% 2rem 17%;
  align-items: flex-start;
}

.auth-right-panel .auth-panel-content {
  transform: translateX(800px);
}

/* 注册模式 */
.auth-page-container.sign-up-mode::before {
  transform: translate(100%, -50%);
  right: 52%;
}

.auth-page-container.sign-up-mode .auth-left-panel .auth-panel-content {
  transform: translateX(-800px);
}

.auth-page-container.sign-up-mode .auth-signin-signup {
  left: 25%;
}

.auth-page-container.sign-up-mode .auth-sign-up-form {
  opacity: 1;
  z-index: 2;
  transform: translateY(var(--auth-register-form-shift-y));
  pointer-events: auto;
}

.auth-page-container.sign-up-mode .auth-sign-in-panel {
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

.auth-page-container.sign-up-mode .auth-sign-in-form {
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

.auth-page-container.sign-up-mode .auth-right-panel {
  pointer-events: none;
}

.auth-page-container.sign-up-mode .auth-right-panel .auth-panel-content {
  transform: translateX(0);
}

.auth-page-container.sign-up-mode .auth-left-panel {
  pointer-events: none;
}

/* 忘记密码弹窗 */
.auth-forgot-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Playwright 实测：Tailwind -translate-x/y-1/2 在 Dialog Popup 上未生效，需 CSS 居中 */
.auth-forgot-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 101;
  margin: 0;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 24px 48px rgba(15, 23, 42, 0.2),
    0 8px 20px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(15, 23, 42, 0.08);
  isolation: isolate;
}

.auth-forgot-modal [data-slot='dialog-header'] {
  background: #fff;
}

.auth-forgot-modal [data-slot='dialog-footer'] {
  background: #fff;
}

.auth-forgot-dialog-content {
  padding: 8px 0 0;
}

.auth-forgot-dialog-content .auth-form-item {
  width: 100%;
}

.auth-forgot-verify-actions {
  display: flex;
  width: 100%;
  gap: 12px;
  justify-content: flex-end;
}

.auth-forgot-btn {
  min-width: 96px;
  height: 40px;
  padding: 0 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.auth-forgot-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-forgot-btn--ghost {
  background: #f0f0f0;
  color: #444;
}

.auth-forgot-btn--ghost:hover:not(:disabled) {
  background: #e4e4e4;
}

.auth-forgot-btn--primary {
  background-color: var(--color-vue-teal);
  color: #fff;
}

.auth-forgot-btn--primary:hover:not(:disabled) {
  background-color: #2a8577;
}

/* ≤870px */
@media (max-width: 870px) {
  .auth-page-container {
    min-height: 800px;
    height: 100vh;
  }

  .auth-page-container::before {
    width: 1500px;
    height: 1500px;
    transform: translateX(-50%);
    left: 30%;
    bottom: 68%;
    right: initial;
    top: initial;
    transition: 2s ease-in-out;
  }

  .auth-page-container.sign-up-mode::before {
    transform: translate(-50%, 100%);
    bottom: 32%;
    right: initial;
  }

  .auth-page-container.sign-up-mode .auth-left-panel .auth-panel-content {
    transform: translateY(-300px);
  }

  .auth-page-container.sign-up-mode .auth-right-panel .auth-panel-content {
    transform: translateY(0);
  }

  .auth-signin-signup {
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    width: 430px;
    max-width: calc(100vw - 24px);
    top: 5%;
    transform: translateY(calc(2 * var(--auth-forms-shift-down)));
    transition: 1s 0.8s ease-in-out;
    box-sizing: border-box;
  }

  .auth-signin-signup form {
    width: 100%;
    margin: 0 auto;
    padding: 0 !important;
    box-sizing: border-box;
  }

  .auth-form-item {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .auth-panels-container {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 2fr 1fr;
  }

  .auth-panel {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 2.5rem 0;
    grid-column: 1 / 2;
  }

  .auth-panel .auth-panel-content {
    width: 430px;
    max-width: calc(100vw - 24px);
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition-delay: 0.8s;
  }

  .auth-panel h3 {
    font-size: 1.2rem;
  }

  .auth-panel p {
    font-size: 0.7rem;
    padding: 0.5rem 0;
  }

  .auth-btn-transparent {
    width: 110px;
    height: 35px;
    font-size: 0.7rem;
  }

  .auth-right-panel {
    grid-row: 3 / 4;
  }

  .auth-right-panel .auth-panel-content {
    transform: translateY(300px);
  }

  .auth-left-panel {
    grid-row: 1 / 2;
  }
}

@media (max-width: 570px) {
  .auth-signin-signup form {
    padding: 0;
    max-width: 430px;
    margin-left: auto;
    margin-right: auto;
  }

  .auth-panel .auth-panel-content {
    padding: 0.5rem 0;
  }

  .auth-page-container {
    padding: 1.5rem 0;
  }

  .auth-page-container::before {
    bottom: 72%;
    left: 50%;
  }

  .auth-page-container.sign-up-mode::before {
    bottom: 28%;
    left: 50%;
  }
}

@media (max-width: 480px) {
  .auth-panel {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .auth-signin-signup form .auth-form-title {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
  }

  .auth-social-text {
    font-size: clamp(0.85rem, 3.5vw, 1rem);
  }

  .auth-social-text button.auth-link {
    font-size: clamp(13px, 3.5vw, 16px);
  }
}

