/* Self-contained sign-in layout with persistent labels and touch-sized fields. */

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

html, body { margin: 0; padding: 0; }

body.sign-in-bg {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  color: #1f2b47;
  background: #f4f6fa;
  font-family: "Inter", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.login-panel {
  width: min(900px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(116, 139, 183, .22);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(41, 56, 88, .09);
}

/* ---------- brand side (desktop) ---------- */

.login-brand {
  position: relative;
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  color: #263b61;
  background: linear-gradient(145deg, #edf2fc, #f7f9fe);
  overflow: hidden;
}

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

.login-brand::before {
  width: 240px;
  height: 240px;
  right: -90px;
  top: -70px;
  background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 68%);
}

.login-brand::after {
  width: 300px;
  height: 300px;
  left: -120px;
  bottom: -130px;
  background: radial-gradient(circle, rgba(255, 255, 255, .14), transparent 70%);
}

.login-brand-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #dde5f2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.login-brand-icon img { width: 32px; height: 32px; display: block; }

.login-brand h1 {
  margin: 18px 0 10px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.login-brand-copy {
  margin: 0;
  max-width: 30em;
  font-size: 15px;
  line-height: 1.7;
  color: #6e7f99;
}

.login-brand-card {
  position: relative;
  border: 1px solid #dce5f2;
  border-radius: 18px;
  background: rgba(255, 255, 255, .7);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-brand-card-icon {
  width: 45px;
  height: 45px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-brand-card-icon img { width: 26px; height: 26px; }

.login-brand-card h6 { margin: 0 0 4px; font-size: 15px; font-weight: 650; }
.login-brand-card p { margin: 0; font-size: 12.5px; color: #7b8ba5; line-height: 1.6; }

/* ---------- form side ---------- */

.login-form-wrap { padding: 48px 44px; background: #fff; }

.login-form-head h2 { margin: 0 0 8px; font-size: 24px; font-weight: 750; letter-spacing: -.01em; color: #1d2a45; }
.login-form-head p { margin: 0; font-size: 14px; line-height: 1.6; color: #7b86a0; }

.login-message {
  display: none;
  margin: 18px 0 0;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(220, 76, 92, .28);
  background: #fdf1f2;
  color: #b3273c;
  font-size: 13.5px;
  line-height: 1.5;
}

.login-message.visible { display: block; }

.login-field {
  min-width: 0;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-field input[type="text"],
.login-field input[type="password"] {
  width: 100%;
  height: 54px;
  padding: 0 14px;
  border: 1.5px solid #dbe3f2;
  border-radius: 13px;
  background: #fff;
  color: #1d2a45;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.login-field label {
  color: #485c78;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}
.login-field input::placeholder { color: #a2adc0; opacity: 1; }

.login-field input:focus {
  border-color: #4d6ef2;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(77, 110, 242, .13);
}

.login-captcha-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.login-captcha-row .login-field { flex: 1 1 auto; min-width: 0; }

.captcha-img {
  width: 100%;
  height: 38px;
  display: block;
  border-radius: 7px;
  object-fit: contain;
  background: #f8fbff;
}
.login-captcha-preview { width: 100%; height: 38px; position: relative; display: grid; place-items: center; }
.login-captcha-preview .captcha-img { position: absolute; inset: 0; }
.login-captcha-preview [hidden] { display: none; }
.login-captcha-placeholder { color: #8190a8; font-size: 12px !important; }
.login-captcha-status { min-height: 16px; margin: 6px 0 0; color: #8090a8; font-size: 11px; line-height: 1.5; }
.login-captcha-status.failed { color: #b3273c; }
.login-captcha-refresh { width: 124px; min-height: 69px; padding: 5px; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1px solid #dbe3f2; border-radius: 10px; background: #fff; color: #7384a0; cursor: pointer; font: inherit; }
.login-captcha-refresh span { font-size: 10px; line-height: 1.3; }
.login-captcha-refresh:focus-visible { outline: 3px solid #a5b7f7; outline-offset: 2px; }
.login-captcha-refresh:hover { border-color: #8da6e4; color: #405cb6; }
.login-captcha-refresh:disabled { cursor: wait; }
.login-captcha-row .login-field input { height: 69px; }

.login-remember {
  min-height: 44px;
  margin: 14px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.login-remember input {
  width: 18px;
  height: 18px;
  accent-color: #4d6ef2;
  cursor: pointer;
}

.login-remember span { font-size: 13.5px; color: #7b86a0; }

.login-submit {
  position: relative;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: #4668e8;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: .02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 5px 14px rgba(61, 100, 226, .17);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.login-submit:hover { filter: brightness(1.05); }
.login-submit:active { transform: translateY(1px); }

.login-submit:disabled { cursor: not-allowed; filter: saturate(.65) brightness(.98); box-shadow: none; }

.login-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: login-spin .7s linear infinite;
}

.login-spinner.visible { display: inline-block; }

@keyframes login-spin { to { transform: rotate(360deg); } }

.login-footnote {
  margin: 18px 0 0;
  text-align: center;
  font-size: 12px;
  color: #a3adc2;
}

/* ---------- mobile ---------- */

@media (max-width: 920px) {
  body.sign-in-bg { padding: 32px 16px; }
  .login-panel { width: min(440px, 100%); grid-template-columns: minmax(0, 1fr); border-radius: 18px; }

  .login-brand {
    padding: 22px 24px 0;
    gap: 0;
    background: #fff;
  }
  .login-brand > div:first-child { display: flex; align-items: center; gap: 11px; }
  .login-brand::before, .login-brand::after { display: none; }
  .login-brand-icon { width: 40px; height: 40px; border-radius: 12px; }
  .login-brand-icon img { width: 28px; height: 28px; }
  .login-brand h1 { margin: 0; font-size: 19px; }
  .login-brand-copy { display: none; }
  .login-brand-card { display: none; }

  .login-form-wrap { padding: 26px 24px 28px; }
  .login-form-head h2 { font-size: 23px; }
  .login-form-head p { font-size: 13px; }

  .login-field input[type="text"],
  .login-field input[type="password"] { height: 50px; }

  .login-captcha-row .login-field input { height: 64px; }
  .login-captcha-refresh { width: 112px; min-height: 64px; }
  .captcha-img { height: 34px; }
  .login-captcha-preview { height: 34px; }
}

@media (max-width: 420px) {
  body.sign-in-bg { padding: 20px 14px; }
  .login-brand { padding: 20px 20px 0; }
  .login-form-wrap { padding: 24px 20px 26px; }
  .login-captcha-row { gap: 10px; }
  .login-captcha-refresh { width: 100px; }
  .login-footnote { font-size: 10.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-spinner { animation-duration: 1.4s; }
  .login-field input, .login-field label, .login-submit { transition: none; }
}
