/**
 * 登录页 — 院内工具第一眼：医院名 + 表单 + 本店信息
 * 主色仅用品牌蓝；不拉外链图、不铺营销 Hero。
 */

body.login-page {
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  color: var(--text-primary, #1e293b);
}

.login-layout {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(20px, 3vh) 20px max(20px, 3vh);
  box-sizing: border-box;
}

.login-center {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: auto;
}

.login-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(10, 115, 195, 0.18), transparent 55%),
    linear-gradient(180deg, #e8eef5 0%, #d5e3f0 100%);
}

.login-panel {
  width: 100%;
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  background: var(--surface-card, #fff);
  border: 1px solid var(--border-default, #c5d4e0);
  box-shadow: var(--shadow-md, 0 2px 8px rgba(15, 23, 42, 0.06));
}

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

.login-brand {
  text-align: center;
  margin-bottom: 22px;
}

.login-brand-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #fff url("../images/logo-paw.svg") center / 36px no-repeat;
  color: transparent;
  border: 1px solid var(--border-subtle, #d7e3ec);
}

.login-brand h1 {
  font-size: 20px;
  margin: 0 0 4px;
  color: var(--color-neutral-900, #0f172a);
  font-weight: 700;
}

.login-brand p {
  margin: 0;
  color: var(--text-secondary, #475569);
  font-size: 13px;
}

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

.login-field label {
  display: block;
  font-size: 13px;
  color: var(--color-neutral-600, #475569);
  margin-bottom: 6px;
  font-weight: 500;
}

.login-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1px solid var(--color-neutral-300, #cbd5e1);
  border-radius: var(--radius-md, 10px);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-field input:focus {
  outline: none;
  border-color: var(--color-primary, #0a73c3);
  box-shadow: var(--focus-ring, 0 0 0 3px rgba(10, 115, 195, 0.18));
}

.login-field input.is-invalid {
  border-color: var(--color-danger, #b91c1c);
}

.login-btn,
.login-page button.login-btn {
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  min-height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-md, 10px);
  background: var(--color-primary, #0a73c3);
  color: var(--text-on-primary, #fff);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: background 0.15s;
}

.login-btn:hover,
.login-page button.login-btn:hover {
  background: var(--color-primary-hover, #055aa7);
  transform: none;
  opacity: 1;
}

.login-error {
  color: var(--color-danger, #b91c1c);
  font-size: 13px;
  min-height: 20px;
  margin-top: 8px;
  text-align: center;
}

.login-hint {
  margin-top: 14px;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.55;
  text-align: center;
}

.login-version-notice {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm, 6px);
  background: var(--color-accent-warm-subtle, #fffbeb);
  border: 1px solid var(--color-warning-border, #fcd34d);
  color: var(--color-warning, #b45309);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.login-version-notice.hidden {
  display: none;
}

.login-icp {
  margin: 18px 0 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
}

.login-icp a {
  color: inherit;
  text-decoration: none;
}

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

/* 覆盖 main.css 全局 button 样式 */
.login-page button.login-store-switch,
.login-page button.login-store-item,
.login-page button.login-store-cancel-btn,
.login-page button.login-store-modal-close {
  height: auto;
  min-height: 0;
  line-height: normal;
  font-family: inherit;
  box-sizing: border-box;
}

.login-store-bar {
  margin-top: 18px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle, #d7e3ec);
  border-radius: 10px;
  background: var(--color-neutral-50, #f8fafc);
}

.login-store-bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.login-store-bar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #475569);
}

.login-store-bar-tip {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
}

.login-store-card,
.login-page button.login-store-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 0;
  font-size: 13px;
  color: #334155;
}

.login-store-card {
  cursor: default;
  box-sizing: border-box;
}

.login-page button.login-store-switch:hover {
  border-color: transparent;
  box-shadow: none;
  opacity: 1;
  transform: none;
}

.login-store-switch-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #e8eef5;
  color: var(--color-primary, #0a73c3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.login-store-switch-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.login-store-switch-no {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.login-store-switch-name {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-store-switch-action {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--color-primary, #0a73c3);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

body.login-modal-open {
  overflow: hidden;
}

.login-store-modal {
  z-index: 1200;
  padding: 24px 16px;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.45);
}

.login-store-modal-card {
  width: min(460px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border-default, #c5d4e0);
  box-shadow: var(--shadow-lg);
}

.login-store-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  background: #fff;
  border-bottom: 1px solid #e8eef5;
}

.login-store-modal-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.login-store-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.login-store-modal-subtitle {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

.login-page button.login-store-modal-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.login-page button.login-store-modal-close:hover {
  background: #e2e8f0;
  color: #334155;
  opacity: 1;
}

.login-store-modal-body {
  display: block;
  padding: 14px 16px;
  overflow: auto;
  min-height: 0;
  flex: 1;
}

.login-store-list {
  display: grid;
  gap: 10px;
}

.login-store-empty {
  margin: 0;
  padding: 18px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: #6b7280;
  text-align: center;
  background: #f8fafc;
  border: 1px dashed #dbe3ee;
  border-radius: 12px;
}

.login-page button.login-store-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #fff;
  color: #1f2937;
  cursor: pointer;
}

.login-store-check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #fff;
}

.login-store-check .icon {
  width: 12px;
  height: 12px;
}

.login-store-item-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.login-store-item-no {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
}

.login-store-item-name {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.45;
  word-break: break-word;
}

.login-page button.login-store-item.active {
  border-color: var(--color-primary, #0a73c3);
  background: var(--color-primary-subtle, #e9f4ff);
  box-shadow: none;
}

.login-page button.login-store-item.active .login-store-check {
  border-color: var(--color-primary, #0a73c3);
  background: var(--color-primary, #0a73c3);
}

.login-page button.login-store-item:hover {
  border-color: #93c5fd;
  background: #f8fbff;
  opacity: 1;
}

.login-store-modal-footer {
  display: flex;
  flex-shrink: 0;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid #e8eef5;
  background: #fff;
}

.login-page button.login-store-cancel-btn {
  min-width: 88px;
  height: 36px;
  padding: 0 18px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.login-page button.login-store-cancel-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  opacity: 1;
}

@media (max-width: 520px) {
  .login-layout {
    padding: 20px 14px;
    align-items: flex-start;
  }

  .login-panel {
    border-radius: 12px;
  }

  .login-panel-body {
    padding: 22px 18px 16px;
  }

  .login-store-bar-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .login-store-bar-tip {
    white-space: normal;
  }

  .login-store-modal {
    padding: 16px 12px;
  }
}

@media (max-height: 760px) {
  .login-layout {
    align-items: flex-start;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .login-panel-body {
    padding: 20px 22px 16px;
  }

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

  .login-brand-logo {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
    background-size: 32px;
  }
}
