/* 登录页 — Figma 148-1409，布局与交互自洽 */

.login-page {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  background: #e9f0fc;
  color: #101828;
}

.login-page *,
.login-page *::before,
.login-page *::after {
  box-sizing: border-box;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(680px, 48vw);
  min-height: 100vh;
}

/* ── 左侧 ── */
.login-left {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px 64px;
  min-height: 100vh;
}

.login-left-bg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 140%;
  max-width: 1200px;
  aspect-ratio: 1.05;
  transform: translate(-58%, -52%);
  pointer-events: none;
  z-index: 0;
  object-fit: contain;
  animation: login-bg-drift 20s ease-in-out infinite;
}

.login-left-logo {
  position: absolute;
  z-index: 1;
  top: 40px;
  left: 48px;
  width: 100px;
  height: 90px;
  object-fit: contain;
  animation: login-logo-enter 0.7s ease-out both;
}

.login-left-illus {
  position: relative;
  z-index: 1;
  width: min(560px, 78%);
  margin: 0 auto 24px;
  animation: login-illus-enter 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.login-illus-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(40px);
}

.login-illus-glow--1 {
  width: 55%;
  height: 45%;
  left: 10%;
  top: 20%;
  background: rgba(43, 127, 255, 0.22);
  animation: login-glow-float 6s ease-in-out infinite;
}

.login-illus-glow--2 {
  width: 40%;
  height: 38%;
  right: 8%;
  bottom: 18%;
  background: rgba(20, 184, 166, 0.18);
  animation: login-glow-float 7s ease-in-out infinite reverse;
}

.login-left-illus img,
.login-illus-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  border-radius: 22px;
  filter: drop-shadow(10px 18px 26px rgba(42, 122, 227, 0.18));
  animation: login-illus-float 5.5s ease-in-out infinite, login-illus-shadow 5.5s ease-in-out infinite;
}

.login-left-copy {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 400px;
  animation: login-copy-enter 0.8s ease-out 0.35s both;
}

@keyframes login-bg-drift {
  0%,
  100% {
    transform: translate(-58%, -52%) scale(1);
  }
  50% {
    transform: translate(-55%, -55%) scale(1.03);
  }
}

@keyframes login-logo-enter {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes login-illus-enter {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes login-illus-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

@keyframes login-illus-shadow {
  0%,
  100% {
    filter: drop-shadow(6px 8px 14px rgba(42, 122, 227, 0.14));
  }
  50% {
    filter: drop-shadow(10px 16px 28px rgba(42, 122, 227, 0.22));
  }
}

@keyframes login-glow-float {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1) translate(0, 0);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.12) translate(6px, -8px);
  }
}

@keyframes login-copy-enter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-left-bg,
  .login-left-logo,
  .login-left-illus,
  .login-left-copy,
  .login-illus-img,
  .login-illus-glow {
    animation: none !important;
  }
}

.login-left-copy h1 {
  margin: 0 0 8px;
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 600;
  line-height: 1.3;
  color: #101828;
}

.login-left-copy p {
  margin: 0;
  font-size: clamp(13px, 1.15vw, 16px);
  line-height: 1.5;
  color: #4a5565;
}

/* ── 右侧表单区 ── */
.login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: #fff;
  min-height: 100vh;
  overflow-y: auto;
}

.login-form-column {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.login-form-header h2 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.3;
  color: #101828;
}

.login-form-header p {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.5;
  color: #4a5565;
}

/* Tab */
.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 40px;
  padding: 3px;
  margin-bottom: 24px;
  background: #ececf0;
  border-radius: 8px;
}

.login-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #4a5565;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.login-tab-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.login-tab.is-active {
  background: #fff;
  color: #101828;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.login-tab:hover:not(.is-active) {
  color: #101828;
}

/* 错误 */
.login-error {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.45;
}

.login-error[hidden] {
  display: none !important;
}

/* 表单 */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-form-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-panel[hidden] {
  display: none !important;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field label {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: #364153;
}

.login-input-wrap {
  position: relative;
}

/* 统一控件：输入框 & 下拉触发器 */
.login-input-wrap input,
.login-dropdown-trigger {
  display: block;
  width: 100%;
  height: 44px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  font-size: 14px;
  font-family: inherit;
  color: #101828;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.login-input-wrap input {
  padding: 0 40px;
  appearance: none;
}

.login-dropdown-trigger {
  display: flex;
  align-items: center;
  padding: 0 36px 0 40px;
  text-align: left;
  cursor: pointer;
}

.login-dropdown-trigger.is-placeholder .login-dropdown-label {
  color: #717182;
  font-weight: 400;
}

.login-dropdown-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
  line-height: 1.4;
}

.login-dropdown-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23717182' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.2s;
}

