/* ---------------------------------------------------------------
   Login screen
   --------------------------------------------------------------- */
.login-body {
  min-height: 100vh;
  background: #eaeffa;
  background-image:
    radial-gradient(58rem 58rem at 8% 12%, rgba(108, 75, 255, 0.16), transparent 62%),
    radial-gradient(52rem 52rem at 92% 84%, rgba(47, 107, 255, 0.2), transparent 60%),
    linear-gradient(180deg, #f3f6fe 0%, #e8eefb 100%);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 24px;
}

.login-shell {
  width: 100%;
  max-width: 1000px;
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: shell-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes shell-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }
}

/* ----------------------------- brand ----------------------------- */
.login-brand {
  position: relative;
  overflow: hidden;
  padding: 40px 38px;
  display: flex;
  flex-direction: column;
  gap: 34px;
  color: #eaf0ff;
  background:
    radial-gradient(120% 90% at 15% 0%, #2d3f86 0%, transparent 55%),
    linear-gradient(158deg, #0d152c 0%, #16224a 48%, #1e2f6b 100%);
}

.brand-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(80% 70% at 30% 20%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(80% 70% at 30% 20%, #000 20%, transparent 78%);
}

.brand-glow {
  position: absolute;
  width: 340px;
  height: 340px;
  right: -140px;
  bottom: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(98, 138, 255, 0.55), transparent 68%);
  filter: blur(8px);
}

.brand-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-weight: 800;
  font-size: 19px;
  color: #fff;
  background: linear-gradient(140deg, #5b8bff, #3d5bff 55%, #7a5cff);
  box-shadow: 0 10px 24px -10px rgba(90, 130, 255, 0.9);
}

.brand-name {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.3px;
}

.brand-name em {
  font-style: normal;
  color: #9db4ff;
}

.brand-copy {
  position: relative;
  margin-top: 4px;
}

.brand-copy h1 {
  margin: 0 0 16px;
  font-size: 38px;
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(120deg, #ffffff 30%, #b9caff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-copy p {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: #a9b8dd;
  max-width: 24em;
}

.brand-points {
  position: relative;
  list-style: none;
  margin: auto 0 0;
  padding: 0;
  display: grid;
  gap: 13px;
  font-size: 13.5px;
  color: #c3cef0;
}

.brand-points li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-points .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6f8dff;
  box-shadow: 0 0 0 4px rgba(111, 141, 255, 0.16);
  flex: none;
}

.brand-foot {
  position: relative;
  margin: 0;
  font-size: 12px;
  color: #6f7fa8;
}

/* ----------------------------- panel ----------------------------- */
.login-panel {
  padding: 44px 52px 30px;
  display: flex;
  flex-direction: column;
}

.panel-head {
  margin-bottom: 22px;
}

.panel-head h2 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: -0.3px;
}

.panel-head p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

/* tabs */
.tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--surface-soft);
  border-radius: 12px;
  margin-bottom: 22px;
}

.tab-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 6px);
  height: calc(100% - 8px);
  background: #fff;
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(16, 26, 51, 0.09);
  transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}

.tabs[data-active="password"] .tab-indicator {
  transform: translateX(calc(100% + 4px));
}

.tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 0;
  border: 0;
  background: transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 550;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.tab svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  opacity: 0.85;
}

.tab.is-active {
  color: var(--ink);
}

.tab:focus-visible {
  outline: 2px solid rgba(47, 107, 255, 0.5);
  outline-offset: 2px;
}

/* panes */
.panes {
  flex: 1;
}

.pane {
  display: none;
  animation: pane-in 0.28s ease both;
}

.pane.is-active {
  display: block;
}

@keyframes pane-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ----------------------------- QR ----------------------------- */
.qr-area {
  text-align: center;
  padding: 4px 0 0;
}

.qr-box {
  position: relative;
  width: 232px;
  height: 232px;
  margin: 0 auto 16px;
  padding: 6px;
  border-radius: 18px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(140deg, rgba(47, 107, 255, 0.35), rgba(108, 75, 255, 0.15)) border-box;
  border: 1px solid transparent;
}

.qr-canvas {
  width: 100%;
  height: 100%;
  border-radius: 13px;
  background: var(--surface-soft);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.qr-canvas iframe,
.qr-canvas canvas,
.qr-canvas img {
  max-width: 100%;
  border-radius: 12px;
}

.qr-placeholder {
  display: grid;
  justify-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(47, 107, 255, 0.18);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}

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

.qr-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(47, 107, 255, 0.55);
}

