@font-face {
  font-family: "Chuem Inter";
  src: url("/assets/fonts/inter-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Chuem Inter";
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html:has(.chuem-auth-page),
body:has(.chuem-auth-page) {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #dceeff;
}

html:has(#app.chuem-login-page) {
  scrollbar-gutter: auto !important;
}

#app.chuem-login-page {
  width: 100%;
  min-width: 0;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  color: #0b1a3d;
  background: none;
}

#app.chuem-login-page::before,
#app.chuem-login-page::after {
  display: none !important;
  content: none !important;
}

.chuem-auth-page,
.chuem-auth-page *,
.chuem-auth-page button,
.chuem-auth-page input {
  box-sizing: border-box;
  font-family: "Chuem Inter", Inter, system-ui, Arial, sans-serif;
  letter-spacing: 0;
}

.chuem-auth-page {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  min-width: 0;
  min-height: 100dvh;
  overflow: hidden;
  background-image: url("/assets/auth/auth-background-v6.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.chuem-auth-card {
  position: relative;
  flex: 0 0 auto;
  width: 540px;
  height: 646px;
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(31, 71, 158, 0.1);
}

.chuem-auth-mark {
  position: absolute;
  top: 29px;
  left: 211px;
  display: block;
  width: 118px;
  height: 118px;
  object-fit: contain;
}

.chuem-auth-card h1 {
  position: absolute;
  top: 176px;
  left: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 456px;
  height: 46px;
  margin: 0;
  color: #0b1a3d;
  font-size: 34px;
  font-style: normal;
  font-weight: 600;
  line-height: normal;
  text-align: center;
}

.chuem-auth-form {
  position: absolute;
  inset: 0;
  margin: 0;
}

.chuem-auth-label {
  position: absolute;
  left: 42px;
  width: 456px;
  height: 20px;
  margin: 0;
  color: #0b1a3d;
  font-size: 16px;
  font-style: normal;
  font-weight: 500;
  line-height: normal;
}

.chuem-auth-login-label { top: 257px; }
.chuem-auth-password-label { top: 375px; }

.chuem-auth-input {
  width: 100%;
  height: 60px;
  min-height: 60px;
  margin: 0;
  padding: 0 19px;
  border: 1px solid #cfd9eb;
  border-radius: 10px;
  outline: 0;
  color: #0b1a3d;
  background: #fefeff;
  box-shadow: none;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 24px;
  transition: border-color 0.15s ease, outline-color 0.15s ease;
}

.chuem-auth-input::placeholder {
  color: #7d8fad;
  opacity: 1;
}

.chuem-auth-input:focus {
  border-color: #2e7cf6;
  outline: 2px solid #2e7cf6;
  outline-offset: 2px;
  box-shadow: none;
}

.chuem-auth-login-input {
  position: absolute;
  top: 286px;
  left: 42px;
  width: 456px;
}

.chuem-auth-password-field {
  position: absolute;
  top: 404px;
  left: 42px;
  width: 456px;
  height: 60px;
}

.chuem-auth-password-field .chuem-auth-input {
  padding-right: 62px;
}

.chuem-auth-password-toggle {
  position: absolute;
  top: 0;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 60px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  outline: 0;
  color: #7284a2;
  background: transparent;
  cursor: pointer;
}

.chuem-auth-password-toggle img {
  display: block;
  width: 22px;
  height: 22px;
}

.chuem-auth-password-toggle.is-visible::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 1.5px;
  border-radius: 2px;
  background: #7284a2;
  transform: rotate(-42deg);
}

.chuem-auth-password-toggle:focus-visible,
.chuem-auth-recovery-link:focus-visible,
.chuem-auth-submit:focus-visible,
.chuem-recovery-dialog button:focus-visible {
  outline: 2px solid #2e7cf6;
  outline-offset: 2px;
}

.chuem-auth-error {
  position: absolute;
  top: 466px;
  left: 42px;
  width: 456px;
  height: 17px;
  overflow: hidden;
  color: #d64045;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

.chuem-auth-card.has-auth-error .chuem-auth-input {
  border-color: #d64045;
}

.chuem-auth-submit {
  position: absolute;
  top: 486px;
  left: 42px;
  display: grid;
  place-items: center;
  width: 456px;
  height: 64px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(90deg, #0a40e8 0%, #0d80f2 56%, #0dc9db 100%);
  box-shadow: 0 8px 16px rgba(13, 79, 224, 0.2);
  font-size: 18px;
  font-style: normal;
  font-weight: 600;
  line-height: 24px;
  cursor: pointer;
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.chuem-auth-submit:hover:not(:disabled) { filter: brightness(1.035); }
.chuem-auth-submit:active:not(:disabled) { filter: brightness(0.98); }
.chuem-auth-submit:disabled { cursor: wait; opacity: 0.78; }

.chuem-auth-recovery-link {
  position: absolute;
  top: 578px;
  left: 42px;
  display: grid;
  place-items: center;
  width: 456px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #0857eb;
  background: transparent;
  box-shadow: none;
  font-size: 16px;
  font-style: normal;
  font-weight: 500;
  line-height: 24px;
  text-decoration: none;
  cursor: pointer;
}

.chuem-auth-recovery-link:hover { text-decoration: underline; }

.chuem-recovery-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(11, 26, 61, 0.2);
}

.chuem-recovery-dialog {
  width: min(456px, 100%);
  padding: 34px;
  border-radius: 20px;
  color: #0b1a3d;
  background: #fff;
  box-shadow: 0 18px 42px rgba(31, 71, 158, 0.18);
  text-align: center;
}

.chuem-recovery-dialog h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
}

.chuem-recovery-dialog p {
  margin: 18px 0 24px;
  color: #536681;
  font-size: 15px;
  line-height: 1.5;
}

.chuem-recovery-dialog button {
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(90deg, #0a40e8 0%, #0d80f2 56%, #0dc9db 100%);
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 768px) {
  .chuem-auth-page { padding: 16px; }

  .chuem-auth-card {
    width: calc(100vw - 32px);
    max-width: 540px;
  }

  .chuem-auth-card h1,
  .chuem-auth-label,
  .chuem-auth-login-input,
  .chuem-auth-password-field,
  .chuem-auth-error,
  .chuem-auth-submit,
  .chuem-auth-recovery-link {
    left: 28px;
    width: calc(100% - 56px);
  }

  .chuem-auth-mark {
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 420px) {
  .chuem-auth-card h1 { font-size: 28px; }

  .chuem-auth-mark {
    width: 96px;
    height: 96px;
  }
}
