/* =================================================================
   ЦИФРУС · admin · login screen — Industrial Brutalism
   Подключается ТОЛЬКО на login.html. Остальные admin-страницы пока
   живут в editorial-стиле (main.css) — редизайн в Шагах 8.2-8.7.
   Берём brand-канон из tokens.css (--bg, --ink, --shadow, --font-display
   и т.д.). Внутри scope `.body-login` — чтобы не конфликтовать
   с .btn/.field admin'а.
   ================================================================= */

body.body-login {
  margin: 0; padding: 0;
  background: var(--bg) !important;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px; line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Бумажная сетка фона. */
body.body-login::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(to right, rgba(10,10,10,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(10,10,10,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

.body-login .login-frame {
  position: relative; z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 16px;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ---------- top bar ---------- */
.body-login .login-top {
  background: var(--ink);
  color: var(--bg);
  padding: 14px 18px;
  margin: 0 -16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid var(--ink);
}
.body-login .wordmark {
  font-family: var(--font-display);
  font-weight: 800; font-size: 24px;
  letter-spacing: 0.02em; line-height: 1;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.body-login .wordmark .dot {
  width: 14px; height: 14px;
  background: var(--green-bright);
  display: inline-block;
}
.body-login .login-sub-tag {
  font-family: var(--font-mono);
  font-weight: 500; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bg);
  opacity: 0.7;
}

/* ---------- sheet ---------- */
.body-login .sheet {
  flex: 1;
  padding: 28px 0 24px;
  display: flex; flex-direction: column;
}
.body-login .sheet-login-desktop { padding: 32px 0 24px; }

/* ---------- screen title ---------- */
.body-login .screen-title {
  font-family: var(--font-display);
  font-weight: 800; font-size: 56px;
  line-height: 0.92; letter-spacing: -0.015em;
  text-transform: uppercase;
  margin: 0 0 8px;
  color: var(--ink);
}
.body-login .screen-title em {
  font-style: normal; color: var(--purple);
  display: inline-block; border-bottom: 5px solid var(--purple);
}
.body-login .screen-sub {
  font-size: 15px;
  color: var(--ink-2);
  margin: 0 0 26px;
  max-width: 32em;
}

/* ---------- step ---------- */
.body-login .step {
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 22px 22px 24px;
  margin-bottom: 18px;
  position: relative;
}
.body-login .step.is-disabled {
  opacity: 0.4; box-shadow: var(--shadow-sm);
  pointer-events: none;
}
.body-login .step-num {
  position: absolute; top: -2px; left: -2px;
  background: var(--ink); color: var(--bg);
  font-family: var(--font-display);
  font-weight: 800; font-size: 22px; line-height: 1;
  padding: 8px 12px 6px;
  letter-spacing: 0.02em;
}
.body-login .step-num.alt-num {
  background: var(--purple);
}
.body-login .step-title {
  font-family: var(--font-body);
  font-weight: 700; font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--sub);
  margin: 0 0 14px;
  padding-left: 60px;
  min-height: 32px;
  display: flex; align-items: center;
}

/* ---------- field ---------- */
.body-login .field {
  display: block;
  width: 100%;
  background: var(--bg);
  border: 2px solid var(--ink);
  padding: 14px 14px;
  font-family: var(--font-mono);
  font-weight: 500; font-size: 20px; line-height: 1;
  color: var(--ink);
  letter-spacing: 0.04em;
  -webkit-appearance: none; appearance: none;
  border-radius: 0; outline: none;
  transition: box-shadow 80ms linear, transform 80ms linear;
  margin-bottom: 0;
}
.body-login .field + .field { margin-top: 10px; }
.body-login .field::placeholder {
  color: var(--sub); letter-spacing: 0.04em;
  font-weight: 500;
}
.body-login .field:focus {
  box-shadow: var(--shadow-sm);
  transform: translate(-2px, -2px);
}
.body-login .field-otp {
  font-size: 30px; letter-spacing: 0.45em;
  text-align: center; padding-left: 0.45em;
}
.body-login .field-email,
.body-login .field-password {
  font-size: 17px;
  letter-spacing: 0.02em;
}

.body-login .hint {
  margin-top: 10px; margin-bottom: 0;
  font-size: 13px; color: var(--sub); line-height: 1.4;
}

/* ---------- btn ---------- */
.body-login .btn {
  display: block;
  width: 100%;
  background: var(--purple); color: #fff;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  min-height: 56px;
  font-family: var(--font-display);
  font-weight: 800; font-size: 22px;
  text-transform: uppercase; letter-spacing: 0.04em;
  cursor: pointer; border-radius: 0;
  transition: transform 80ms linear, box-shadow 80ms linear, background 80ms linear;
  margin-top: 14px;
}
.body-login .btn:hover { background: var(--purple-deep); }
.body-login .btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 0 var(--ink);
}
.body-login .btn[disabled] {
  background: var(--sub); color: var(--bg);
  cursor: not-allowed; box-shadow: var(--shadow-sm);
}

/* ---------- alt toggle ---------- */
.body-login .alt-toggle {
  text-align: center;
  margin: 4px 0 18px;
}
.body-login .alt-link {
  background: transparent;
  border: 0;
  font-family: var(--font-mono);
  font-weight: 500; font-size: 12px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-2);
  cursor: pointer;
  padding: 8px 12px;
  border-bottom: 1px dashed var(--ink-2);
}
.body-login .alt-link:hover {
  color: var(--purple);
  border-bottom-color: var(--purple);
}
.body-login .alt-link-back {
  display: block;
  margin: 14px auto 0;
  border-bottom: 0;
  text-decoration: none;
}
.body-login .alt-link-back:hover {
  color: var(--purple);
  text-decoration: underline;
}

/* ---------- timer ---------- */
.body-login .timer {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.06em;
  color: var(--sub); text-align: center; text-transform: uppercase;
}
.body-login .timer b { color: var(--ink); }
.body-login .timer a { color: var(--ink); text-decoration: underline; }

/* ---------- foot ---------- */
.body-login .foot {
  margin-top: auto;
  padding-top: 36px;
  padding-bottom: 12px;
  text-align: center;
}
.body-login .stamp {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800; font-size: 18px;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--purple); border: 2px solid var(--purple);
  padding: 6px 14px 4px;
  transform: rotate(-2deg);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}
.body-login .tag {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-weight: 500; font-size: 11px;
  letter-spacing: 0.10em;
  color: var(--sub);
}

/* ---------- shake ---------- */
.body-login .shake {
  animation: cifrus-login-shake 0.32s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes cifrus-login-shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* ---------- toast ---------- */
.toast-wrap {
  position: fixed;
  left: 50%; bottom: 24px;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 13px; letter-spacing: 0.04em;
  text-transform: uppercase; font-weight: 700;
  pointer-events: auto;
  max-width: 480px;
  border-radius: 0;
}
.toast.is-error {
  background: var(--st-failed); color: #fff;
  border-color: var(--st-failed);
}
.toast.is-ok {
  background: var(--green); color: #fff;
  border-color: var(--ink);
}