.login-input-wrap--dropdown.is-open .login-dropdown-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.login-input-wrap--dropdown.is-open .login-dropdown-trigger,
.login-input-wrap input:focus {
  border-color: #2b7fff;
  box-shadow: 0 0 0 3px rgba(43, 127, 255, 0.12);
  background: #fff;
}

.login-input-wrap--dropdown .login-dropdown-trigger:hover:not(:focus) {
  border-color: #d1d5db;
  background: #fff;
}

/* 下拉面板 */
.login-dropdown-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

.login-dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

.login-dropdown-menu::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: #d1d5db;
}

.login-dropdown-menu[hidden] {
  display: none !important;
}

.login-dropdown-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.4;
  color: #101828;
  cursor: pointer;
  transition: background 0.12s;
}

.login-dropdown-option:hover:not(.is-disabled) {
  background: #f2f8ff;
}

.login-dropdown-option.is-selected:not(.is-disabled) {
  background: #eef5ff;
  color: #1a56db;
  font-weight: 500;
}

.login-dropdown-option.is-disabled {
  color: #9ca3af;
  background: transparent;
  cursor: not-allowed;
  pointer-events: auto;
}

.login-dropdown-option.is-disabled:hover {
  background: transparent;
}

.login-dropdown-tag {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 4px;
  background: #eceef2;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 400;
}

.login-input-wrap--has-toggle input {
  padding-right: 40px;
}

.login-input-wrap input::placeholder {
  color: #717182;
}

.login-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.login-icon-user {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234a5565' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.5 20.25a8.25 8.25 0 0115 0'/%3E%3C/svg%3E");
}

.login-icon-platform {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234a5565' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 6.878V6a2.25 2.25 0 012.25-2.25h7.5A2.25 2.25 0 0118 6v.878m-12 0c.235-.083.487-.128.75-.128h10.5c.263 0 .515.045.75.128m-12 0A2.25 2.25 0 004.5 9v9a2.25 2.25 0 002.25 2.25h10.5A2.25 2.25 0 0019.5 18V9a2.25 2.25 0 00-2.25-2.25m-12 0V9a2.25 2.25 0 002.25-2.25h10.5A2.25 2.25 0 0118 9v.75'/%3E%3C/svg%3E");
}

.login-icon-tenant {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234a5565' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M2.25 21h19.5M3.75 21V9.75m16.5 11.25V9.75M6 21V9.75m12 11.25V9.75M6 9.75h12V6.75A2.25 2.25 0 0015.75 4.5h-7.5A2.25 2.25 0 006 6.75v3M9 12.75h6m-6 3h6'/%3E%3C/svg%3E");
}

.login-icon-lock {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234a5565' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z'/%3E%3C/svg%3E");
}

.login-icon-phone {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234a5565' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M10.5 1.5H8.25A2.25 2.25 0 006 3.75v16.5a2.25 2.25 0 002.25 2.25h7.5A2.25 2.25 0 0018 20.25V3.75a2.25 2.25 0 00-2.25-2.25H13.5m-3 0V3h3V1.5m-3 0h3'/%3E%3C/svg%3E");
}

.login-icon-shield {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234a5565' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z'/%3E%3C/svg%3E");
}

.login-toggle-pwd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  padding: 0;
  border-radius: 6px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23717182' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'/%3E%3C/svg%3E") center / 18px no-repeat;
  cursor: pointer;
}

.login-toggle-pwd:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.login-toggle-pwd.is-visible {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23717182' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88'/%3E%3C/svg%3E");
}

.login-input-wrap--code input {
  padding-right: 108px;
}

.login-send-code {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  height: 34px;
  padding: 0 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #1a56db;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.login-send-code:hover:not(:disabled) {
  background: rgba(26, 86, 219, 0.06);
}

.login-send-code:disabled {
  color: #9ca3af;
  cursor: not-allowed;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  font-size: 13px;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4a5565;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.login-remember input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #2b7fff;
  cursor: pointer;
}

.login-forgot {
  color: #1a56db;
  font-weight: 500;
  text-decoration: none;
}

.login-forgot:hover {
  text-decoration: underline;
}

.login-submit {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: #2b7fff;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.login-submit:hover:not(:disabled) {
  background: #1a6fe8;
}

.login-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.login-demo-account {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f3f8ff;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}

.login-demo-account strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
}

.login-demo-account small {
  color: #64748b;
}

.login-page-footer {
  margin-top: 28px;
  font-size: 12px;
  line-height: 1.5;
  color: #6a7282;
  text-align: center;
}

/* ── 响应式 ── */
@media (max-width: 960px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-left {
    min-height: auto;
    padding: 72px 24px 32px;
  }

  .login-left-logo {
    top: 20px;
    left: 24px;
    width: 80px;
    height: 72px;
  }

  .login-left-illus {
    display: none;
  }

  .login-right {
    min-height: auto;
    padding: 28px 24px 40px;
    justify-content: center;
  }

  .login-form-column {
    max-width: 480px;
    margin: 0 auto;
  }
}
