/* Chatwork 风格登录页 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body.login-page {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, "Yu Gothic UI", "MS PGothic", sans-serif;
  color: #222;
  -webkit-font-smoothing: antialiased;
  /* 背景图未铺满区域：略深于白的浅灰 */
  background-color: #e8ecf1;
}

/* 背景图居中；下层白底比图四周各多出 10px */
.login-bg-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  box-sizing: border-box;
  pointer-events: none;
}

.login-bg-framed {
  position: relative;
  display: block;
  width: min(92vw, 1180px);
  max-width: 100%;
  transform: translateY(20px);
}

.login-bg-card {
  position: absolute;
  /* 比背景图区域四边各扩展 10px */
  top: -10px;
  right: -10px;
  bottom: -10px;
  left: -10px;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  z-index: 0;
}

.login-bg-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  filter: blur(2px);
}

@media (max-width: 520px) {
  .login-bg-framed {
    width: min(96vw, 100%);
  }
}

.login-bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  /* 极轻叠层，避免把白边压成灰 */
  background: rgba(0, 0, 0, 0.06);
}

.login-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

/* 外层白底：略大圆角、柔和大阴影（对应 Chatwork 主容器） */
.login-modal {
  width: 100%;
  max-width: 628px;
  background: #fff;
  border-radius: 14px;
  box-shadow:
    0 12px 40px rgba(15, 23, 42, 0.1),
    0 4px 12px rgba(15, 23, 42, 0.06);
  /* 外层卡片宽度：在 448px 基础上累计加宽 */
  /* 上内边距减小可使 Logo 上移；内层卡片用等量 margin-top 顶回，避免表单跟着跑 */
  padding: 5px 36px 77px;
  transform: translateY(15px);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  margin-bottom: 28px;
}

.login-brand__img {
  display: block;
  max-width: min(260px, 100%);
  width: auto;
  height: auto;
  object-fit: contain;
}

/* 内层登录卡片：更明显的“浮起”阴影；整体较外层缩窄、略压低高度 */
.login-card {
  width: calc(100% - 150px);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-top: 80px;
  transform: translateY(-50px);
  position: relative;
  z-index: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow:
    0 6px 20px rgba(15, 23, 42, 0.1),
    0 2px 8px rgba(15, 23, 42, 0.05);
  /* 内边距与 Chatwork 参考图一致；底边较上一版收 10px，仅减空白不改内容区 */
  padding: 28px 32px 67px;
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-sizing: border-box;
}

.login-card form {
  text-align: left;
  /* 用 padding-top 避免与 .login-card__title 的 margin 折叠，确保整体下移 20px */
  padding-top: 20px;
}

@media (max-width: 520px) {
  .login-card {
    width: calc(100% - 32px);
  }
}

.login-card__title {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 28px;
  color: #111111;
  letter-spacing: 0.03em;
}

.login-alert {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  background: #fdecea;
  color: #c62828;
  border: 1px solid #f5c6cb;
}

.login-field {
  margin-bottom: 18px;
}

.login-field:last-of-type {
  margin-bottom: 12px;
}

.login-field label {
  display: block;
  font-size: 13px;
  color: #4b5563;
  margin-bottom: 8px;
  font-weight: 400;
  line-height: 1.4;
}

/* 浮动标签：与 Chatwork ULP 一致（参考站 --primary-color / --link-color） */
.login-field--float {
  position: relative;
  /* 暗蓝：标签与聚焦描边 */
  --login-accent: #0f3d7a;
}