.qr-corner.tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.qr-corner.tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.qr-corner.bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.qr-corner.br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }

.qr-hint {
  margin: 0 0 6px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.qr-hint strong {
  color: var(--feishu);
}

.qr-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.qr-sub a {
  color: var(--brand);
}

.qr-scope {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 14px 0 0;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  color: #4c5b7a;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.qr-scope svg {
  width: 12px;
  height: 12px;
  fill: #6b7791;
  flex: none;
}

/* 单一登录方式（无 tab）时的留白 */
.panes--solo {
  padding-top: 8px;
}

.panes--solo .qr-box {
  margin-bottom: 20px;
}

.qr-fallback {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: #fff7f7;
  border: 1px solid #ffe0e0;
  font-size: 12.5px;
  color: #8c2f2f;
}

.qr-fallback p {
  margin: 0 0 10px;
}

/* empty state (飞书未配置) */
.empty-state {
  text-align: center;
  padding: 18px 8px;
}

.empty-icon {
  font-size: 30px;
  margin-bottom: 8px;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.empty-state p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--muted);
}

.empty-state code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--brand-deep);
}

.empty-warn {
  margin-top: 10px !important;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: #fff4f4;
  border: 1px solid #ffd9d9;
  color: #b3261e !important;
  font-size: 12.5px !important;
}

/* ----------------------------- form ----------------------------- */
.login-form {
  display: grid;
  gap: 16px;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-soft);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  fill: #9aa6c1;
  pointer-events: none;
  transition: fill 0.2s ease;
}

.oa-input {
  width: 100%;
  height: 46px;
  padding: 0 42px 0 40px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fbfcff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.oa-input::placeholder {
  color: #a8b2c9;
}

.oa-input:hover {
  border-color: #cfd8ea;
}

.oa-input:focus {
  outline: none;
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.12);
}

.input-wrap:focus-within .input-icon {
  fill: var(--brand);
}

.eye {
  position: absolute;
  right: 6px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.eye svg {
  width: 17px;
  height: 17px;
  fill: #9aa6c1;
}

.eye:hover {
  background: var(--surface-soft);
}

.field-error {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--danger);
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -2px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}

.oa-checkbox {
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1.5px solid #c3ccdf;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.oa-checkbox:checked {
  background: var(--brand);
  border-color: var(--brand);
}

.oa-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.oa-checkbox:focus-visible {
  outline: 2px solid rgba(47, 107, 255, 0.35);
  outline-offset: 2px;
}

.link-muted {
  font-size: 13px;
  color: var(--muted);
}

.link-muted:hover {
  color: var(--brand);
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  margin-top: 4px;
  color: #fff;
  background: linear-gradient(120deg, #2f6bff 0%, #4a5cff 55%, #6c4bff 100%);
  box-shadow: 0 12px 24px -14px rgba(47, 107, 255, 0.95);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px -14px rgba(47, 107, 255, 0.95);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--feishu {
  color: #fff;
  background: var(--feishu);
}

.btn--feishu:hover {
  background: #2a63ea;
}

.btn--feishu-outline {
  color: var(--feishu);
  background: #fff;
  border-color: #cfdcff;
}

.btn--feishu-outline:hover {
  background: #f4f7ff;
  border-color: #b9caff;
}

.btn--disabled {
  color: #9aa6c1;
  background: var(--surface-soft);
  border-color: var(--line);
  cursor: not-allowed;
}

.feishu-mark {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: var(--feishu);
}

.btn--feishu-outline .feishu-mark {
  background: var(--feishu);
}

.divider {
  position: relative;
  margin: 18px 0;
  text-align: center;
}

.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
}

.divider span {
  position: relative;
  padding: 0 12px;
  font-size: 12px;
  color: #a3adc4;
  background: #fff;
}

.panel-foot {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-foot p {
  margin: 0;
  font-size: 12px;
  color: #9aa4bb;
}

.panel-foot a {
  color: #8492ad;
}

.dev-link {
  font-size: 12px;
  color: var(--brand) !important;
}

/* ----------------------------- responsive ----------------------------- */
@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
    max-width: 460px;
  }

  .login-brand {
    padding: 26px 28px;
    gap: 8px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .brand-copy,
  .brand-points,
  .brand-foot {
    display: none;
  }

  .login-panel {
    padding: 30px 28px 22px;
  }

  .panel-head h2 {
    font-size: 21px;
  }
}

@media (max-width: 420px) {
  .login-page {
    padding: 0;
  }

  .login-shell {
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
