:root {
  --auth-error: #ff383c;
  --auth-alert-text: #17234b;
}

.auth-page {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  overflow: hidden;
  background: var(--color-brand);
}

.auth-page::before,
.auth-page::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.auth-page::before {
  background: url("../assets/images/login-background.png") center / cover no-repeat;
  opacity: 0.15;
}

.auth-page::after {
  background: #f6f6f6;
  opacity: 0.08;
}

.auth-page__logo {
  position: absolute;
  top: 24px;
  left: 50%;
  width: 140px;
  height: 57px;
  transform: translateX(-50%);
}

.auth-view {
  position: absolute;
  top: calc(50% + 40px);
  left: 50%;
  display: flex;
  width: min(440px, calc(100% - 32px));
  flex-direction: column;
  align-items: center;
  gap: 24px;
  transform: translate(-50%, -50%);
}

.auth-view[hidden] {
  display: none;
}

.auth-card {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 18px;
  margin: 0;
  padding: 24px;
  border: 3px solid var(--color-page);
  background: var(--color-page);
}

.auth-card--registration {
  gap: 16px;
}

.auth-card--centered {
  align-items: center;
}

.auth-card--centered > .auth-form,
.auth-card--centered > .auth-message__content {
  width: calc(100% + 6px);
}

.auth-card--compact-gap {
  gap: 16px;
}

.auth-card__title {
  margin: 0;
  color: var(--color-brand);
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.auth-field__label {
  color: var(--color-brand);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.auth-field__control {
  width: 100%;
  height: 44px;
  padding: 8px 10px;
  border: 1px solid rgba(12, 53, 191, 0.5);
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--color-brand);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
}

.auth-field__control::placeholder {
  color: var(--color-brand);
  opacity: 0.6;
}

.auth-field__control:focus-visible {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 1px var(--color-brand);
}

.auth-field--error .auth-field__control {
  border-color: var(--auth-error);
}

.auth-field__error,
.auth-field__hint {
  color: var(--auth-error);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.1;
}

.auth-field--strong-error .auth-field__error {
  font-weight: 700;
}

.auth-field__hint {
  color: #737373;
  font-weight: 400;
  opacity: 0.8;
}

.auth-password {
  position: relative;
}

.auth-password__input {
  padding-right: 42px;
}

.auth-password__toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  display: grid;
  width: 21px;
  height: 21px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  place-items: center;
  transform: translateY(-50%);
}

.auth-password__toggle img {
  display: block;
  width: 21px;
  height: 21px;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-options a,
.auth-check {
  color: var(--color-brand);
  font-size: 12px;
  line-height: 1.1;
}

.auth-options a {
  font-weight: 500;
  text-decoration: none;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 400;
  opacity: 0.8;
}

.auth-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.auth-check > span:first-of-type {
  position: relative;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border: 1px solid var(--color-brand-alt);
}

.auth-check input:checked + span:first-of-type {
  background: var(--color-brand);
}

.auth-check input:checked + span:first-of-type::after {
  position: absolute;
  top: 1px;
  left: 3px;
  width: 3px;
  height: 6px;
  border: solid white;
  border-width: 0 1px 1px 0;
  content: "";
  transform: rotate(45deg);
}

.auth-check--consent a {
  color: inherit;
}

.auth-button {
  display: flex;
  width: 100%;
  height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 4px solid var(--color-brand);
  background: var(--color-brand);
  color: var(--color-white);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.auth-button--disabled {
  cursor: default;
  opacity: 1;
}

.auth-button--disabled::first-line {
  opacity: 0.5;
}

.auth-button:disabled {
  color: rgba(255, 255, 255, 0.5);
}

.auth-view__link {
  display: flex;
  gap: 6px;
  margin: 0;
  color: var(--color-white);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
}

.auth-view__link a {
  font-weight: 600;
}

.auth-alert {
  position: relative;
  display: flex;
  width: 100%;
  height: 70px;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
}

.auth-alert__frame {
  position: absolute;
  inset: 0;
  width: 392px;
  height: 70px;
  pointer-events: none;
}

.auth-alert__icon {
  position: relative;
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border: 1px solid var(--auth-error);
  border-radius: 50%;
  color: var(--auth-error);
  font-family: "Cormorant Garamond", serif;
  font-size: 16px;
  font-weight: 600;
  place-items: center;
}

.auth-alert__copy {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  white-space: nowrap;
}

.auth-alert__copy strong {
  color: var(--auth-error);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.auth-alert__copy small {
  color: var(--auth-alert-text);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.15;
}

.auth-view--blocked {
  gap: 0;
}

.auth-card--blocked {
  align-items: center;
  gap: 18px;
}

.auth-blocked__content {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 48px;
}

.auth-blocked__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--color-brand);
  text-align: center;
}

.auth-blocked__copy p {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
}

.auth-blocked__back {
  color: var(--color-brand);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.auth-view--fixed-top {
  transform: translateX(-50%);
}

.auth-view--recovery {
  top: calc(50% - 119px);
}

.auth-view--new-password {
  top: calc(50% - 157px);
}

.auth-view--new-password-error {
  top: calc(50% - 160px);
}

.auth-view--sent {
  top: calc(50% + 6px);
}

.auth-view--changed {
  top: calc(50% + 40px);
}

.auth-card__back {
  color: var(--color-brand);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.auth-message__content {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 48px;
}

.auth-message__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--color-brand);
  text-align: center;
}

.auth-message__copy p {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
}

.auth-card--changed {
  gap: 0;
}

.auth-card--email-access,
.auth-card--email-code {
  gap: 18px;
}

.email-access__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--color-brand);
  text-align: center;
}

.email-access__copy p {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
}

.email-access__copy strong {
  font-weight: 600;
}

.auth-card--email-password {
  gap: 16px;
}

.auth-view--email-password {
  top: 230px;
  transform: translateX(-50%);
}

.email-code {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
  padding: 0;
  border: 0;
}

.email-code input {
  width: 100%;
  height: 61px;
  padding: 0;
  border: 1px solid rgba(12, 53, 191, 0.7);
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--color-brand);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.1;
  text-align: center;
}

.email-code input:focus-visible {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 1px var(--color-brand);
}

.email-code input[aria-invalid="true"] {
  border-color: var(--auth-error);
}

.email-code-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.email-code-group--error {
  gap: 12px;
}

.email-code__error {
  margin: 0;
  color: var(--auth-error);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.1;
}

.email-code__resend {
  min-height: 17px;
  justify-content: center;
}

.email-code__resend a {
  font-weight: 600;
}

.auth-view--email-code .ui-button:disabled .ui-button__label {
  opacity: 0.5;
}

@media (max-width: 520px) {
  .auth-page {
    min-height: 720px;
    overflow: auto;
  }

  .auth-page__logo {
    top: 20px;
  }

  .auth-view {
    top: 110px;
    width: calc(100% - 24px);
    transform: translateX(-50%);
  }

  .auth-view--fixed-top,
  .auth-view--message,
  .auth-view--email-password {
    top: 110px;
    transform: translateX(-50%);
  }

  .email-code {
    gap: 6px;
  }

  .auth-card {
    padding: 20px 18px;
  }

  .auth-alert__frame {
    width: 100%;
  }

  .auth-alert__copy {
    white-space: normal;
  }
}