.login-field--float .login-float-label {
  position: absolute;
  left: 15px;
  top: 50%;
  z-index: 2;
  margin: 0;
  padding: 0;
  max-width: calc(100% - 28px);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
  color: rgba(0, 0, 0, 0.55);
  pointer-events: none;
  transform: translateY(-50%);
  transform-origin: left center;
  transition:
    top 0.2s ease,
    transform 0.2s ease,
    font-size 0.2s ease,
    color 0.2s ease,
    font-weight 0.2s ease,
    max-width 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-field--float .login-float-label--pw {
  max-width: calc(100% - 52px);
}

.login-field--float .login-input:focus ~ .login-float-label,
.login-field--float .login-input:not(:placeholder-shown) ~ .login-float-label,
.login-field--float .login-input--filled ~ .login-float-label {
  top: 0;
  left: 12px;
  max-width: calc(100% - 24px);
  padding: 0 4px;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.2;
  color: var(--login-accent);
  background: #fff;
  transform: translateY(-50%);
  white-space: normal;
}

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

/* 邮箱与密码框：输入文字为黑色加粗；占位符单独用 ::placeholder 控制（空框时显示的是占位符不是“输入色”） */
.login-input {
  box-sizing: border-box;
  width: calc(100% - 10px);
  padding: 15.5px 14px;
  margin: 0;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 800;
  color: #000000;
  -webkit-text-fill-color: #000000;
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus,
.login-input:-webkit-autofill:active {
  -webkit-text-fill-color: #000000 !important;
  font-size: 16px;
  font-weight: 800 !important;
  caret-color: #000000;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  transition: background-color 99999s ease-out 0s;
}

.login-input::placeholder {
  color: #000000;
  -webkit-text-fill-color: #000000;
  font-size: 16px;
  font-weight: 800;
  opacity: 0.55;
}

.login-input::-webkit-input-placeholder {
  color: #000000;
  -webkit-text-fill-color: #000000;
  font-size: 16px;
  font-weight: 800;
  opacity: 0.55;
}

.login-input::-moz-placeholder {
  color: #000000;
  opacity: 0.55;
  font-size: 16px;
  font-weight: 800;
}

.login-input:focus {
  border-color: #64748b;
  box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.35);
}

.login-field--float .login-input {
  transition:
    border-color 0.2s ease,
    border-width 0.2s ease,
    padding 0.2s ease,
    box-shadow 0.2s ease;
}

.login-field--float .login-input::placeholder,
.login-field--float .login-input::-webkit-input-placeholder,
.login-field--float .login-input::-moz-placeholder {
  color: transparent !important;
  opacity: 0 !important;
  -webkit-text-fill-color: transparent !important;
}

.login-field--float .login-input:focus,
.login-field--float .login-input:focus-visible {
  border-width: 2px;
  border-color: var(--login-accent);
  box-shadow: none;
  padding: 14.5px 13px;
}

.login-field--float .login-input.login-input--pw:focus,
.login-field--float .login-input.login-input--pw:focus-visible {
  padding: 14.5px 43px 14.5px 13px;
}

.login-field--float .login-input:-webkit-autofill:focus {
  border-width: 2px;
  border-color: var(--login-accent);
  box-shadow: 0 0 0 1000px #ffffff inset !important;
}

/* 仅密码框右侧为眼睛按钮留空，其它与上框完全一致 */
.login-input.login-input--pw {
  padding: 15.5px 44px 15.5px 14px;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 800;
  color: #000000;
  -webkit-text-fill-color: #000000;
}

.login-toggle-pw {
  position: absolute;
  right: 9px;
  top: 50%;
  z-index: 3;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.login-toggle-pw:hover {
  background: rgba(0, 0, 0, 0.05);
}

.login-forgot {
  margin: 2px 0 22px;
  text-align: left;
}

.login-forgot a {
  font-size: 13px;
  color: #2563eb;
  text-decoration: none;
  display: inline-block;
}

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

.login-btn {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: #1e50a2;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.15s, box-shadow 0.15s;
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
  margin-top: 2px;
}

.login-btn:hover {
  filter: brightness(0.96);
}

.login-footer {
  margin-top: 13px;
  text-align: center;
}

.login-footer a {
  font-weight: 700;
  font-size: 14px;
}

.login-footer__row {
  margin-bottom: 16px;
}

.login-footer__row a {
  color: #2563eb;
  text-decoration: none;
}

.login-footer__row a:hover {
  text-decoration: underline;
}

.login-footer__split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.login-footer__signup {
  margin-left: 100px;
}

.login-footer__app {
  transform: translateX(-100px);
}

.login-footer__split a {
  color: #2563eb;
  text-decoration: none;
}

.login-footer__split a:hover {
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
