.labeled-field {
  position: relative;
  margin-bottom: 35px;
}

.labeled-field__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.labeled-field__label-text {
  @include mainBodyText;
  margin-bottom: 25px;

  @media (max-width: $mobile) {
    margin-bottom: 20px;
  }

  .login-page & {
    @media (max-width: $mobile) {
      min-height: 38px;
    }
  }
}

.labeled-field__input {
  display: block;
  box-sizing: border-box;
  width: 300px;
  max-width: 100%;
  height: 50px;
  font-family: inherit;
  font-weight: 500;
  text-align: center;
  font-size: 17px;
  line-height: 36px;
  color: $text-main;
  background-color: $bg-accent;
  border: 1px solid rgba(208, 209, 209, 0.8);
  border-radius: 25px;

  @media (max-width: $mobile) {
    font-weight: 400;
    font-size: 16px;
  }

  &::placeholder {
    color: $gray-medium;
  }

  &:hover {
    background-color: #F2F2F2;
    border-color: #D7D8D7;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
  }

  &:focus {
    background-color: $bg-accent;
    border-color: #D7D8D7;
    box-shadow: none;
    outline: none;

    &::placeholder {
      color: rgba(201, 199, 199, 0.5);
    }
  }

  .labeled-field--invalid & {
    color: $red;
    background-color: rgba(255, 0, 0, 0.1);
    border-color: $red;
  }
}

.labeled-field__error-message {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, 5px);
  display: block;
  width: 800px;
  max-width: 100%;
  font-size: 16px;
  line-height: 30px;
  color: $red;

  @media (max-width: $mobile) {
    transform: translate(-50%, 9px);
    font-size: 12px;
    line-height: 17px;
    letter-spacing: 0.01em;
  }
}
