/* ============================================================
 * agreement.css — 登录页法律文书勾选行样式
 * 供 tenant-portal.html（浅色）与 app-login.html（深色）共用。
 * 通过 --legal-link / --legal-accent 变量适配不同主题。
 * ============================================================ */

.legal-agree {
  --legal-link: #0891b2;
  --legal-accent: #0891b2;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: inherit;
  text-align: left;
}

.legal-agree-box {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  accent-color: var(--legal-accent);
  cursor: pointer;
}

.legal-agree-body { min-width: 0; }

.legal-agree-lead {
  display: block;
  cursor: pointer;
  opacity: 0.85;
}

.legal-agree-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  margin-top: 2px;
}

.legal-agree .legal-link {
  color: var(--legal-link);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.legal-agree .legal-link:hover { text-decoration: underline; }

.legal-agree-loading { opacity: 0.6; }

/* 深色主题（业务系统登录页）适配：在外层容器加 .legal-agree-on-dark */
.legal-agree-on-dark .legal-agree {
  --legal-link: #22d3ee;
  --legal-accent: #06b6d4;
  color: var(--text-secondary, #94a3b8);
}
.legal-agree-on-dark .legal-agree .legal-agree-lead { opacity: 1; }

/* ============================================================
 * 文书查看弹窗（点击标题后在当前页打开）
 * ============================================================ */

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.legal-modal.show { display: flex; }

.legal-modal-panel {
  width: min(920px, 100%);
  height: min(86vh, 100%);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  animation: legalModalIn 0.18s ease;
}
@keyframes legalModalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.legal-modal-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.legal-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.legal-modal-actions { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.legal-modal-newwin {
  font-size: 13px;
  color: #0891b2;
  text-decoration: none;
  white-space: nowrap;
}
.legal-modal-newwin:hover { text-decoration: underline; }
.legal-modal-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.legal-modal-close:hover { background: #e2e8f0; color: #0f172a; }

.legal-modal-body { flex: 1 1 auto; min-height: 0; background: #f8fafc; }
.legal-modal-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }

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

@media (max-width: 640px) {
  .legal-modal { padding: 0; }
  .legal-modal-panel { width: 100%; height: 100%; border-radius: 0; }
}
