.login-modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 0;
  font-family: var(--sans);
  padding: 24px;
  pointer-events: none;
  position: fixed;
  transition: opacity 220ms ease, visibility 220ms ease;
  visibility: hidden;
  z-index: 400;
}

.login-modal--open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.login-modal__backdrop {
  background: rgba(4, 20, 16, 0.74);
  cursor: default;
  inset: 0;
  position: absolute;
  width: 100%;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.login-modal__dialog {
  background: #fbfaf6;
  border: 1px solid rgba(123, 100, 65, 0.2);
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(1, 20, 15, 0.36);
  color: #17211d;
  max-height: calc(100vh - 48px);
  max-width: 520px;
  overflow-y: auto;
  padding: 42px 38px 28px;
  position: relative;
  transform: translateY(18px) scale(0.98);
  transition: transform 260ms cubic-bezier(0.2, 0.75, 0.25, 1);
  width: 100%;
}

.login-modal__dialog::before {
  background: linear-gradient(90deg, #075044 0 68%, #bd5538 68% 84%, #bca574 84%);
  border-radius: 14px 14px 0 0;
  content: "";
  height: 4px;
  inset: 0 0 auto;
  position: absolute;
}

.login-modal--open .login-modal__dialog {
  transform: translateY(0) scale(1);
}

.login-modal__close {
  background: transparent;
  cursor: pointer;
  height: 40px;
  position: absolute;
  right: 16px;
  top: 16px;
  width: 40px;
}

.login-modal__close span {
  background: #294039;
  height: 1px;
  left: 12px;
  position: absolute;
  top: 20px;
  transform: rotate(45deg);
  width: 17px;
}

.login-modal__close span:last-child {
  transform: rotate(-45deg);
}

.login-modal__brand {
  display: block;
  margin: 1px auto 25px;
  width: 202px;
}

.login-modal__logo {
  height: auto;
  width: 100%;
}

.login-modal__head {
  text-align: center;
}

.login-modal__head small {
  color: #a66d3e;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.19em;
  line-height: 1.5;
}

.login-modal__head h2 {
  color: #17211d;
  font-family: var(--serif);
  font-size: clamp(30px, 2.5vw, 36px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.18;
  margin: 11px 0 9px;
}

.login-modal__head p {
  color: #64716b;
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 25px;
}

.login-modal__alert {
  background: #fff3ef;
  border: 1px solid #e7c2b6;
  border-radius: 5px;
  color: #923d2b;
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 14px;
  padding: 10px 12px;
}

.login-modal__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-modal__form > label {
  display: flex;
  flex-direction: column;
}

.login-modal__form > label > span:first-child {
  color: #294039;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 7px;
}

.login-modal__form > label > input,
.login-modal__password-field > input {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #cdd6d1;
  border-radius: 5px;
  font-size: 14px;
  height: 50px;
  outline: 0;
  padding: 0 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
  width: 100%;
}

.login-modal__form > label > input:focus,
.login-modal__password-field > input:focus {
  border-color: #075044;
  box-shadow: 0 0 0 3px rgba(7, 80, 68, 0.1);
}

.login-modal__password-field {
  display: block;
  position: relative;
}

.login-modal__password-field > input {
  padding-right: 50px;
}

.login-modal__password-field > button {
  align-items: center;
  background: transparent;
  color: #65736d;
  cursor: pointer;
  display: flex;
  height: 42px;
  justify-content: center;
  position: absolute;
  right: 4px;
  top: 4px;
  transition: color 160ms ease;
  width: 42px;
}

.login-modal__password-field > button:hover,
.login-modal__password-field > button:focus-visible {
  color: #075044;
  outline: none;
}

.login-modal__password-field > button:focus-visible {
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(7, 80, 68, 0.18);
}

.login-modal__password-field svg {
  height: 20px;
  width: 20px;
}

.password-eye-hide,
.login-modal__password-field > button[aria-pressed="true"] .password-eye-show { display: none; }
.login-modal__password-field > button[aria-pressed="true"] .password-eye-hide { display: block; }

.login-modal__meta {
  align-items: flex-start;
  color: #6d7377;
  display: flex;
  font-size: 11px;
  justify-content: space-between;
  margin-top: -2px;
}

.login-modal__meta label {
  font-size: 12px;
}

.login-modal__remember,
.auth-remember {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.login-modal__remember > small,
.auth-remember > small {
  color: #84908a;
  font-size: 10px;
  line-height: 1.45;
  max-width: 285px;
  padding-left: 25px;
}

.remember-login {
  align-items: center;
  color: #42514b;
  cursor: pointer;
  display: inline-flex;
  font-weight: 500;
  gap: 7px;
  line-height: 1.4;
  position: relative;
  width: fit-content;
}

.remember-login input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.remember-login i {
  background: #fff;
  border: 1px solid #aebbb5;
  border-radius: 4px;
  flex: 0 0 18px;
  height: 18px;
  position: relative;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
  width: 18px;
}

.remember-login i::after {
  border-bottom: 2px solid #fff;
  border-right: 2px solid #fff;
  content: "";
  height: 8px;
  left: 5px;
  opacity: 0;
  position: absolute;
  top: 2px;
  transform: rotate(42deg) scale(.7);
  transition: opacity 150ms ease, transform 150ms ease;
  width: 4px;
}

.remember-login input:checked + i {
  background: #075044;
  border-color: #075044;
}

.remember-login input:checked + i::after {
  opacity: 1;
  transform: rotate(42deg) scale(1);
}

.remember-login input:focus-visible + i {
  box-shadow: 0 0 0 3px rgba(7, 80, 68, .14);
}

.login-modal__meta a,
.login-modal__register a {
  color: #a84f36;
  font-weight: 600;
}

.login-modal__meta > a {
  flex-shrink: 0;
  margin-top: 1px;
}

.login-modal__submit {
  align-items: center;
  background: #075044;
  border-radius: 5px;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 14px;
  font-weight: 600;
  height: 52px;
  justify-content: center;
  margin-top: 1px;
  transition: background-color 160ms ease, transform 160ms ease;
}

.login-modal__submit:hover {
  background: #0a6858;
  transform: translateY(-1px);
}

.login-modal__submit:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.login-modal__submit span {
  font-size: 19px;
  margin-left: 9px;
}

.login-modal__register {
  color: #747a7e;
  font-size: 12px;
  margin: 17px 0 0;
  text-align: center;
}

.login-modal__security {
  border-top: 1px solid #dedfd9;
  color: #7d8782;
  font-size: 10px;
  line-height: 1.45;
  margin: 20px 0 0;
  padding: 16px 20px 0;
  text-align: center;
}

@media (max-width: 560px) {
  .login-modal {
    align-items: flex-end;
    padding: 0;
  }

  .login-modal__dialog {
    border-radius: 18px 18px 0 0;
    max-height: 94vh;
    padding: 35px 22px 23px;
    transform: translateY(100%);
  }

  .login-modal__dialog::before {
    border-radius: 18px 18px 0 0;
  }

  .login-modal__brand {
    margin-bottom: 20px;
    width: 170px;
  }

  .login-modal__head h2 {
    font-size: 29px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-modal,
  .login-modal__dialog {
    transition: none;
  }
}
