:root {
  --green: #32e678;
  --text: #f4f7fa;
  --selection-ring: 0 0 0 2px rgba(50, 230, 120, 0.42), 0 12px 28px rgba(50, 230, 120, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at 50% 0%, #152332 0, #071019 45%, #050a10 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

::selection {
  background: rgba(50, 230, 120, 0.46);
  color: #ffffff;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  box-shadow: var(--selection-ring);
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 9px 13px;
  font-weight: 800;
  text-decoration: none;
}

html.login-html {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.login-page {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  overflow: hidden;
  background: #02070d;
  overscroll-behavior: none;
}

.login-bg {
  position: fixed;
  /* Clip the five-pixel colour seam at the far-right edge of the source. */
  inset: -6px;
  background: url("/static/login-background-mosnov.178c1d8fb291.jpg?v=20260729-login-photo-2") center / cover no-repeat;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.login-panel {
  position: fixed;
  z-index: 1;
  left: clamp(36px, 5vw, 96px);
  top: 50%;
  width: clamp(340px, 24vw, 430px);
  padding: clamp(22px, 1.8vw, 30px);
  border: 1px solid rgba(218, 228, 236, 0.28);
  border-radius: 14px;
  background: rgba(3, 11, 18, 0.84);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
  transform: translateY(-50%);
}

.login-logo {
  display: block;
  width: min(230px, 72%);
  height: auto;
  margin: 0 auto clamp(20px, 1.6vw, 28px);
  object-fit: contain;
}

.login-form {
  position: relative;
  display: grid;
  gap: 14px;
}

.login-form label {
  display: block;
  margin: 0;
}

.login-form span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.login-input {
  display: flex;
  align-items: center;
  min-height: 56px;
  border: 1px solid rgba(218, 228, 236, 0.28);
  border-radius: 9px;
  background: rgba(1, 7, 12, 0.62);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.login-input i {
  display: block;
  flex: 0 0 52px;
  color: rgba(244, 247, 250, 0.78);
  font-size: 22px;
  text-align: center;
}

.login-input:focus-within {
  border-color: rgba(244, 247, 250, 0.96);
  background: rgba(1, 7, 12, 0.94);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 18px 44px rgba(0, 0, 0, 0.28);
}

.login-form input {
  width: 100%;
  height: 54px;
  padding: 0 16px 0 0;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font-size: 16px;
  font-weight: 700;
  caret-color: #fff;
}

.login-form input::placeholder {
  color: rgba(244, 247, 250, 0.76);
}

.login-form input:-webkit-autofill,
.login-form input:-webkit-autofill:hover,
.login-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
  box-shadow: 0 0 0 1000px #111b24 inset;
  transition: background-color 9999s ease-out 0s;
}

.login-form button {
  width: 100%;
  height: 56px;
  margin: 2px 0 0;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: #247346;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0;
}

.login-error {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(224, 90, 80, 0.5);
  border-radius: 6px;
  color: #fff;
  background: rgba(224, 90, 80, 0.18);
  font-weight: 800;
  order: -1;
}

@media (max-aspect-ratio: 3 / 2) {
  .login-panel {
    left: clamp(28px, 4vw, 64px);
    width: clamp(330px, 30vw, 400px);
  }
}

@media (max-width: 760px) {
  html.login-html,
  body.login-page {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100svh;
    min-height: 100svh;
    max-height: 100svh;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.login-page {
    touch-action: none;
    user-select: none;
    -webkit-overflow-scrolling: auto;
  }

  .login-bg {
    position: fixed;
    inset: -6px;
    background: url("/static/login-background-mosnov-mobile-portrait.670a53928109.webp") center / cover no-repeat;
    touch-action: none;
  }

  .login-panel {
    position: absolute;
    left: 50%;
    right: auto;
    top: 56%;
    width: min(336px, calc(100vw - 72px));
    padding: 12px;
    border: 1px solid rgba(210, 222, 232, 0.18);
    border-radius: 12px;
    background: rgba(4, 10, 16, 0.82);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(10px);
    transform: translate(-50%, -50%);
    touch-action: none;
    user-select: none;
  }

  .login-logo {
    position: static;
    z-index: auto;
    display: block;
    width: min(164px, 54vw);
    height: auto;
    margin: 0 auto 10px;
    object-fit: contain;
    filter: none;
  }

  .login-form {
    display: grid;
    gap: 8px;
    height: auto;
  }

  .login-form label,
  .login-form button,
  .login-error {
    position: static;
  }

  .login-form label {
    display: grid;
    gap: 4px;
    height: auto;
  }

  .login-form span {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
    overflow: visible;
    color: rgba(244, 247, 250, 0.68);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .login-input {
    display: flex;
    min-height: 40px;
    align-items: center;
    border: 1px solid rgba(210, 222, 232, 0.18);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
  }

  .login-input i {
    display: block;
    width: 36px;
    color: rgba(244, 247, 250, 0.68);
    font-size: 18px;
    text-align: center;
  }

  .login-form input {
    height: 40px;
    padding: 0 10px 0 0;
    font-size: 16px;
    touch-action: manipulation;
    user-select: text;
  }

  .login-form input::placeholder {
    color: transparent;
  }

  .login-form button {
    width: 100%;
    height: 42px;
    margin-top: 2px;
    border-radius: 9px;
    color: #fff;
    background: #1d613a;
    font-size: 12px;
    font-weight: 950;
    touch-action: manipulation;
  }

  .login-error {
    order: -1;
  }
}

@media (max-width: 760px) and (orientation: landscape) {
  .login-bg {
    background: url("/static/login-background-mosnov-mobile-landscape.449a70850862.webp") 58% center / cover no-repeat;
  }
}

@media (min-width: 761px) and (max-width: 1180px) and (pointer: coarse) and (hover: none) {
  .login-bg {
    background: url("/static/login-background-mosnov-mobile-landscape.449a70850862.webp") 58% center / cover no-repeat;
  }
}

@media (display-mode: standalone) and (max-width: 760px) {
  html.login-html,
  body.login-page {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    background: #02070d;
  }
}

@media (max-width: 760px) and (max-height: 560px) {
  .login-panel {
    top: 50%;
    width: min(336px, calc(100vw - 48px));
    padding: 9px;
  }

  .login-logo {
    width: min(112px, 38vw);
    margin-bottom: 6px;
  }

  .login-form {
    gap: 5px;
  }

  .login-form label {
    gap: 2px;
  }

  .login-input,
  .login-form input {
    min-height: 36px;
    height: 36px;
  }

  .login-form button {
    height: 38px;
  }
}

.mfa-page {
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 24px;
}

.mfa-panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  padding: 24px;
  border: 1px solid rgba(210, 222, 232, 0.24);
  border-radius: 8px;
  color: #f5f8fa;
  background: rgba(4, 10, 16, 0.94);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(14px);
}

.mfa-panel-compact {
  width: min(460px, 100%);
}

.mfa-panel > img {
  display: block;
  width: 156px;
  height: auto;
  margin: 0 0 20px;
}

.mfa-panel > header {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 20px;
}

.mfa-panel > header > i {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(52, 211, 122, 0.42);
  border-radius: 50%;
  color: #43dc83;
  background: rgba(52, 211, 122, 0.1);
  font-size: 24px;
}

.mfa-panel header span,
.mfa-panel header h1,
.mfa-panel header p {
  display: block;
  margin: 0;
}

.mfa-panel header span {
  color: #43dc83;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.mfa-panel header h1 {
  margin-top: 2px;
  color: #ffffff;
  font-size: 23px;
  font-weight: 800;
}

.mfa-panel header p,
.mfa-help {
  color: rgba(225, 233, 239, 0.68);
  font-size: 13px;
}

.mfa-help-large {
  margin: 18px 0;
  font-size: 15px;
}

.mfa-error,
.mfa-recovery-warning {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 16px;
  padding: 11px 12px;
  border: 1px solid rgba(224, 90, 80, 0.48);
  border-radius: 6px;
  color: #ffffff;
  background: rgba(224, 90, 80, 0.16);
  font-size: 13px;
}

.mfa-recovery-warning {
  border-color: rgba(224, 177, 76, 0.42);
  background: rgba(224, 177, 76, 0.12);
}

.mfa-setup-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
}

.mfa-qr {
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 6px;
  background: #ffffff;
}

.mfa-qr img {
  width: 100%;
  height: auto;
}

.mfa-steps > p {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin: 0 0 9px;
  color: rgba(235, 240, 244, 0.82);
  font-size: 13px;
}

.mfa-steps > p strong {
  display: grid;
  flex: 0 0 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #07100b;
  background: #43dc83;
  font-size: 11px;
}

.mfa-form {
  display: grid;
  gap: 8px;
}

.mfa-form label {
  color: rgba(225, 233, 239, 0.72);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.mfa-code-input {
  display: flex;
  height: 46px;
  align-items: center;
  border: 1px solid rgba(210, 222, 232, 0.26);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.mfa-code-input:focus-within {
  border-color: #43dc83;
  box-shadow: 0 0 0 3px rgba(52, 211, 122, 0.12);
}

.mfa-code-input i {
  width: 42px;
  color: #43dc83;
  text-align: center;
}

.mfa-code-input input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  color: #ffffff;
  background: transparent;
  font-size: 18px;
  letter-spacing: 0;
}

.mfa-form button,
.mfa-primary-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: #187a45;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.mfa-form button:hover,
.mfa-primary-link:hover {
  color: #ffffff;
  background: #209554;
}

.mfa-help {
  margin: 13px 0 0;
}

.mfa-cancel {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-top: 16px;
  color: rgba(225, 233, 239, 0.72);
  font-size: 13px;
  text-decoration: none;
}

.mfa-recovery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
}

.mfa-recovery-grid code {
  padding: 10px;
  border: 1px solid rgba(210, 222, 232, 0.2);
  border-radius: 5px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  text-align: center;
}

@media (max-width: 620px) {
  .mfa-page {
    display: block;
    height: auto;
    min-height: 100svh;
    max-height: none;
    overflow: auto;
    padding: 12px;
  }

  .mfa-panel {
    margin: 18px auto;
    padding: 18px;
  }

  .mfa-setup-grid,
  .mfa-recovery-grid {
    grid-template-columns: 1fr;
  }

  .mfa-qr {
    width: min(220px, 100%);
    margin: 0 auto;
  }
}
