:root {
  --fleet-blue: #17409d;
  --fleet-navy: #111b57;
  --fleet-link: #236bc1;
  --field-bg: #f1f2f6;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  overflow-x: hidden;
  font-family: "Open Sans", Arial, sans-serif;
  color: #181818;
}

button,
input {
  font: inherit;
}

a {
  text-decoration: none;
}

.login-page {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  min-height: 100vh;
  padding: 38px clamp(44px, 7.4vw, 118px) 38px 40px;
  overflow: hidden;
  background: url("../assets/login-background.jpg") center center / cover no-repeat;
}

.login-card {
  width: min(420px, 100%);
  min-height: 650px;
  padding: 45px 44px 35px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 38px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 12px 34px rgba(7, 24, 62, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand-logo {
  display: block;
  width: 206px;
  height: 60px;
  margin: 0 auto 38px;
}

.form-group {
  margin-bottom: 21px;
}

.fleet-input,
.captcha-input {
  border: 1px solid transparent;
  background-color: var(--field-bg);
  color: #262626;
  box-shadow: none;
}

.fleet-input {
  height: 50px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 14px;
}

.fleet-input::placeholder,
.captcha-input::placeholder {
  color: #878787;
  opacity: 1;
}

.fleet-input:focus,
.captcha-input:focus {
  border-color: #6b91cf;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(35, 107, 193, 0.12);
}

.field-link {
  display: block;
  width: max-content;
  margin: 8px 2px 0 auto;
  color: var(--fleet-link);
  font-size: 12px;
  font-weight: 600;
}

.field-link:hover,
.field-link:focus {
  color: #114a96;
}

.password-wrap {
  position: relative;
}

.password-wrap .fleet-input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 14px;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 4px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #236bc1;
  transform: translateY(-50%);
  place-items: center;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(35, 107, 193, 0.1);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.password-toggle.is-hidden svg {
  opacity: 0.55;
}

.captcha-row {
  display: grid;
  grid-template-columns: 130px 24px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 3px 0 18px;
}

#captchaCanvas {
  width: 130px;
  height: 44px;
  border-radius: 10px;
  background: #eff6ff;
}

.refresh-button {
  display: grid;
  width: 24px;
  height: 30px;
  padding: 4px;
  border: 0;
  background: transparent;
  place-items: center;
}

.refresh-button img {
  width: 17px;
  height: 17px;
  transition: transform 220ms ease;
}

.refresh-button:hover img,
.refresh-button:focus-visible img {
  transform: rotate(90deg);
}

.captcha-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  background-color: #fff;
  font-size: 12px;
}

.form-message {
  min-height: 17px;
  margin: -6px 0 8px;
  color: #d42e2e;
  font-size: 12px;
  text-align: center;
}

.quick-links {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 20px;
}

.quick-links a {
  padding: 0 10px;
  color: var(--fleet-navy);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.quick-links span {
  width: 1px;
  height: 15px;
  background: #6e7180;
}

.quick-links a:hover,
.quick-links a:focus {
  color: var(--fleet-link);
}

.login-button {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 10px;
  background-image: linear-gradient(97deg, #1c429e 3%, #0a0a5f 87%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.4px;
  box-shadow: 0 7px 16px rgba(17, 27, 87, 0.2);
}

.login-button:hover,
.login-button:focus,
.login-button:active {
  background-image: linear-gradient(97deg, #2550b5 3%, #11117a 87%) !important;
  color: #fff !important;
}

.help-text {
  margin: 22px 0 0;
  color: #444;
  font-size: 12px;
  text-align: center;
}

.help-text a {
  margin-left: 3px;
  color: var(--fleet-link);
  font-weight: 700;
}

.chat-button {
  position: fixed;
  right: 25px;
  bottom: 38px;
  z-index: 4;
  display: grid;
  width: 54px;
  height: 54px;
  padding: 13px;
  border: 0;
  border-radius: 50%;
  background: #152b78;
  color: #fff;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.28);
  place-items: center;
}

.chat-button svg {
  width: 27px;
  height: 27px;
  fill: currentColor;
}

.chat-button:hover,
.chat-button:focus-visible {
  background: #2148a9;
}

.version {
  position: fixed;
  right: 16px;
  bottom: 10px;
  z-index: 3;
  color: rgba(255, 255, 255, 0.76);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

@media (max-height: 760px) and (min-width: 769px) {
  .login-page {
    align-items: center;
    padding-top: 22px;
    padding-bottom: 22px;
  }

  .login-card {
    min-height: 0;
    padding-top: 30px;
    padding-bottom: 27px;
  }

  .brand-logo {
    margin-bottom: 25px;
  }

  .form-group {
    margin-bottom: 15px;
  }

  .help-text {
    margin-top: 17px;
  }
}

@media (max-width: 768px) {
  .login-page {
    justify-content: center;
    min-height: 100svh;
    padding: 28px 20px 52px;
    background-position: 42% center;
  }

  .login-page::before {
    position: absolute;
    inset: 0;
    background: rgba(9, 28, 69, 0.16);
    content: "";
  }

  .login-card {
    position: relative;
    z-index: 1;
    min-height: 0;
    padding: 36px 30px 30px;
    border-radius: 28px;
  }

  .chat-button {
    right: 18px;
    bottom: 35px;
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 420px) {
  .login-card {
    padding-right: 20px;
    padding-left: 20px;
  }

  .brand-logo {
    width: 185px;
    height: auto;
    margin-bottom: 30px;
  }

  .captcha-row {
    grid-template-columns: 112px 22px minmax(0, 1fr);
    gap: 7px;
  }

  #captchaCanvas {
    width: 112px;
  }

  .quick-links a {
    padding: 0 7px;
    font-size: 11px;
  }
}
