/*
 * Блокировка профиля 🔒, PIN-код, «Сменить пользователя»
 * (docs/TZ-SESSION-LOCK-PIN.md). Цвета — из темы (modern-theme.css).
 */

/* Кнопка 🔒 в шапке: крупная, залитая акцентным цветом — отличается от
   остальных пунктов шапки и видна сразу (п. 6). */
.main-header .navbar .nav > li > a.mis-lock-btn {
  display: flex; align-items: center; gap: 6px;
  margin: 8px 8px 0 6px; padding: 6px 16px; height: 36px;
  background: #2f6fed !important; color: #fff !important; border-radius: 18px;
  font-weight: 700; font-size: 14px; line-height: 1;
  box-shadow: 0 4px 12px rgba(47, 111, 237, .35);
}
.main-header .navbar .nav > li > a.mis-lock-btn:hover,
.main-header .navbar .nav > li > a.mis-lock-btn:focus { background: #2456c8 !important; color: #fff !important; }
.mis-lock-btn .mis-lock-ico { font-size: 16px; color: #fff; }

/* Пока профиль заблокирован, страница под экраном не видна, но остаётся в
   DOM — несохранённые данные форм целы (п. 9). */
body.mis-locked > *:not(#mis-lock):not(script):not(style) { visibility: hidden !important; }
body.mis-locked { overflow: hidden !important; }

#mis-lock { display: none; }
body.mis-locked #mis-lock,
#mis-lock.mis-lock-static { display: flex; }
#mis-lock {
  position: fixed; inset: 0; z-index: 2147483000;
  align-items: center; justify-content: center; padding: 20px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background:
    radial-gradient(1100px 700px at 12% 8%, rgba(47,111,237,.30), transparent 60%),
    radial-gradient(900px 600px at 90% 92%, rgba(91,139,245,.22), transparent 55%),
    linear-gradient(135deg, #0b1224 0%, #122046 55%, #0b1224 100%);
}
#mis-lock.mis-lock-inline {
  position: static; inset: auto; padding: 0; background: none; display: block;
}

.mis-lock-card {
  width: 100%; max-width: 400px; background: #fff; border-radius: 22px;
  padding: 34px 30px 24px; text-align: center; color: #1e293b;
  box-shadow: 0 30px 70px rgba(2,8,30,.55), 0 6px 18px rgba(2,8,30,.30);
}
.mis-lock-inline .mis-lock-card { box-shadow: none; padding: 0 0 8px; max-width: none; }
.mis-lock-icon {
  width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #e8efff; color: #2456c8; font-size: 30px;
}
.mis-lock-title { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.mis-lock-name { font-size: 16px; font-weight: 600; color: #2456c8; margin: 0 0 16px; word-break: break-word; }
.mis-lock-hint { color: #64748b; font-size: 14px; margin: 0 0 12px; }

.mis-pin { display: flex; justify-content: center; gap: 12px; margin: 0 0 14px; }
.mis-pin input {
  width: 54px; height: 62px; text-align: center; font-size: 28px; font-weight: 700;
  border: 1.5px solid #e6eaf2; border-radius: 13px; background: #f8fafc; color: #1e293b;
  outline: none; -webkit-text-security: disc;
}
.mis-pin input:focus { border-color: #2f6fed; background: #fff; box-shadow: 0 0 0 4px rgba(47,111,237,.14); }
.mis-lock .mis-input,
.mis-lock-card .mis-input {
  width: 100%; height: 48px; border: 1.5px solid #e6eaf2; border-radius: 13px;
  padding: 0 14px; font-size: 15px; background: #f8fafc; margin: 0 0 14px; outline: none;
}
.mis-lock-card .mis-input:focus { border-color: #2f6fed; background: #fff; box-shadow: 0 0 0 4px rgba(47,111,237,.14); }

.mis-lock-error { min-height: 20px; color: #dc2626; font-size: 13px; margin: -4px 0 10px; }
.mis-lock-btn-main {
  width: 100%; height: 48px; border: none; border-radius: 13px; cursor: pointer;
  background: linear-gradient(135deg, #2f6fed, #5b8bf5); color: #fff;
  font-size: 15.5px; font-weight: 600; box-shadow: 0 10px 22px rgba(47,111,237,.35);
}
.mis-lock-btn-main[disabled] { opacity: .6; cursor: default; }
.mis-lock-btn-alt {
  width: 100%; height: 44px; margin-top: 10px; border: 1.5px solid #e6eaf2; border-radius: 13px;
  background: #fff; color: #2456c8; font-weight: 600; font-size: 14.5px; cursor: pointer;
}
.mis-lock-btn-alt:hover { background: #e8efff; }
.mis-lock-links { margin-top: 12px; display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.mis-lock-links a { color: #64748b; font-size: 13.5px; cursor: pointer; text-decoration: none; }
.mis-lock-links a:hover { color: #2456c8; text-decoration: underline; }

.mis-users { list-style: none; margin: 0 0 6px; padding: 0; text-align: left; max-height: 320px; overflow-y: auto; }
.mis-users li + li { margin-top: 8px; }
.mis-users button {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1.5px solid #e6eaf2; border-radius: 13px; background: #fff; cursor: pointer; text-align: left;
}
.mis-users button:hover { border-color: #2f6fed; background: #f8fafc; }
.mis-users .mis-u-ava {
  flex: 0 0 38px; height: 38px; border-radius: 50%; background: #e8efff; color: #2456c8;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.mis-users .mis-u-name { font-weight: 600; color: #1e293b; display: block; }
.mis-users .mis-u-state { font-size: 12.5px; color: #64748b; display: block; }
.mis-users .mis-u-state.on { color: #16a34a; }
.mis-users-empty { color: #64748b; font-size: 14px; margin: 6px 0 12px; }

@media (max-width: 480px) {
  .mis-lock-card { padding: 26px 18px 18px; }
  .mis-pin input { width: 48px; height: 56px; }
}

/* hidden сильнее display: flex/block из правил выше. */
#mis-lock[hidden], #mis-lock [hidden], #login-form[hidden] { display: none !important; }
